From a015190fd4670fe7393e2b3495a654d628349279 Mon Sep 17 00:00:00 2001 From: teabyte Date: Sun, 7 Jan 2024 18:00:57 +0300 Subject: [PATCH] cleaning, added daisyui --- components/Collapse.tsx | 24 +++++++++++++ components/Drawer.tsx | 54 ++++++++++++++++++++++++++++ components/Footer.tsx | 64 +++++++++++++++++++++++++++++++++ components/Nav.tsx | 80 ++--------------------------------------- deno.json | 3 +- routes/[...slug].tsx | 33 +---------------- routes/_404.tsx | 40 +++++++++++---------- routes/_app.tsx | 5 --- routes/index.tsx | 7 ++-- static/moaco.js | 1 - static/resizer.js | 1 - static/styles.css | 3 +- tailwind.config.ts | 2 ++ 13 files changed, 178 insertions(+), 139 deletions(-) create mode 100644 components/Collapse.tsx create mode 100644 components/Drawer.tsx create mode 100644 components/Footer.tsx diff --git a/components/Collapse.tsx b/components/Collapse.tsx new file mode 100644 index 0000000..1106c42 --- /dev/null +++ b/components/Collapse.tsx @@ -0,0 +1,24 @@ +import { Course } from "../utils/types.ts"; + +export default function Collapse( + { titile, courses }: { titile: string; courses: Course[] }, +) { + return ( +
+ +
+ {titile} +
+
+ {courses.map((course) => ( +
  • + {course.title} +
  • + ))} +
    +
    + ); +} diff --git a/components/Drawer.tsx b/components/Drawer.tsx new file mode 100644 index 0000000..b5295d2 --- /dev/null +++ b/components/Drawer.tsx @@ -0,0 +1,54 @@ +import IconAdjustmentsDown from "https://deno.land/x/tabler_icons_tsx@0.0.5/tsx/adjustments-down.tsx"; + +import { Course, CourseGroup } from "../utils/types.ts"; +import Collapse from "./Collapse.tsx"; + +export default function Drawer( + { courses }: { courses: (Course | CourseGroup)[] }, +) { + return ( +
    + +
    + +
    +
    + + +
    +
    + ); +} diff --git a/components/Footer.tsx b/components/Footer.tsx new file mode 100644 index 0000000..7138a3b --- /dev/null +++ b/components/Footer.tsx @@ -0,0 +1,64 @@ +import BrandGithub from "https://deno.land/x/tabler_icons_tsx@0.0.3/tsx/brand-github.tsx"; + +export default function Footer() { + const menus = [ + { + title: "الصفحات", + children: [ + { name: "الصفحة الرئيسية", href: "#" }, + { name: "المدونة", href: "#" }, + { name: "الدروس", href: "#" }, + ], + }, + { + title: "المجتمع", + children: [ + { name: "قناه", href: "https://t.me/NakhlahJS" }, + { name: "جروب", href: "https://t.me/Unassisted" }, + ], + }, + ]; + + return ( +
    +
    +
    +
    + نخلة جي أس +
    +
    +
    + اكتسب مهارات جافاسكربت بسهولة وفعالية +
    +
    + + {menus.map((item) => ( +
    +
    {item.title}
    + +
    + ))} + +
    + + +
    +
    + ); +} diff --git a/components/Nav.tsx b/components/Nav.tsx index 80b8ea0..00d82ea 100644 --- a/components/Nav.tsx +++ b/components/Nav.tsx @@ -1,29 +1,8 @@ import { cache, populateCache } from "../utils/course-cache.ts"; -import { Course } from "../utils/types.ts"; +import Drawer from "./Drawer.tsx"; populateCache(); -function Collapse({ titile, courses }: { titile: string; courses: Course[] }) { - return ( -
    - -
    - {titile} -
    -
    - {courses.map((course) => ( -
  • - {course.title} -
  • - ))} -
    -
    - ); -} - export default function NavBar() { return ( ); } diff --git a/deno.json b/deno.json index 77ee1f0..fd86ad8 100644 --- a/deno.json +++ b/deno.json @@ -30,7 +30,8 @@ "tailwindcss/": "npm:/tailwindcss@3.3.5/", "tailwindcss/plugin": "npm:/tailwindcss@3.3.5/plugin.js", "$std/": "https://deno.land/std@0.208.0/", - "$gfm": "https://deno.land/x/gfm@0.1.26/mod.ts" + "$gfm": "https://deno.land/x/gfm@0.1.26/mod.ts", + "daisyui": "npm:daisyui@latest" }, "compilerOptions": { "jsx": "react-jsx", diff --git a/routes/[...slug].tsx b/routes/[...slug].tsx index c62fe4b..59f19a5 100644 --- a/routes/[...slug].tsx +++ b/routes/[...slug].tsx @@ -25,19 +25,17 @@ export default function CoursePage(props: PageProps) { return ( <> - Nakhlahjs - {course.title} + نخلة - {course.title} -