Skip to content

Commit

Permalink
improving cache and editor
Browse files Browse the repository at this point in the history
  • Loading branch information
TeaByte committed Jan 8, 2024
1 parent 5b6f685 commit 1b8d62d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [ ] Markdown and cache ( Better code )
- [ ] Login || LocalStorage and save progress
- [ ] Next and Prev buttons
- [ ] Improve phone users experience
- [x] Themes, theme settings

---
Expand Down
6 changes: 6 additions & 0 deletions routes/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ export default function CoursePage(
dir="ltr"
id="editor"
>
<p
id="editor-loading"
class="flex h-full items-center justify-center text-lg bg-[#1E1E1E] rounded-lg"
>
جاري تحميل المحرر
</p>
</div>
</div>
</div>
Expand Down
4 changes: 1 addition & 3 deletions routes/group/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import { Course, CourseGroup } from "../../utils/types.ts";
import { Handlers } from "$fresh/server.ts";
import { PageProps } from "$fresh/server.ts";
import { Head } from "$fresh/runtime.ts";
import { cache, populateCache } from "../../utils/course-cache.ts";
import { cache } from "../../utils/course-cache.ts";
import CourseCard from "../../components/CourseCard.tsx";
import Footer from "../../components/Footer.tsx";

import IconChevronDown from "https://deno.land/x/[email protected]/tsx/chevron-down.tsx";

populateCache();

// TODO - FIX TYPES
export const handler: Handlers<CourseGroup> = {
GET(_req, ctx) {
Expand Down
12 changes: 9 additions & 3 deletions routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ import { PageProps } from "$fresh/server.ts";
import CourseCard from "../components/CourseCard.tsx";
import { getCourses } from "../utils/course.ts";
import { Course, CourseGroup } from "../utils/types.ts";
import { cache, populateCache } from "../utils/course-cache.ts";
import { cache } from "../utils/course-cache.ts";
import Footer from "../components/Footer.tsx";

import IconChevronDown from "https://deno.land/x/[email protected]/tsx/chevron-down.tsx";

populateCache();

export const handler: Handlers<{ courses: (Course | CourseGroup)[] }> = {
async GET(_req, ctx) {
const courses = await getCourses(cache);
Expand Down Expand Up @@ -72,6 +70,14 @@ export default function BlogIndexPage(
);
}
})}
<p class="mt-4 text-2xl">نعمل على الدروس القادما...</p>
<a
href="https://github.com/TeaByte/NakhlahJS"
class="text-gray-500 hover:underline"
target="_blank"
>
هل تود المساهمه في الموقع ؟
</a>
</section>
</main>
<Footer />
Expand Down
1 change: 1 addition & 0 deletions static/moaco.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ require.config({
});

require(["vs/editor/editor.main"], () => {
document.getElementById("editor-loading").style.display = "none";
window.editor = monaco.editor.create(document.getElementById("editor"), {
language: "javascript",
theme: "vs-dark",
Expand Down

0 comments on commit 1b8d62d

Please sign in to comment.