🧭 rebuild the navigation tree from the Figma design
Browse files at this commit0691d474dd7dedf2d74eb7de2f6b30ef0a860b79Parent: 8e721b9- feat
- 🧭 rebuild the navigation tree from the Figma design
10 changed files +650 -234
- src/components/layout/app-shell.tsx +7 -1
- src/components/layout/command-palette.tsx +4 -0
- src/components/layout/mobile-nav-sheet.tsx +35 -13
- src/components/layout/nav-items.test.ts +121 -47
- src/components/layout/nav-items.ts +173 -116
- src/components/layout/side-nav.tsx +58 -47
- src/components/ui/icons.tsx +35 -0
- src/i18n/messages.ts +127 -10
- src/pages/coming-soon-page.tsx +58 -0
- src/routes/router.tsx +32 -0
src/components/layout/app-shell.tsxmodified+7 -1
| @@ -93,7 +93,11 @@ export function AppShell(props: ParentProps) { | |||
| 93 | </div> | 93 | </div> |
| 94 | 94 | ||
| 95 | <div class="min-h-0 flex-1 overflow-y-auto overflow-x-hidden px-1.5 py-2.5"> | 95 | <div class="min-h-0 flex-1 overflow-y-auto overflow-x-hidden px-1.5 py-2.5"> |
| 96 | - <SideNav collapsed={collapsed()} /> | 96 | + <SideNav |
| 97 | + collapsed={collapsed()} | ||
| 98 | + onOpenCelebi={() => setCelebiOpen(true)} | ||
| 99 | + onOpenProfile={() => setProfileOpen(true)} | ||
| 100 | + /> | ||
| 97 | </div> | 101 | </div> |
| 98 | 102 | ||
| 99 | <SidebarAccount collapsed={collapsed()} onLogout={logout} /> | 103 | <SidebarAccount collapsed={collapsed()} onLogout={logout} /> |
| @@ -105,6 +109,8 @@ export function AppShell(props: ParentProps) { | |||
| 105 | open={mobileOpen()} | 109 | open={mobileOpen()} |
| 106 | onClose={() => setMobileOpen(false)} | 110 | onClose={() => setMobileOpen(false)} |
| 107 | onLogout={logout} | 111 | onLogout={logout} |
| 112 | + onOpenCelebi={() => setCelebiOpen(true)} | ||
| 113 | + onOpenProfile={() => setProfileOpen(true)} | ||
| 108 | /> | 114 | /> |
| 109 | </Show> | 115 | </Show> |
| 110 | 116 | ||
src/components/layout/command-palette.tsxmodified+4 -0
| @@ -205,6 +205,10 @@ export function CommandPalette(props: CommandPaletteProps) { | |||
| 205 | for (const group of visibleNavGroups(userRole, modules.enabled())) { | 205 | for (const group of visibleNavGroups(userRole, modules.enabled())) { |
| 206 | const groupName = t(group.labelKey); | 206 | const groupName = t(group.labelKey); |
| 207 | for (const item of group.items) { | 207 | for (const item of group.items) { |
| 208 | + // Çelebi and the account-settings entries open an existing shell | ||
| 209 | + // surface rather than a route — the palette already offers both | ||
| 210 | + // above, wired to the panel/dialog directly. | ||
| 211 | + if (item.action) continue; | ||
| 208 | list.push({ | 212 | list.push({ |
| 209 | id: `page-${item.to}`, | 213 | id: `page-${item.to}`, |
| 210 | category: "pages", | 214 | category: "pages", |
src/components/layout/mobile-nav-sheet.tsxmodified+35 -13
| @@ -1,6 +1,6 @@ | |||
| 1 | import { For, Show, createSignal } from "solid-js"; | 1 | import { For, Show, createSignal } from "solid-js"; |
| 2 | import { Link, useRouterState } from "@tanstack/solid-router"; | 2 | import { Link, useRouterState } from "@tanstack/solid-router"; |
| 3 | -import { routeNavItem, sidebarNavGroups, type NavItem } from "@/components/layout/nav-items"; | 3 | +import { routeNavItem, visibleNavGroups, type NavItem } from "@/components/layout/nav-items"; |
| 4 | import { SidebarAccount } from "@/components/layout/sidebar-account"; | 4 | import { SidebarAccount } from "@/components/layout/sidebar-account"; |
| 5 | import { IconX } from "@/components/ui/icons"; | 5 | import { IconX } from "@/components/ui/icons"; |
| 6 | import { cn } from "@/lib/cn"; | 6 | import { cn } from "@/lib/cn"; |
| @@ -27,6 +27,8 @@ export function MobileNavSheet(props: { | |||
| 27 | open: boolean; | 27 | open: boolean; |
| 28 | onClose: () => void; | 28 | onClose: () => void; |
| 29 | onLogout: () => void | Promise<void>; | 29 | onLogout: () => void | Promise<void>; |
| 30 | + onOpenCelebi?: () => void; | ||
| 31 | + onOpenProfile?: () => void; | ||
| 30 | }) { | 32 | }) { |
| 31 | const auth = useAuth(); | 33 | const auth = useAuth(); |
| 32 | const t = useT(); | 34 | const t = useT(); |
| @@ -36,9 +38,14 @@ export function MobileNavSheet(props: { | |||
| 36 | 38 | ||
| 37 | // The primary destinations are already one tap away in the tab bar, so the | 39 | // The primary destinations are already one tap away in the tab bar, so the |
| 38 | // sheet lists everything else. | 40 | // sheet lists everything else. |
| 39 | - const groups = () => sidebarNavGroups(auth.user()?.role, modules.enabled()); | 41 | + const groups = () => visibleNavGroups(auth.user()?.role, modules.enabled()); |
| 40 | const current = () => routeNavItem(pathname(), auth.user()?.role); | 42 | const current = () => routeNavItem(pathname(), auth.user()?.role); |
| 41 | const badgeFor = (item: NavItem) => (item.id === "messages" ? feed.unreadMessages().total : 0); | 43 | const badgeFor = (item: NavItem) => (item.id === "messages" ? feed.unreadMessages().total : 0); |
| 44 | + const runAction = (item: NavItem) => { | ||
| 45 | + props.onClose(); | ||
| 46 | + if (item.action === "celebi") props.onOpenCelebi?.(); | ||
| 47 | + if (item.action === "profile") props.onOpenProfile?.(); | ||
| 48 | + }; | ||
| 42 | 49 | ||
| 43 | // Drag-to-dismiss. Only the grab area drives it, so a flick inside the list | 50 | // Drag-to-dismiss. Only the grab area drives it, so a flick inside the list |
| 44 | // still scrolls the list. While dragging, the sheet follows the finger with | 51 | // still scrolls the list. While dragging, the sheet follows the finger with |
| @@ -135,16 +142,12 @@ export function MobileNavSheet(props: { | |||
| 135 | <For each={group.items}> | 142 | <For each={group.items}> |
| 136 | {(item) => { | 143 | {(item) => { |
| 137 | const active = () => current()?.id === item.id; | 144 | const active = () => current()?.id === item.id; |
| 138 | - return ( | 145 | + const rowClass = cn( |
| 139 | - <Link | 146 | + "flex w-full items-center gap-2.5 rounded-md px-3 py-1.5 text-left transition-colors active:bg-muted", |
| 140 | - to={item.to} | 147 | + active() ? "text-primary" : "text-foreground", |
| 141 | - onClick={props.onClose} | 148 | + ); |
| 142 | - aria-current={active() ? "page" : undefined} | 149 | + const content = ( |
| 143 | - class={cn( | 150 | + <> |
| 144 | - "flex items-center gap-2.5 rounded-md px-3 py-1.5 transition-colors active:bg-muted", | ||
| 145 | - active() ? "text-primary" : "text-foreground", | ||
| 146 | - )} | ||
| 147 | - > | ||
| 148 | <span | 151 | <span |
| 149 | class={cn( | 152 | class={cn( |
| 150 | "inline-flex size-7 shrink-0 items-center justify-center rounded-md", | 153 | "inline-flex size-7 shrink-0 items-center justify-center rounded-md", |
| @@ -156,12 +159,31 @@ export function MobileNavSheet(props: { | |||
| 156 | <span class="min-w-0 flex-1 truncate text-[13px] font-medium"> | 159 | <span class="min-w-0 flex-1 truncate text-[13px] font-medium"> |
| 157 | {t(item.labelKey)} | 160 | {t(item.labelKey)} |
| 158 | </span> | 161 | </span> |
| 162 | + <Show when={item.soon}> | ||
| 163 | + <span class="shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground"> | ||
| 164 | + {t("nav.soon")} | ||
| 165 | + </span> | ||
| 166 | + </Show> | ||
| 159 | <Show when={badgeFor(item) > 0}> | 167 | <Show when={badgeFor(item) > 0}> |
| 160 | <span class="flex h-5 min-w-5 items-center justify-center rounded-full bg-rose-500 px-1.5 text-[10px] font-bold text-white"> | 168 | <span class="flex h-5 min-w-5 items-center justify-center rounded-full bg-rose-500 px-1.5 text-[10px] font-bold text-white"> |
| 161 | {badgeFor(item) > 99 ? "99+" : badgeFor(item)} | 169 | {badgeFor(item) > 99 ? "99+" : badgeFor(item)} |
| 162 | </span> | 170 | </span> |
| 163 | </Show> | 171 | </Show> |
| 164 | - </Link> | 172 | + </> |
| 173 | + ); | ||
| 174 | + return ( | ||
| 175 | + <Show | ||
| 176 | + when={!item.action} | ||
| 177 | + fallback={ | ||
| 178 | + <button type="button" onClick={() => runAction(item)} class={rowClass}> | ||
| 179 | + {content} | ||
| 180 | + </button> | ||
| 181 | + } | ||
| 182 | + > | ||
| 183 | + <Link to={item.to} onClick={props.onClose} aria-current={active() ? "page" : undefined} class={rowClass}> | ||
| 184 | + {content} | ||
| 185 | + </Link> | ||
| 186 | + </Show> | ||
| 165 | ); | 187 | ); |
| 166 | }} | 188 | }} |
| 167 | </For> | 189 | </For> |
src/components/layout/nav-items.test.tsmodified+121 -47
| @@ -1,70 +1,138 @@ | |||
| 1 | -import { moduleVisible, pathActive, primaryNavItems, primaryPathActive, routeLabelKey, routeNavItem, sidebarNavGroups, visibleNavItems } from "@/components/layout/nav-items"; | 1 | +import { moduleVisible, pathActive, primaryNavItems, primaryPathActive, routeLabelKey, routeNavItem, visibleNavGroups, visibleNavItems } from "@/components/layout/nav-items"; |
| 2 | 2 | ||
| 3 | test.each([ | 3 | test.each([ |
| 4 | - ["student", ["/", "/courses", "/calendar", "/marks"]], | 4 | + ["student", ["/", "/exams", "/marks"]], |
| 5 | - ["teacher", ["/", "/courses", "/calendar"]], | 5 | + ["teacher", ["/", "/management/classes", "/calendar"]], |
| 6 | - ["manager", ["/", "/courses", "/calendar"]], | 6 | + ["manager", ["/", "/management/classes", "/exams"]], |
| 7 | - ["admin", ["/", "/courses", "/calendar"]], | 7 | + ["admin", ["/", "/management/classes", "/exams"]], |
| 8 | - ["parent", ["/", "/students", "/calendar"]], | 8 | + ["parent", ["/", "/students", "/appointments"]], |
| 9 | ] as const)("%s gets role-specific primary destinations", (role, expected) => { | 9 | ] as const)("%s gets role-specific primary destinations", (role, expected) => { |
| 10 | expect(primaryNavItems(role).map((item) => item.to)).toEqual(expected); | 10 | expect(primaryNavItems(role).map((item) => item.to)).toEqual(expected); |
| 11 | }); | 11 | }); |
| 12 | 12 | ||
| 13 | test("invalid role destinations stay hidden", () => { | 13 | test("invalid role destinations stay hidden", () => { |
| 14 | - expect(visibleNavItems("student").map((item) => item.to)).not.toContain("/school"); | ||
| 15 | - expect(visibleNavItems("parent").map((item) => item.to)).not.toContain("/courses"); | ||
| 16 | expect(visibleNavItems("teacher").map((item) => item.to)).not.toContain("/admin/users"); | 14 | expect(visibleNavItems("teacher").map((item) => item.to)).not.toContain("/admin/users"); |
| 15 | + expect(visibleNavItems("student").map((item) => item.to)).not.toContain("/admin/users"); | ||
| 16 | + expect(visibleNavItems("parent").map((item) => item.to)).not.toContain("/management/staff-work"); | ||
| 17 | }); | 17 | }); |
| 18 | 18 | ||
| 19 | -test("student secondary navigation follows the academic, planning, workspace, services, community flow", () => { | 19 | +test("admin's sidebar mirrors the Figma Operasyon / Yapay zekâ / Kurum tree", () => { |
| 20 | expect( | 20 | expect( |
| 21 | - sidebarNavGroups("student").map((group) => ({ | 21 | + visibleNavGroups("admin").map((group) => ({ |
| 22 | id: group.id, | 22 | id: group.id, |
| 23 | items: group.items.map((item) => item.id), | 23 | items: group.items.map((item) => item.id), |
| 24 | })), | 24 | })), |
| 25 | ).toEqual([ | 25 | ).toEqual([ |
| 26 | - { id: "classes", items: ["homework", "exams"] }, | 26 | + { |
| 27 | - { id: "planning", items: ["events", "appointments"] }, | 27 | + id: "operations", |
| 28 | - { id: "workspace", items: ["notes", "whiteboards", "pomodoro"] }, | 28 | + items: [ |
| 29 | - { id: "services", items: ["meals", "payment-statement"] }, | 29 | + "students-roster", |
| 30 | - { id: "community", items: ["messages", "questions"] }, | 30 | + "teachers-roster", |
| 31 | + "class-groups", | ||
| 32 | + "schedule", | ||
| 33 | + "student-attendance", | ||
| 34 | + "exams", | ||
| 35 | + "question-bank", | ||
| 36 | + "mock-exams", | ||
| 37 | + "optical-reading", | ||
| 38 | + "payments-collection", | ||
| 39 | + ], | ||
| 40 | + }, | ||
| 41 | + { id: "ai", items: ["hezarfen-zeka", "celebi", "sound-studio"] }, | ||
| 42 | + { | ||
| 43 | + id: "institution", | ||
| 44 | + items: ["reports", "license-modules", "users", "data-protection", "school-meals", "staff-work", "settings"], | ||
| 45 | + }, | ||
| 31 | ]); | 46 | ]); |
| 32 | }); | 47 | }); |
| 33 | 48 | ||
| 34 | -test("parent's services group includes meals and payment-statement, consistent with every other role", () => { | 49 | +test("manager sees the same admin tree minus the admin-only entries", () => { |
| 35 | - const services = sidebarNavGroups("parent").find((group) => group.id === "services"); | 50 | + const institution = visibleNavGroups("manager").find((group) => group.id === "institution"); |
| 36 | - expect(services?.items.map((item) => item.id)).toEqual(["meals", "payment-statement"]); | 51 | + expect(institution?.items.map((item) => item.id)).toEqual(["reports", "school-meals", "staff-work", "settings"]); |
| 52 | + expect(institution?.items.map((item) => item.id)).not.toContain("license-modules"); | ||
| 53 | + expect(institution?.items.map((item) => item.id)).not.toContain("users"); | ||
| 54 | + expect(institution?.items.map((item) => item.id)).not.toContain("data-protection"); | ||
| 37 | }); | 55 | }); |
| 38 | 56 | ||
| 39 | -test.each(["student", "parent", "teacher", "manager", "admin"] as const)( | 57 | +test("teacher's sidebar mirrors the Figma Sınıfım / Yapay zekâ / Diğer tree", () => { |
| 40 | - "%s can reach every visible feature and appointments from the sidebar", | 58 | + expect( |
| 41 | - (role) => { | 59 | + visibleNavGroups("teacher").map((group) => ({ |
| 42 | - const paths = [ | 60 | + id: group.id, |
| 43 | - ...primaryNavItems(role).map((item) => item.to), | 61 | + items: group.items.map((item) => item.id), |
| 44 | - ...sidebarNavGroups(role).flatMap((group) => group.items.map((item) => item.to)), | 62 | + })), |
| 45 | - ]; | 63 | + ).toEqual([ |
| 46 | - expect(new Set(paths)).toEqual(new Set(visibleNavItems(role).map((item) => item.to))); | 64 | + { id: "my-classroom", items: ["my-classes", "my-schedule", "student-attendance", "homework", "exams", "whiteboards"] }, |
| 47 | - expect(paths).toContain("/appointments"); | 65 | + { id: "ai", items: ["student-analysis", "pending-approvals", "question-generation", "sound-studio"] }, |
| 48 | - }, | 66 | + { id: "other", items: ["parent-communication", "work", "settings-teacher"] }, |
| 49 | -); | 67 | + ]); |
| 68 | +}); | ||
| 69 | + | ||
| 70 | +test("student's sidebar mirrors the Figma Çalışma / Yapay zekâ / Diğer tree", () => { | ||
| 71 | + expect( | ||
| 72 | + visibleNavGroups("student").map((group) => ({ | ||
| 73 | + id: group.id, | ||
| 74 | + items: group.items.map((item) => item.id), | ||
| 75 | + })), | ||
| 76 | + ).toEqual([ | ||
| 77 | + { id: "study", items: ["study-plan", "topic-mastery", "exam-results", "my-homework", "whiteboards", "pomodoro"] }, | ||
| 78 | + { id: "ai", items: ["celebi", "sound-studio"] }, | ||
| 79 | + { id: "other", items: ["calendar", "settings-student"] }, | ||
| 80 | + ]); | ||
| 81 | +}); | ||
| 82 | + | ||
| 83 | +test("parent's sidebar mirrors the Figma Öğrencim / Kurum tree", () => { | ||
| 84 | + expect( | ||
| 85 | + visibleNavGroups("parent").map((group) => ({ | ||
| 86 | + id: group.id, | ||
| 87 | + items: group.items.map((item) => item.id), | ||
| 88 | + })), | ||
| 89 | + ).toEqual([ | ||
| 90 | + { id: "my-student", items: ["progress-report", "absence", "child-exam-results", "child-study-plan"] }, | ||
| 91 | + { id: "institution", items: ["payment-statement", "appointments", "settings-parent"] }, | ||
| 92 | + ]); | ||
| 93 | +}); | ||
| 94 | + | ||
| 95 | +test("appointments is a parent-only sidebar entry, matching the Figma parent screen", () => { | ||
| 96 | + expect(visibleNavGroups("parent").flatMap((g) => g.items).map((i) => i.to)).toContain("/appointments"); | ||
| 97 | + for (const role of ["student", "teacher", "manager", "admin"] as const) { | ||
| 98 | + const paths = [...primaryNavItems(role).map((i) => i.to), ...visibleNavGroups(role).flatMap((g) => g.items.map((i) => i.to))]; | ||
| 99 | + expect(paths).not.toContain("/appointments"); | ||
| 100 | + } | ||
| 101 | +}); | ||
| 102 | + | ||
| 103 | +test("entries with no backend yet are flagged soon and route to the shared placeholder", () => { | ||
| 104 | + const hezarfenZeka = visibleNavGroups("admin") | ||
| 105 | + .flatMap((g) => g.items) | ||
| 106 | + .find((i) => i.id === "hezarfen-zeka"); | ||
| 107 | + expect(hezarfenZeka?.soon).toBe(true); | ||
| 108 | + expect(hezarfenZeka?.to).toBe("/coming-soon/hezarfen-zeka"); | ||
| 109 | +}); | ||
| 110 | + | ||
| 111 | +test("Çelebi and account settings open an existing shell surface instead of navigating", () => { | ||
| 112 | + const celebi = visibleNavGroups("student") | ||
| 113 | + .flatMap((g) => g.items) | ||
| 114 | + .find((i) => i.id === "celebi"); | ||
| 115 | + expect(celebi?.action).toBe("celebi"); | ||
| 116 | + const settings = visibleNavGroups("student") | ||
| 117 | + .flatMap((g) => g.items) | ||
| 118 | + .find((i) => i.id === "settings-student"); | ||
| 119 | + expect(settings?.action).toBe("profile"); | ||
| 120 | +}); | ||
| 50 | 121 | ||
| 51 | test("nested entity routes keep their primary destination active", () => { | 122 | test("nested entity routes keep their primary destination active", () => { |
| 52 | - expect(pathActive("/courses/course-1", "/courses")).toBe(true); | 123 | + expect(pathActive("/management/classes/class-1", "/management/classes")).toBe(true); |
| 53 | - expect(routeNavItem("/courses/course-1", "teacher")?.id).toBe("classes"); | 124 | + expect(routeNavItem("/management/classes/class-1", "teacher")?.id).toBe("my-classes"); |
| 54 | expect(routeNavItem("/management/student-attendance", "teacher")?.id).toBe("student-attendance"); | 125 | expect(routeNavItem("/management/student-attendance", "teacher")?.id).toBe("student-attendance"); |
| 55 | expect(primaryPathActive("/exams/exam-1", primaryNavItems("student")[1]!)).toBe(true); | 126 | expect(primaryPathActive("/exams/exam-1", primaryNavItems("student")[1]!)).toBe(true); |
| 56 | }); | 127 | }); |
| 57 | 128 | ||
| 58 | test.each([ | 129 | test.each([ |
| 59 | - ["/homework", "student", "homework"], | 130 | + ["/homework/hw-1", "student", "my-homework"], |
| 60 | - ["/events/event-1", "teacher", "events"], | 131 | + ["/homework/hw-1", "teacher", "homework"], |
| 61 | ["/management/student-attendance", "teacher", "student-attendance"], | 132 | ["/management/student-attendance", "teacher", "student-attendance"], |
| 62 | ["/management/settings", "manager", "settings"], | 133 | ["/management/settings", "manager", "settings"], |
| 63 | ] as const)("sidebar resolves one active item for %s", (pathname, role, expected) => { | 134 | ] as const)("sidebar resolves one active item for %s", (pathname, role, expected) => { |
| 64 | - const items = [ | 135 | + const items = [...primaryNavItems(role), ...visibleNavGroups(role).flatMap((group) => group.items)]; |
| 65 | - ...primaryNavItems(role), | ||
| 66 | - ...sidebarNavGroups(role).flatMap((group) => group.items), | ||
| 67 | - ]; | ||
| 68 | const current = routeNavItem(pathname, role); | 136 | const current = routeNavItem(pathname, role); |
| 69 | 137 | ||
| 70 | expect(items.filter((item) => item.id === current?.id).map((item) => item.id)).toEqual([expected]); | 138 | expect(items.filter((item) => item.id === current?.id).map((item) => item.id)).toEqual([expected]); |
| @@ -79,12 +147,18 @@ test.each([ | |||
| 79 | ["/attendance", "nav.attendance"], | 147 | ["/attendance", "nav.attendance"], |
| 80 | ["/studies", "courses.kind.study"], | 148 | ["/studies", "courses.kind.study"], |
| 81 | ["/clubs", "courses.kind.club"], | 149 | ["/clubs", "courses.kind.club"], |
| 150 | + ["/courses", "nav.courses"], | ||
| 151 | + ["/courses/course-1", "nav.courses"], | ||
| 152 | + ["/notes", "nav.notes"], | ||
| 153 | + ["/questions", "nav.questions"], | ||
| 154 | + ["/events", "nav.events"], | ||
| 155 | + ["/meals", "nav.meals"], | ||
| 82 | ] as const)("%s has a header label", (pathname, expected) => { | 156 | ] as const)("%s has a header label", (pathname, expected) => { |
| 83 | expect(routeLabelKey(pathname, "student")).toBe(expected); | 157 | expect(routeLabelKey(pathname, "student")).toBe(expected); |
| 84 | }); | 158 | }); |
| 85 | 159 | ||
| 86 | test("routes with a sidebar entry still take their nav label", () => { | 160 | test("routes with a sidebar entry still take their nav label", () => { |
| 87 | - expect(routeLabelKey("/courses/course-1", "teacher")).toBe(routeNavItem("/courses/course-1", "teacher")?.labelKey); | 161 | + expect(routeLabelKey("/homework/hw-1", "teacher")).toBe(routeNavItem("/homework/hw-1", "teacher")?.labelKey); |
| 88 | }); | 162 | }); |
| 89 | 163 | ||
| 90 | test("a route rendered outside the shell has no label rather than a raw path", () => { | 164 | test("a route rendered outside the shell has no label rather than a raw path", () => { |
| @@ -94,8 +168,8 @@ test("a route rendered outside the shell has no label rather than a raw path", ( | |||
| 94 | test("a page keeps its name for a viewer who may not open it", () => { | 168 | test("a page keeps its name for a viewer who may not open it", () => { |
| 95 | // /students is parent-only; an admin lands on the no-access screen, and the | 169 | // /students is parent-only; an admin lands on the no-access screen, and the |
| 96 | // shell header must still say what page that is. | 170 | // shell header must still say what page that is. |
| 97 | - expect(routeLabelKey("/students", "admin")).toBe("nav.children"); | 171 | + expect(routeLabelKey("/students", "admin")).toBe("nav.progressReport"); |
| 98 | - expect(routeLabelKey("/students", "parent")).toBe("nav.children"); | 172 | + expect(routeLabelKey("/students", "parent")).toBe("nav.progressReport"); |
| 99 | }); | 173 | }); |
| 100 | 174 | ||
| 101 | test("module gate fails open while the entitlement lookup is unknown", () => { | 175 | test("module gate fails open while the entitlement lookup is unknown", () => { |
| @@ -104,13 +178,13 @@ test("module gate fails open while the entitlement lookup is unknown", () => { | |||
| 104 | }); | 178 | }); |
| 105 | 179 | ||
| 106 | test("module gate hides nests the school did not buy", () => { | 180 | test("module gate hides nests the school did not buy", () => { |
| 107 | - const enabled = ["courses", "notes"]; | 181 | + const enabled = ["courses"]; |
| 108 | - const primary = primaryNavItems("student", enabled).map((item) => item.to); | 182 | + const teacherPaths = visibleNavGroups("teacher", enabled).flatMap((group) => group.items.map((item) => item.to)); |
| 109 | - expect(primary).toContain("/courses"); | 183 | + expect(teacherPaths).not.toContain("/homework"); |
| 110 | - expect(primary).not.toContain("/marks"); | 184 | + expect(teacherPaths).not.toContain("/exams"); |
| 111 | - const sidebar = sidebarNavGroups("teacher", enabled).flatMap((group) => group.items.map((item) => item.to)); | 185 | + expect(teacherPaths).not.toContain("/whiteboards"); |
| 112 | - expect(sidebar).not.toContain("/meals"); | 186 | + expect(teacherPaths).toContain("/management/classes"); |
| 113 | - expect(sidebar).not.toContain("/messages"); | 187 | + expect(teacherPaths).toContain("/calendar"); |
| 114 | }); | 188 | }); |
| 115 | 189 | ||
| 116 | test("ungated entries never drop on module filtering", () => { | 190 | test("ungated entries never drop on module filtering", () => { |
src/components/layout/nav-items.tsmodified+173 -116
| @@ -2,29 +2,32 @@ import type { Component } from "solid-js"; | |||
| 2 | import type { Role } from "@/api/client"; | 2 | import type { Role } from "@/api/client"; |
| 3 | import { | 3 | import { |
| 4 | IconArchive, | 4 | IconArchive, |
| 5 | - IconBook, | 5 | + IconBotSquare, |
| 6 | IconBriefcase, | 6 | IconBriefcase, |
| 7 | - IconCalendar, | ||
| 8 | IconCalendarDays, | 7 | IconCalendarDays, |
| 8 | + IconChalkboardTeacher, | ||
| 9 | IconChart, | 9 | IconChart, |
| 10 | - IconClock, | 10 | + IconChartPie, |
| 11 | IconClipboardCheck, | 11 | IconClipboardCheck, |
| 12 | + IconClock, | ||
| 13 | + IconEdit, | ||
| 12 | IconExam, | 14 | IconExam, |
| 13 | - IconGlobe, | ||
| 14 | - IconGrid, | ||
| 15 | - IconGuide, | ||
| 16 | IconHelpCircle, | 15 | IconHelpCircle, |
| 17 | IconHomework, | 16 | IconHomework, |
| 18 | IconHome, | 17 | IconHome, |
| 19 | IconMessage, | 18 | IconMessage, |
| 20 | - IconEdit, | 19 | + IconPackage, |
| 21 | - IconNote, | ||
| 22 | IconReportAnalytics, | 20 | IconReportAnalytics, |
| 21 | + IconScan, | ||
| 23 | IconSchool, | 22 | IconSchool, |
| 24 | IconSettings, | 23 | IconSettings, |
| 24 | + IconShieldCheck, | ||
| 25 | + IconSparkles, | ||
| 26 | + IconTarget, | ||
| 25 | IconUserCog, | 27 | IconUserCog, |
| 26 | IconUsers, | 28 | IconUsers, |
| 27 | IconUtensils, | 29 | IconUtensils, |
| 30 | + IconWaveform, | ||
| 28 | } from "@/components/ui/icons"; | 31 | } from "@/components/ui/icons"; |
| 29 | import type { MessageKey } from "@/i18n/messages"; | 32 | import type { MessageKey } from "@/i18n/messages"; |
| 30 | import { hasExactRole, roleInRange } from "@/lib/roles"; | 33 | import { hasExactRole, roleInRange } from "@/lib/roles"; |
| @@ -40,6 +43,11 @@ export type NavItem = { | |||
| 40 | exact?: boolean; | 43 | exact?: boolean; |
| 41 | /** Backend module nest behind this entry; hidden when the school did not buy it. */ | 44 | /** Backend module nest behind this entry; hidden when the school did not buy it. */ |
| 42 | module?: string; | 45 | module?: string; |
| 46 | + /** No backend yet — routes to the shared placeholder and carries a "yakında" badge. */ | ||
| 47 | + soon?: boolean; | ||
| 48 | + /** Opens an existing shell surface instead of navigating (the Çelebi panel, | ||
| 49 | + * the account settings dialog) — both already live elsewhere in the shell. */ | ||
| 50 | + action?: "celebi" | "profile"; | ||
| 43 | }; | 51 | }; |
| 44 | 52 | ||
| 45 | export type NavGroup = { | 53 | export type NavGroup = { |
| @@ -57,139 +65,190 @@ export const HOME_ITEM: NavItem = { | |||
| 57 | exact: true, | 65 | exact: true, |
| 58 | }; | 66 | }; |
| 59 | 67 | ||
| 60 | -const CLASSES_ITEM: NavItem = { | 68 | +const CELEBI_ITEM: NavItem = { |
| 61 | - id: "classes", | 69 | + id: "celebi", |
| 62 | - to: "/courses", | 70 | + to: "", |
| 63 | - labelKey: "nav.classes", | 71 | + labelKey: "nav.celebi", |
| 64 | - Icon: IconBook, | 72 | + Icon: IconSparkles, |
| 65 | - module: "courses", | 73 | + action: "celebi", |
| 66 | -}; | ||
| 67 | - | ||
| 68 | -const CALENDAR_ITEM: NavItem = { | ||
| 69 | - id: "calendar", | ||
| 70 | - to: "/calendar", | ||
| 71 | - labelKey: "nav.calendar", | ||
| 72 | - Icon: IconCalendarDays, | ||
| 73 | -}; | ||
| 74 | - | ||
| 75 | -const CHILDREN_ITEM: NavItem = { | ||
| 76 | - id: "children", | ||
| 77 | - to: "/students", | ||
| 78 | - labelKey: "nav.children", | ||
| 79 | - Icon: IconUsers, | ||
| 80 | - exactRole: "parent", | ||
| 81 | }; | 74 | }; |
| 82 | 75 | ||
| 83 | -const PROGRESS_ITEM: NavItem = { | 76 | +const SOUND_STUDIO_ITEM: NavItem = { |
| 84 | - id: "progress", | 77 | + id: "sound-studio", |
| 85 | - to: "/marks", | 78 | + to: "/coming-soon/ses-atolyesi", |
| 86 | - labelKey: "nav.marks", | 79 | + labelKey: "nav.soundStudio", |
| 87 | - Icon: IconChart, | 80 | + Icon: IconWaveform, |
| 88 | - exactRole: "student", | 81 | + soon: true, |
| 89 | - module: "marks", | ||
| 90 | }; | 82 | }; |
| 91 | 83 | ||
| 92 | -const MEALS_ITEM: NavItem = { | 84 | +function settingsAction(id: string): NavItem { |
| 93 | - id: "meals", | 85 | + return { id, to: "", labelKey: "nav.settings", Icon: IconSettings, action: "profile" }; |
| 94 | - to: "/meals", | 86 | +} |
| 95 | - labelKey: "nav.meals", | ||
| 96 | - Icon: IconUtensils, | ||
| 97 | - module: "meals", | ||
| 98 | -}; | ||
| 99 | 87 | ||
| 100 | -const PRIMARY_BY_ROLE: Record<Role, NavItem[]> = { | 88 | +// Admin and manager share one Figma information architecture (Operasyon / |
| 101 | - student: [HOME_ITEM, CLASSES_ITEM, CALENDAR_ITEM, PROGRESS_ITEM], | 89 | +// Yapay zekâ / Kurum) — manager just qualifies for fewer of its items, via |
| 102 | - teacher: [HOME_ITEM, CLASSES_ITEM, CALENDAR_ITEM], | 90 | +// the same minRole gates the rest of this file already uses. |
| 103 | - manager: [HOME_ITEM, CLASSES_ITEM, CALENDAR_ITEM], | 91 | +const ADMIN_GROUPS: NavGroup[] = [ |
| 104 | - admin: [HOME_ITEM, CLASSES_ITEM, CALENDAR_ITEM], | 92 | + { |
| 105 | - // Meals stays out of the primary strip so it lives under "Community" for | 93 | + id: "operations", |
| 106 | - // every role consistently, same as teacher/manager/admin/student. | 94 | + labelKey: "nav.group.operations", |
| 107 | - parent: [HOME_ITEM, CHILDREN_ITEM, CALENDAR_ITEM], | 95 | + Icon: IconSchool, |
| 108 | -}; | 96 | + items: [ |
| 97 | + { id: "students-roster", to: "/coming-soon/ogrenciler", labelKey: "nav.studentsRoster", Icon: IconUsers, soon: true, minRole: "manager" }, | ||
| 98 | + { id: "teachers-roster", to: "/coming-soon/ogretmenler", labelKey: "nav.teachersRoster", Icon: IconChalkboardTeacher, soon: true, minRole: "manager" }, | ||
| 99 | + { id: "class-groups", to: "/management/classes", labelKey: "nav.classGroups", Icon: IconSchool, minRole: "teacher" }, | ||
| 100 | + { id: "schedule", to: "/calendar", labelKey: "nav.schedule", Icon: IconCalendarDays, minRole: "manager" }, | ||
| 101 | + { id: "student-attendance", to: "/management/student-attendance", labelKey: "nav.attendance", Icon: IconClipboardCheck, minRole: "teacher", module: "attendance" }, | ||
| 102 | + { id: "exams", to: "/exams", labelKey: "nav.exams", Icon: IconExam, minRole: "teacher", module: "exams" }, | ||
| 103 | + { id: "question-bank", to: "/question-bank", labelKey: "nav.questionBank", Icon: IconArchive, minRole: "teacher", module: "bank_questions" }, | ||
| 104 | + { id: "mock-exams", to: "/coming-soon/deneme-sinavlari", labelKey: "nav.mockExams", Icon: IconTarget, soon: true, minRole: "manager" }, | ||
| 105 | + { id: "optical-reading", to: "/coming-soon/optik-okuma", labelKey: "nav.opticalReading", Icon: IconScan, soon: true, minRole: "manager" }, | ||
| 106 | + { id: "payments-collection", to: "/management/payments", labelKey: "nav.payments", Icon: IconReportAnalytics, minRole: "manager", module: "payments" }, | ||
| 107 | + ], | ||
| 108 | + }, | ||
| 109 | + { | ||
| 110 | + id: "ai", | ||
| 111 | + labelKey: "nav.group.ai", | ||
| 112 | + Icon: IconSparkles, | ||
| 113 | + items: [ | ||
| 114 | + { id: "hezarfen-zeka", to: "/coming-soon/hezarfen-zeka", labelKey: "nav.hezarfenZeka", Icon: IconBotSquare, soon: true, minRole: "manager" }, | ||
| 115 | + CELEBI_ITEM, | ||
| 116 | + SOUND_STUDIO_ITEM, | ||
| 117 | + ], | ||
| 118 | + }, | ||
| 119 | + { | ||
| 120 | + id: "institution", | ||
| 121 | + labelKey: "nav.group.institution", | ||
| 122 | + Icon: IconUserCog, | ||
| 123 | + items: [ | ||
| 124 | + { id: "reports", to: "/coming-soon/raporlar", labelKey: "nav.reports", Icon: IconChartPie, soon: true, minRole: "manager" }, | ||
| 125 | + { id: "license-modules", to: "/coming-soon/lisans-modulleri", labelKey: "nav.licenseModules", Icon: IconPackage, soon: true, minRole: "admin" }, | ||
| 126 | + { id: "users", to: "/admin/users", labelKey: "nav.users", Icon: IconUserCog, minRole: "admin" }, | ||
| 127 | + { id: "data-protection", to: "/coming-soon/kvkk-denetim", labelKey: "nav.dataProtection", Icon: IconShieldCheck, soon: true, minRole: "admin" }, | ||
| 128 | + { id: "school-meals", to: "/meals", labelKey: "nav.schoolMeals", Icon: IconUtensils, minRole: "manager", module: "meals" }, | ||
| 129 | + { id: "staff-work", to: "/management/staff-work", labelKey: "nav.staffWork", Icon: IconBriefcase, minRole: "manager", module: "work" }, | ||
| 130 | + { id: "settings", to: "/management/settings", labelKey: "nav.settings", Icon: IconSettings, minRole: "manager" }, | ||
| 131 | + ], | ||
| 132 | + }, | ||
| 133 | +]; | ||
| 109 | 134 | ||
| 110 | -const NAV_GROUPS: NavGroup[] = [ | 135 | +const TEACHER_GROUPS: NavGroup[] = [ |
| 111 | { | 136 | { |
| 112 | - id: "classes", | 137 | + id: "my-classroom", |
| 113 | - labelKey: "nav.group.classes", | 138 | + labelKey: "nav.group.myClassroom", |
| 114 | Icon: IconSchool, | 139 | Icon: IconSchool, |
| 115 | items: [ | 140 | items: [ |
| 116 | - CLASSES_ITEM, | 141 | + { id: "my-classes", to: "/management/classes", labelKey: "nav.myClasses", Icon: IconSchool }, |
| 142 | + { id: "my-schedule", to: "/calendar", labelKey: "nav.mySchedule", Icon: IconCalendarDays }, | ||
| 143 | + { id: "student-attendance", to: "/management/student-attendance", labelKey: "nav.attendance", Icon: IconClipboardCheck, module: "attendance" }, | ||
| 117 | { id: "homework", to: "/homework", labelKey: "nav.homework", Icon: IconHomework, module: "homework" }, | 144 | { id: "homework", to: "/homework", labelKey: "nav.homework", Icon: IconHomework, module: "homework" }, |
| 118 | { id: "exams", to: "/exams", labelKey: "nav.exams", Icon: IconExam, module: "exams" }, | 145 | { id: "exams", to: "/exams", labelKey: "nav.exams", Icon: IconExam, module: "exams" }, |
| 119 | - { id: "question-bank", to: "/question-bank", labelKey: "nav.questionBank", Icon: IconArchive, minRole: "teacher", module: "bank_questions" }, | 146 | + { id: "whiteboards", to: "/whiteboards", labelKey: "nav.whiteboards", Icon: IconEdit, module: "boards" }, |
| 120 | - { id: "marks", to: "/marks", labelKey: "nav.marks", Icon: IconChart, exactRole: "student", module: "marks" }, | ||
| 121 | ], | 147 | ], |
| 122 | }, | 148 | }, |
| 123 | { | 149 | { |
| 124 | - id: "planning", | 150 | + id: "ai", |
| 125 | - labelKey: "nav.group.planning", | 151 | + labelKey: "nav.group.ai", |
| 126 | - Icon: IconCalendarDays, | 152 | + Icon: IconSparkles, |
| 127 | items: [ | 153 | items: [ |
| 128 | - { id: "events", to: "/events", labelKey: "nav.events", Icon: IconCalendar, module: "events" }, | 154 | + { id: "student-analysis", to: "/coming-soon/ogrenci-analizi", labelKey: "nav.studentAnalysis", Icon: IconChart, soon: true }, |
| 129 | - CALENDAR_ITEM, | 155 | + { id: "pending-approvals", to: "/coming-soon/bekleyen-onaylar", labelKey: "nav.pendingApprovals", Icon: IconHelpCircle, soon: true }, |
| 130 | - { id: "appointments", to: "/appointments", labelKey: "nav.appointments", Icon: IconClock, module: "appointments" }, | 156 | + { id: "question-generation", to: "/coming-soon/soru-uretimi", labelKey: "nav.questionGeneration", Icon: IconEdit, soon: true }, |
| 157 | + SOUND_STUDIO_ITEM, | ||
| 131 | ], | 158 | ], |
| 132 | }, | 159 | }, |
| 133 | { | 160 | { |
| 134 | - id: "workspace", | 161 | + id: "other", |
| 135 | - labelKey: "nav.group.workspace", | 162 | + labelKey: "nav.group.other", |
| 136 | - Icon: IconNote, | 163 | + Icon: IconMessage, |
| 137 | items: [ | 164 | items: [ |
| 138 | - { id: "notes", to: "/notes", labelKey: "nav.notes", Icon: IconNote, module: "notes" }, | 165 | + { id: "parent-communication", to: "/messages", labelKey: "nav.parentCommunication", Icon: IconMessage, module: "messages" }, |
| 139 | - { id: "whiteboards", to: "/whiteboards", labelKey: "nav.whiteboards", Icon: IconEdit, minRole: "student", module: "boards" }, | 166 | + { id: "work", to: "/work", labelKey: "nav.work", Icon: IconClock, minRole: "teacher", maxRole: "manager", module: "work" }, |
| 140 | - { id: "pomodoro", to: "/pomodoro", labelKey: "nav.pomodoro", Icon: IconClock, exactRole: "student", module: "pomodoro" }, | 167 | + settingsAction("settings-teacher"), |
| 141 | - { id: "work", to: "/work", labelKey: "nav.work", Icon: IconBriefcase, minRole: "teacher", maxRole: "manager", module: "work" }, | ||
| 142 | ], | 168 | ], |
| 143 | }, | 169 | }, |
| 170 | +]; | ||
| 171 | + | ||
| 172 | +const STUDENT_GROUPS: NavGroup[] = [ | ||
| 144 | { | 173 | { |
| 145 | - id: "students", | 174 | + id: "study", |
| 146 | - labelKey: "nav.group.students", | 175 | + labelKey: "nav.group.study", |
| 147 | - Icon: IconReportAnalytics, | 176 | + Icon: IconSchool, |
| 148 | items: [ | 177 | items: [ |
| 149 | - CHILDREN_ITEM, | 178 | + { id: "study-plan", to: "/coming-soon/calisma-programim", labelKey: "nav.studyPlan", Icon: IconClock, soon: true }, |
| 150 | - { id: "class-groups", to: "/management/classes", labelKey: "nav.classGroups", Icon: IconUsers, minRole: "teacher", module: "classes" }, | 179 | + { id: "topic-mastery", to: "/marks", labelKey: "nav.topicMastery", Icon: IconChart, exactRole: "student", module: "marks" }, |
| 151 | - { id: "student-marks", to: "/management/student-marks", labelKey: "nav.studentMarks", Icon: IconChart, minRole: "teacher", module: "marks" }, | 180 | + { id: "exam-results", to: "/exams", labelKey: "nav.examResults", Icon: IconExam, module: "exams" }, |
| 152 | - { id: "student-attendance", to: "/management/student-attendance", labelKey: "nav.studentAttendance", Icon: IconClipboardCheck, minRole: "teacher", module: "attendance" }, | 181 | + { id: "my-homework", to: "/homework", labelKey: "nav.myHomework", Icon: IconHomework, module: "homework" }, |
| 153 | - { id: "student-pomodoro", to: "/management/pomodoros", labelKey: "nav.studentPomodoro", Icon: IconClock, minRole: "teacher", module: "pomodoro" }, | 182 | + { id: "whiteboards", to: "/whiteboards", labelKey: "nav.whiteboards", Icon: IconEdit, module: "boards" }, |
| 183 | + { id: "pomodoro", to: "/pomodoro", labelKey: "nav.pomodoro", Icon: IconClock, exactRole: "student", module: "pomodoro" }, | ||
| 154 | ], | 184 | ], |
| 155 | }, | 185 | }, |
| 156 | { | 186 | { |
| 157 | - id: "services", | 187 | + id: "ai", |
| 158 | - labelKey: "nav.group.services", | 188 | + labelKey: "nav.group.ai", |
| 159 | - Icon: IconGuide, | 189 | + Icon: IconSparkles, |
| 190 | + items: [CELEBI_ITEM, SOUND_STUDIO_ITEM], | ||
| 191 | + }, | ||
| 192 | + { | ||
| 193 | + id: "other", | ||
| 194 | + labelKey: "nav.group.other", | ||
| 195 | + Icon: IconCalendarDays, | ||
| 160 | items: [ | 196 | items: [ |
| 161 | - MEALS_ITEM, | 197 | + { id: "calendar", to: "/calendar", labelKey: "nav.mySchedule", Icon: IconCalendarDays }, |
| 162 | - { id: "payment-statement", to: "/payments", labelKey: "nav.paymentStatement", Icon: IconChart, maxRole: "student", module: "payments" }, | 198 | + settingsAction("settings-student"), |
| 163 | ], | 199 | ], |
| 164 | }, | 200 | }, |
| 201 | +]; | ||
| 202 | + | ||
| 203 | +const PARENT_GROUPS: NavGroup[] = [ | ||
| 165 | { | 204 | { |
| 166 | - id: "community", | 205 | + id: "my-student", |
| 167 | - labelKey: "nav.group.community", | 206 | + labelKey: "nav.group.myStudent", |
| 168 | - Icon: IconGlobe, | 207 | + Icon: IconUsers, |
| 169 | items: [ | 208 | items: [ |
| 170 | - { id: "messages", to: "/messages", labelKey: "nav.messages", Icon: IconMessage, module: "messages" }, | 209 | + { id: "progress-report", to: "/students", labelKey: "nav.progressReport", Icon: IconReportAnalytics, exactRole: "parent" }, |
| 171 | - { id: "questions", to: "/questions", labelKey: "nav.questions", Icon: IconHelpCircle, module: "questions" }, | 210 | + { id: "absence", to: "/coming-soon/devamsizlik", labelKey: "nav.absence", Icon: IconClipboardCheck, soon: true }, |
| 211 | + { id: "child-exam-results", to: "/coming-soon/sinav-sonuclari-veli", labelKey: "nav.childExamResults", Icon: IconExam, soon: true }, | ||
| 212 | + { id: "child-study-plan", to: "/coming-soon/calisma-plani", labelKey: "nav.childStudyPlan", Icon: IconClock, soon: true }, | ||
| 172 | ], | 213 | ], |
| 173 | }, | 214 | }, |
| 174 | { | 215 | { |
| 175 | - id: "school", | 216 | + id: "institution", |
| 176 | - labelKey: "nav.group.school", | 217 | + labelKey: "nav.group.institution", |
| 177 | - Icon: IconGrid, | 218 | + Icon: IconUserCog, |
| 178 | items: [ | 219 | items: [ |
| 179 | - { id: "staff-work", to: "/management/staff-work", labelKey: "nav.staffWork", Icon: IconBriefcase, minRole: "manager", module: "work" }, | 220 | + { id: "payment-statement", to: "/payments", labelKey: "nav.payments", Icon: IconReportAnalytics, exactRole: "parent", module: "payments" }, |
| 180 | - { id: "settings", to: "/management/settings", labelKey: "nav.settings", Icon: IconSettings, minRole: "manager" }, | 221 | + { id: "appointments", to: "/appointments", labelKey: "nav.appointmentsAndCommunication", Icon: IconClock, exactRole: "parent", module: "appointments" }, |
| 181 | - { id: "terms", to: "/management/terms", labelKey: "nav.terms", Icon: IconCalendarDays, minRole: "manager" }, | 222 | + settingsAction("settings-parent"), |
| 182 | - { id: "payments", to: "/management/payments", labelKey: "nav.payments", Icon: IconReportAnalytics, minRole: "manager", module: "payments" }, | ||
| 183 | - { id: "users", to: "/admin/users", labelKey: "nav.users", Icon: IconUserCog, minRole: "admin" }, | ||
| 184 | ], | 223 | ], |
| 185 | }, | 224 | }, |
| 186 | ]; | 225 | ]; |
| 187 | 226 | ||
| 227 | +const GROUPS_BY_ROLE: Record<Role, NavGroup[]> = { | ||
| 228 | + student: STUDENT_GROUPS, | ||
| 229 | + teacher: TEACHER_GROUPS, | ||
| 230 | + manager: ADMIN_GROUPS, | ||
| 231 | + admin: ADMIN_GROUPS, | ||
| 232 | + parent: PARENT_GROUPS, | ||
| 233 | +}; | ||
| 234 | + | ||
| 235 | +// The mobile bottom tab bar keeps its own small, role-specific set — Figma's | ||
| 236 | +// desktop sidebar has no equivalent "primary strip" (only "Ana Sayfa" sits | ||
| 237 | +// outside the groups there), so this stays a phone-only affordance built | ||
| 238 | +// from items that also exist in the role's group tree above. | ||
| 239 | +const PRIMARY_BY_ROLE: Record<Role, NavItem[]> = { | ||
| 240 | + student: [HOME_ITEM, { id: "exam-results", to: "/exams", labelKey: "nav.examResults", Icon: IconExam, module: "exams" }, { id: "topic-mastery", to: "/marks", labelKey: "nav.topicMastery", Icon: IconChart, exactRole: "student", module: "marks" }], | ||
| 241 | + teacher: [HOME_ITEM, { id: "my-classes", to: "/management/classes", labelKey: "nav.myClasses", Icon: IconSchool }, { id: "my-schedule", to: "/calendar", labelKey: "nav.mySchedule", Icon: IconCalendarDays }], | ||
| 242 | + manager: [HOME_ITEM, { id: "class-groups", to: "/management/classes", labelKey: "nav.classGroups", Icon: IconSchool, minRole: "teacher" }, { id: "exams", to: "/exams", labelKey: "nav.exams", Icon: IconExam, minRole: "teacher", module: "exams" }], | ||
| 243 | + admin: [HOME_ITEM, { id: "class-groups", to: "/management/classes", labelKey: "nav.classGroups", Icon: IconSchool, minRole: "teacher" }, { id: "exams", to: "/exams", labelKey: "nav.exams", Icon: IconExam, minRole: "teacher", module: "exams" }], | ||
| 244 | + parent: [HOME_ITEM, { id: "progress-report", to: "/students", labelKey: "nav.progressReport", Icon: IconReportAnalytics, exactRole: "parent" }, { id: "appointments", to: "/appointments", labelKey: "nav.appointmentsAndCommunication", Icon: IconClock, exactRole: "parent", module: "appointments" }], | ||
| 245 | +}; | ||
| 246 | + | ||
| 188 | function itemVisible(item: NavItem, role: Role | undefined) { | 247 | function itemVisible(item: NavItem, role: Role | undefined) { |
| 189 | if (!role) return false; | 248 | if (!role) return false; |
| 190 | if (item.exactRole) return hasExactRole(role, item.exactRole); | 249 | if (item.exactRole) return hasExactRole(role, item.exactRole); |
| 191 | if (item.minRole || item.maxRole) return roleInRange(role, item.minRole, item.maxRole); | 250 | if (item.minRole || item.maxRole) return roleInRange(role, item.minRole, item.maxRole); |
| 192 | - return role !== "parent" || ["/", "/calendar", "/appointments", "/meals", "/messages"].includes(item.to); | 251 | + return true; |
| 193 | } | 252 | } |
| 194 | 253 | ||
| 195 | /** | 254 | /** |
| @@ -208,8 +267,12 @@ export function primaryNavItems(role: Role | undefined, enabled?: readonly strin | |||
| 208 | return PRIMARY_BY_ROLE[role].filter((item) => moduleVisible(item, enabled)); | 267 | return PRIMARY_BY_ROLE[role].filter((item) => moduleVisible(item, enabled)); |
| 209 | } | 268 | } |
| 210 | 269 | ||
| 270 | +/** The full, role-specific group tree — desktop sidebar and the mobile menu | ||
| 271 | + * sheet both render this directly; it mirrors the Figma sidebar as-is, with | ||
| 272 | + * no items pulled out for a separate "primary" section. */ | ||
| 211 | export function visibleNavGroups(role: Role | undefined, enabled?: readonly string[] | null): NavGroup[] { | 273 | export function visibleNavGroups(role: Role | undefined, enabled?: readonly string[] | null): NavGroup[] { |
| 212 | - return NAV_GROUPS | 274 | + if (!role) return []; |
| 275 | + return GROUPS_BY_ROLE[role] | ||
| 213 | .map((group) => ({ | 276 | .map((group) => ({ |
| 214 | ...group, | 277 | ...group, |
| 215 | items: group.items.filter((item) => itemVisible(item, role) && moduleVisible(item, enabled)), | 278 | items: group.items.filter((item) => itemVisible(item, role) && moduleVisible(item, enabled)), |
| @@ -217,31 +280,19 @@ export function visibleNavGroups(role: Role | undefined, enabled?: readonly stri | |||
| 217 | .filter((group) => group.items.length > 0); | 280 | .filter((group) => group.items.length > 0); |
| 218 | } | 281 | } |
| 219 | 282 | ||
| 220 | -export function sidebarNavGroups(role: Role | undefined, enabled?: readonly string[] | null): NavGroup[] { | ||
| 221 | - const primaryPaths = new Set(primaryNavItems(role, enabled).map((item) => item.to)); | ||
| 222 | - return visibleNavGroups(role, enabled) | ||
| 223 | - .map((group) => ({ ...group, items: group.items.filter((item) => !primaryPaths.has(item.to)) })) | ||
| 224 | - .filter((group) => group.items.length > 0); | ||
| 225 | -} | ||
| 226 | - | ||
| 227 | export function visibleNavItems(role: Role | undefined, enabled?: readonly string[] | null): NavItem[] { | 283 | export function visibleNavItems(role: Role | undefined, enabled?: readonly string[] | null): NavItem[] { |
| 228 | - const items = [HOME_ITEM, ...visibleNavGroups(role, enabled).flatMap((group) => group.items)]; | 284 | + const items = [HOME_ITEM, ...primaryNavItems(role, enabled), ...visibleNavGroups(role, enabled).flatMap((group) => group.items)]; |
| 229 | - return items.filter((item, index) => items.findIndex((candidate) => candidate.to === item.to) === index); | 285 | + return items.filter((item, index) => items.findIndex((candidate) => candidate.id === item.id && candidate.to === item.to) === index); |
| 230 | } | 286 | } |
| 231 | 287 | ||
| 232 | export function pathActive(pathname: string, to: string, exact?: boolean) { | 288 | export function pathActive(pathname: string, to: string, exact?: boolean) { |
| 289 | + if (!to) return false; | ||
| 233 | if (exact) return pathname === to; | 290 | if (exact) return pathname === to; |
| 234 | return pathname === to || pathname.startsWith(`${to}/`); | 291 | return pathname === to || pathname.startsWith(`${to}/`); |
| 235 | } | 292 | } |
| 236 | 293 | ||
| 237 | export function primaryPathActive(pathname: string, item: NavItem) { | 294 | export function primaryPathActive(pathname: string, item: NavItem) { |
| 238 | - if (pathActive(pathname, item.to, item.exact)) return true; | 295 | + return pathActive(pathname, item.to, item.exact); |
| 239 | - const prefixes: Partial<Record<string, string[]>> = { | ||
| 240 | - classes: ["/homework", "/exams", "/question-bank"], | ||
| 241 | - calendar: ["/events", "/appointments"], | ||
| 242 | - progress: ["/attendance", "/pomodoro"], | ||
| 243 | - }; | ||
| 244 | - return (prefixes[item.id] ?? []).some((prefix) => pathname.startsWith(prefix)); | ||
| 245 | } | 296 | } |
| 246 | 297 | ||
| 247 | export function routeNavItem(pathname: string, role: Role | undefined): NavItem | undefined { | 298 | export function routeNavItem(pathname: string, role: Role | undefined): NavItem | undefined { |
| @@ -262,6 +313,11 @@ const UNLISTED_ROUTE_LABELS: { prefix: string; labelKey: MessageKey }[] = [ | |||
| 262 | { prefix: "/attendance", labelKey: "nav.attendance" }, | 313 | { prefix: "/attendance", labelKey: "nav.attendance" }, |
| 263 | { prefix: "/studies", labelKey: "courses.kind.study" }, | 314 | { prefix: "/studies", labelKey: "courses.kind.study" }, |
| 264 | { prefix: "/clubs", labelKey: "courses.kind.club" }, | 315 | { prefix: "/clubs", labelKey: "courses.kind.club" }, |
| 316 | + { prefix: "/courses", labelKey: "nav.courses" }, | ||
| 317 | + { prefix: "/notes", labelKey: "nav.notes" }, | ||
| 318 | + { prefix: "/questions", labelKey: "nav.questions" }, | ||
| 319 | + { prefix: "/events", labelKey: "nav.events" }, | ||
| 320 | + { prefix: "/meals", labelKey: "nav.meals" }, | ||
| 265 | ]; | 321 | ]; |
| 266 | 322 | ||
| 267 | /** | 323 | /** |
| @@ -281,7 +337,8 @@ export function routeLabelKey(pathname: string, role: Role | undefined): Message | |||
| 281 | // A page still has a name when the viewer may not open it — the shell title | 337 | // A page still has a name when the viewer may not open it — the shell title |
| 282 | // must not go blank on the "no access" screen — so fall back to the nav entry | 338 | // must not go blank on the "no access" screen — so fall back to the nav entry |
| 283 | // for any role, not just this one. | 339 | // for any role, not just this one. |
| 284 | - return [HOME_ITEM, ...NAV_GROUPS.flatMap((group) => group.items)] | 340 | + const allItems = [HOME_ITEM, ...Object.values(GROUPS_BY_ROLE).flatMap((groups) => groups.flatMap((group) => group.items))]; |
| 341 | + return allItems | ||
| 285 | .filter((entry) => pathActive(pathname, entry.to, entry.exact)) | 342 | .filter((entry) => pathActive(pathname, entry.to, entry.exact)) |
| 286 | .sort((a, b) => b.to.length - a.to.length)[0]?.labelKey; | 343 | .sort((a, b) => b.to.length - a.to.length)[0]?.labelKey; |
| 287 | } | 344 | } |
src/components/layout/side-nav.tsxmodified+58 -47
| @@ -1,6 +1,6 @@ | |||
| 1 | import { For, Show } from "solid-js"; | 1 | import { For, Show } from "solid-js"; |
| 2 | import { Link, useNavigate, useRouterState } from "@tanstack/solid-router"; | 2 | import { Link, useNavigate, useRouterState } from "@tanstack/solid-router"; |
| 3 | -import { primaryNavItems, routeNavItem, sidebarNavGroups, type NavItem } from "@/components/layout/nav-items"; | 3 | +import { HOME_ITEM, routeNavItem, visibleNavGroups, type NavItem } from "@/components/layout/nav-items"; |
| 4 | import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"; | 4 | import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"; |
| 5 | import { IconChevronRight } from "@/components/ui/icons"; | 5 | import { IconChevronRight } from "@/components/ui/icons"; |
| 6 | import { cn } from "@/lib/cn"; | 6 | import { cn } from "@/lib/cn"; |
| @@ -9,7 +9,12 @@ import { useModules } from "@/stores/modules-context"; | |||
| 9 | import { useShellFeed } from "@/stores/shell-feed-context"; | 9 | import { useShellFeed } from "@/stores/shell-feed-context"; |
| 10 | import { useT } from "@/stores/preferences-context"; | 10 | import { useT } from "@/stores/preferences-context"; |
| 11 | 11 | ||
| 12 | -export function SideNav(props: { onNavigate?: () => void; collapsed?: boolean }) { | 12 | +export function SideNav(props: { |
| 13 | + onNavigate?: () => void; | ||
| 14 | + collapsed?: boolean; | ||
| 15 | + onOpenCelebi?: () => void; | ||
| 16 | + onOpenProfile?: () => void; | ||
| 17 | +}) { | ||
| 13 | const auth = useAuth(); | 18 | const auth = useAuth(); |
| 14 | const t = useT(); | 19 | const t = useT(); |
| 15 | const feed = useShellFeed(); | 20 | const feed = useShellFeed(); |
| @@ -17,16 +22,22 @@ export function SideNav(props: { onNavigate?: () => void; collapsed?: boolean }) | |||
| 17 | const navigate = useNavigate(); | 22 | const navigate = useNavigate(); |
| 18 | const pathname = useRouterState({ select: (state) => state.location.pathname }); | 23 | const pathname = useRouterState({ select: (state) => state.location.pathname }); |
| 19 | 24 | ||
| 20 | - const primary = () => primaryNavItems(auth.user()?.role, modules.enabled()); | 25 | + const home = () => (auth.user() ? [HOME_ITEM] : []); |
| 21 | - const groups = () => sidebarNavGroups(auth.user()?.role, modules.enabled()); | 26 | + const groups = () => visibleNavGroups(auth.user()?.role, modules.enabled()); |
| 22 | const current = () => routeNavItem(pathname(), auth.user()?.role); | 27 | const current = () => routeNavItem(pathname(), auth.user()?.role); |
| 23 | const unread = () => feed.unreadMessages().total; | 28 | const unread = () => feed.unreadMessages().total; |
| 24 | const badgeFor = (item: NavItem) => (item.id === "messages" ? unread() : 0); | 29 | const badgeFor = (item: NavItem) => (item.id === "messages" ? unread() : 0); |
| 25 | 30 | ||
| 31 | + const runAction = (item: NavItem) => { | ||
| 32 | + props.onNavigate?.(); | ||
| 33 | + if (item.action === "celebi") props.onOpenCelebi?.(); | ||
| 34 | + if (item.action === "profile") props.onOpenProfile?.(); | ||
| 35 | + }; | ||
| 36 | + | ||
| 26 | return ( | 37 | return ( |
| 27 | <nav class="flex h-full flex-col gap-1" aria-label={t("nav.menu")}> | 38 | <nav class="flex h-full flex-col gap-1" aria-label={t("nav.menu")}> |
| 28 | <div class="grid gap-1"> | 39 | <div class="grid gap-1"> |
| 29 | - <For each={primary()}> | 40 | + <For each={home()}> |
| 30 | {(item) => { | 41 | {(item) => { |
| 31 | const active = () => current()?.id === item.id; | 42 | const active = () => current()?.id === item.id; |
| 32 | return ( | 43 | return ( |
| @@ -45,20 +56,6 @@ export function SideNav(props: { onNavigate?: () => void; collapsed?: boolean }) | |||
| 45 | > | 56 | > |
| 46 | <item.Icon class="h-4 w-4 shrink-0" /> | 57 | <item.Icon class="h-4 w-4 shrink-0" /> |
| 47 | <span class={props.collapsed ? "sr-only" : "truncate"}>{t(item.labelKey)}</span> | 58 | <span class={props.collapsed ? "sr-only" : "truncate"}>{t(item.labelKey)}</span> |
| 48 | - <Show when={badgeFor(item) > 0}> | ||
| 49 | - <Show | ||
| 50 | - when={!props.collapsed} | ||
| 51 | - fallback={ | ||
| 52 | - <span class="absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-rose-500 px-1 text-[9px] font-bold text-white"> | ||
| 53 | - {unread() > 9 ? "9+" : unread()} | ||
| 54 | - </span> | ||
| 55 | - } | ||
| 56 | - > | ||
| 57 | - <span class="ml-auto flex h-5 min-w-5 items-center justify-center rounded-full bg-rose-500 px-1.5 text-[10px] font-bold text-white"> | ||
| 58 | - {unread() > 9 ? "9+" : unread()} | ||
| 59 | - </span> | ||
| 60 | - </Show> | ||
| 61 | - </Show> | ||
| 62 | </Link> | 59 | </Link> |
| 63 | ); | 60 | ); |
| 64 | }} | 61 | }} |
| @@ -72,38 +69,43 @@ export function SideNav(props: { onNavigate?: () => void; collapsed?: boolean }) | |||
| 72 | <For each={group.items}> | 69 | <For each={group.items}> |
| 73 | {(item: NavItem) => { | 70 | {(item: NavItem) => { |
| 74 | const itemActive = () => current()?.id === item.id; | 71 | const itemActive = () => current()?.id === item.id; |
| 75 | - return ( | 72 | + const linkClass = cn( |
| 76 | - <Link | 73 | + // Active submenu item: bold foreground text + a bright segment over |
| 77 | - to={item.to} | 74 | + // the group's left guide line (no filled pill). |
| 78 | - onClick={() => props.onNavigate?.()} | 75 | + "relative flex h-[30px] items-center gap-2.5 rounded-md px-2.5 text-[13px] outline-hidden transition-colors focus-visible:ring-2 focus-visible:ring-ring", |
| 79 | - title={t(item.labelKey)} | 76 | + itemActive() |
| 80 | - aria-current={itemActive() ? "page" : undefined} | 77 | + ? "font-semibold text-foreground before:absolute before:-left-[9px] before:top-1 before:bottom-1 before:w-0.5 before:rounded-full before:bg-foreground" |
| 81 | - class={cn( | 78 | + : "font-medium text-muted-foreground hover:bg-muted/70 hover:text-foreground", |
| 82 | - // Active submenu item: bold foreground text + a bright segment over | 79 | + ); |
| 83 | - // the group's left guide line (no filled pill). | 80 | + const content = ( |
| 84 | - "relative flex h-[30px] items-center gap-2.5 rounded-md px-2.5 text-[13px] outline-hidden transition-colors focus-visible:ring-2 focus-visible:ring-ring", | 81 | + <> |
| 85 | - itemActive() | ||
| 86 | - ? "font-semibold text-foreground before:absolute before:-left-[9px] before:top-1 before:bottom-1 before:w-0.5 before:rounded-full before:bg-foreground" | ||
| 87 | - : "font-medium text-muted-foreground hover:bg-muted/70 hover:text-foreground", | ||
| 88 | - )} | ||
| 89 | - > | ||
| 90 | <item.Icon class="h-4 w-4 shrink-0 opacity-80" /> | 82 | <item.Icon class="h-4 w-4 shrink-0 opacity-80" /> |
| 91 | <span class="truncate">{t(item.labelKey)}</span> | 83 | <span class="truncate">{t(item.labelKey)}</span> |
| 84 | + <Show when={item.soon}> | ||
| 85 | + <span class="ml-auto shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground"> | ||
| 86 | + {t("nav.soon")} | ||
| 87 | + </span> | ||
| 88 | + </Show> | ||
| 92 | <Show when={badgeFor(item) > 0}> | 89 | <Show when={badgeFor(item) > 0}> |
| 93 | - <Show | 90 | + <span class="ml-auto flex h-5 min-w-5 items-center justify-center rounded-full bg-rose-500 px-1.5 text-[10px] font-bold text-white"> |
| 94 | - when={!props.collapsed} | 91 | + {unread() > 9 ? "9+" : unread()} |
| 95 | - fallback={ | 92 | + </span> |
| 96 | - <span class="absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-rose-500 px-1 text-[9px] font-bold text-white"> | ||
| 97 | - {unread() > 9 ? "9+" : unread()} | ||
| 98 | - </span> | ||
| 99 | - } | ||
| 100 | - > | ||
| 101 | - <span class="ml-auto flex h-5 min-w-5 items-center justify-center rounded-full bg-rose-500 px-1.5 text-[10px] font-bold text-white"> | ||
| 102 | - {unread() > 9 ? "9+" : unread()} | ||
| 103 | - </span> | ||
| 104 | - </Show> | ||
| 105 | </Show> | 93 | </Show> |
| 106 | - </Link> | 94 | + </> |
| 95 | + ); | ||
| 96 | + return ( | ||
| 97 | + <Show | ||
| 98 | + when={!item.action} | ||
| 99 | + fallback={ | ||
| 100 | + <button type="button" onClick={() => runAction(item)} title={t(item.labelKey)} class={cn(linkClass, "w-full text-left")}> | ||
| 101 | + {content} | ||
| 102 | + </button> | ||
| 103 | + } | ||
| 104 | + > | ||
| 105 | + <Link to={item.to} onClick={() => props.onNavigate?.()} title={t(item.labelKey)} aria-current={itemActive() ? "page" : undefined} class={linkClass}> | ||
| 106 | + {content} | ||
| 107 | + </Link> | ||
| 108 | + </Show> | ||
| 107 | ); | 109 | ); |
| 108 | }} | 110 | }} |
| 109 | </For> | 111 | </For> |
| @@ -154,12 +156,21 @@ export function SideNav(props: { onNavigate?: () => void; collapsed?: boolean }) | |||
| 154 | <DropdownMenuItem | 156 | <DropdownMenuItem |
| 155 | class="min-h-8 gap-2.5 rounded-md px-2.5 py-1.5 text-[13px]" | 157 | class="min-h-8 gap-2.5 rounded-md px-2.5 py-1.5 text-[13px]" |
| 156 | onSelect={() => { | 158 | onSelect={() => { |
| 159 | + if (item.action) { | ||
| 160 | + runAction(item); | ||
| 161 | + return; | ||
| 162 | + } | ||
| 157 | props.onNavigate?.(); | 163 | props.onNavigate?.(); |
| 158 | void navigate({ to: item.to }); | 164 | void navigate({ to: item.to }); |
| 159 | }} | 165 | }} |
| 160 | > | 166 | > |
| 161 | <item.Icon class="h-4 w-4 shrink-0" /> | 167 | <item.Icon class="h-4 w-4 shrink-0" /> |
| 162 | <span>{t(item.labelKey)}</span> | 168 | <span>{t(item.labelKey)}</span> |
| 169 | + <Show when={item.soon}> | ||
| 170 | + <span class="ml-auto shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground"> | ||
| 171 | + {t("nav.soon")} | ||
| 172 | + </span> | ||
| 173 | + </Show> | ||
| 163 | <Show when={badgeFor(item) > 0}> | 174 | <Show when={badgeFor(item) > 0}> |
| 164 | <span class="ml-auto flex h-5 min-w-5 items-center justify-center rounded-full bg-rose-500 px-1.5 text-[10px] font-bold text-white"> | 175 | <span class="ml-auto flex h-5 min-w-5 items-center justify-center rounded-full bg-rose-500 px-1.5 text-[10px] font-bold text-white"> |
| 165 | {unread() > 9 ? "9+" : unread()} | 176 | {unread() > 9 ? "9+" : unread()} |
src/components/ui/icons.tsxmodified+35 -0
| @@ -5,6 +5,8 @@ import bellUrl from "@phosphor-icons/core/regular/bell.svg?url"; | |||
| 5 | import bookOpenUrl from "@phosphor-icons/core/regular/book-open.svg?url"; | 5 | import bookOpenUrl from "@phosphor-icons/core/regular/book-open.svg?url"; |
| 6 | import calendarDotsUrl from "@phosphor-icons/core/regular/calendar-dots.svg?url"; | 6 | import calendarDotsUrl from "@phosphor-icons/core/regular/calendar-dots.svg?url"; |
| 7 | import caretDownUrl from "@phosphor-icons/core/regular/caret-down.svg?url"; | 7 | import caretDownUrl from "@phosphor-icons/core/regular/caret-down.svg?url"; |
| 8 | +import chalkboardTeacherUrl from "@phosphor-icons/core/regular/chalkboard-teacher.svg?url"; | ||
| 9 | +import chartPieUrl from "@phosphor-icons/core/regular/chart-pie.svg?url"; | ||
| 8 | import caretLeftUrl from "@phosphor-icons/core/regular/caret-left.svg?url"; | 10 | import caretLeftUrl from "@phosphor-icons/core/regular/caret-left.svg?url"; |
| 9 | import caretRightUrl from "@phosphor-icons/core/regular/caret-right.svg?url"; | 11 | import caretRightUrl from "@phosphor-icons/core/regular/caret-right.svg?url"; |
| 10 | import caretUpDownUrl from "@phosphor-icons/core/regular/caret-up-down.svg?url"; | 12 | import caretUpDownUrl from "@phosphor-icons/core/regular/caret-up-down.svg?url"; |
| @@ -27,17 +29,22 @@ import houseUrl from "@phosphor-icons/core/regular/house.svg?url"; | |||
| 27 | import listUrl from "@phosphor-icons/core/regular/list.svg?url"; | 29 | import listUrl from "@phosphor-icons/core/regular/list.svg?url"; |
| 28 | import lockSimpleUrl from "@phosphor-icons/core/regular/lock-simple.svg?url"; | 30 | import lockSimpleUrl from "@phosphor-icons/core/regular/lock-simple.svg?url"; |
| 29 | import magnifyingGlassUrl from "@phosphor-icons/core/regular/magnifying-glass.svg?url"; | 31 | import magnifyingGlassUrl from "@phosphor-icons/core/regular/magnifying-glass.svg?url"; |
| 32 | +import packageUrl from "@phosphor-icons/core/regular/package.svg?url"; | ||
| 30 | import paperPlaneTiltUrl from "@phosphor-icons/core/regular/paper-plane-tilt.svg?url"; | 33 | import paperPlaneTiltUrl from "@phosphor-icons/core/regular/paper-plane-tilt.svg?url"; |
| 31 | import pencilSimpleUrl from "@phosphor-icons/core/regular/pencil-simple.svg?url"; | 34 | import pencilSimpleUrl from "@phosphor-icons/core/regular/pencil-simple.svg?url"; |
| 32 | import plusUrl from "@phosphor-icons/core/regular/plus.svg?url"; | 35 | import plusUrl from "@phosphor-icons/core/regular/plus.svg?url"; |
| 33 | import questionUrl from "@phosphor-icons/core/regular/question.svg?url"; | 36 | import questionUrl from "@phosphor-icons/core/regular/question.svg?url"; |
| 37 | +import scanUrl from "@phosphor-icons/core/regular/scan.svg?url"; | ||
| 38 | +import shieldCheckUrl from "@phosphor-icons/core/regular/shield-check.svg?url"; | ||
| 34 | import sidebarSimpleUrl from "@phosphor-icons/core/regular/sidebar-simple.svg?url"; | 39 | import sidebarSimpleUrl from "@phosphor-icons/core/regular/sidebar-simple.svg?url"; |
| 35 | import signOutUrl from "@phosphor-icons/core/regular/sign-out.svg?url"; | 40 | import signOutUrl from "@phosphor-icons/core/regular/sign-out.svg?url"; |
| 36 | import sparkleUrl from "@phosphor-icons/core/regular/sparkle.svg?url"; | 41 | import sparkleUrl from "@phosphor-icons/core/regular/sparkle.svg?url"; |
| 42 | +import targetUrl from "@phosphor-icons/core/regular/target.svg?url"; | ||
| 37 | import trashUrl from "@phosphor-icons/core/regular/trash.svg?url"; | 43 | import trashUrl from "@phosphor-icons/core/regular/trash.svg?url"; |
| 38 | import uploadSimpleUrl from "@phosphor-icons/core/regular/upload-simple.svg?url"; | 44 | import uploadSimpleUrl from "@phosphor-icons/core/regular/upload-simple.svg?url"; |
| 39 | import usersUrl from "@phosphor-icons/core/regular/users.svg?url"; | 45 | import usersUrl from "@phosphor-icons/core/regular/users.svg?url"; |
| 40 | import warningUrl from "@phosphor-icons/core/regular/warning.svg?url"; | 46 | import warningUrl from "@phosphor-icons/core/regular/warning.svg?url"; |
| 47 | +import waveformUrl from "@phosphor-icons/core/regular/waveform.svg?url"; | ||
| 41 | import xUrl from "@phosphor-icons/core/regular/x.svg?url"; | 48 | import xUrl from "@phosphor-icons/core/regular/x.svg?url"; |
| 42 | 49 | ||
| 43 | type IconProps = { | 50 | type IconProps = { |
| @@ -596,3 +603,31 @@ export function IconExternalLink(props: IconProps) { | |||
| 596 | export function IconBell(props: IconProps) { | 603 | export function IconBell(props: IconProps) { |
| 597 | return <PhosphorIcon {...props} src={bellUrl} />; | 604 | return <PhosphorIcon {...props} src={bellUrl} />; |
| 598 | } | 605 | } |
| 606 | + | ||
| 607 | +export function IconChalkboardTeacher(props: IconProps) { | ||
| 608 | + return <PhosphorIcon {...props} src={chalkboardTeacherUrl} />; | ||
| 609 | +} | ||
| 610 | + | ||
| 611 | +export function IconChartPie(props: IconProps) { | ||
| 612 | + return <PhosphorIcon {...props} src={chartPieUrl} />; | ||
| 613 | +} | ||
| 614 | + | ||
| 615 | +export function IconPackage(props: IconProps) { | ||
| 616 | + return <PhosphorIcon {...props} src={packageUrl} />; | ||
| 617 | +} | ||
| 618 | + | ||
| 619 | +export function IconScan(props: IconProps) { | ||
| 620 | + return <PhosphorIcon {...props} src={scanUrl} />; | ||
| 621 | +} | ||
| 622 | + | ||
| 623 | +export function IconShieldCheck(props: IconProps) { | ||
| 624 | + return <PhosphorIcon {...props} src={shieldCheckUrl} />; | ||
| 625 | +} | ||
| 626 | + | ||
| 627 | +export function IconTarget(props: IconProps) { | ||
| 628 | + return <PhosphorIcon {...props} src={targetUrl} />; | ||
| 629 | +} | ||
| 630 | + | ||
| 631 | +export function IconWaveform(props: IconProps) { | ||
| 632 | + return <PhosphorIcon {...props} src={waveformUrl} />; | ||
| 633 | +} | ||
src/i18n/messages.tsmodified+127 -10
| @@ -258,6 +258,45 @@ export type MessageKey = | |||
| 258 | | "nav.group.grades" | 258 | | "nav.group.grades" |
| 259 | | "nav.group.community" | 259 | | "nav.group.community" |
| 260 | | "nav.group.services" | 260 | | "nav.group.services" |
| 261 | + | "nav.group.operations" | ||
| 262 | + | "nav.group.ai" | ||
| 263 | + | "nav.group.institution" | ||
| 264 | + | "nav.group.myClassroom" | ||
| 265 | + | "nav.group.study" | ||
| 266 | + | "nav.group.other" | ||
| 267 | + | "nav.group.myStudent" | ||
| 268 | + | "nav.studentsRoster" | ||
| 269 | + | "nav.teachersRoster" | ||
| 270 | + | "nav.schedule" | ||
| 271 | + | "nav.mySchedule" | ||
| 272 | + | "nav.mockExams" | ||
| 273 | + | "nav.opticalReading" | ||
| 274 | + | "nav.hezarfenZeka" | ||
| 275 | + | "nav.celebi" | ||
| 276 | + | "nav.soundStudio" | ||
| 277 | + | "nav.reports" | ||
| 278 | + | "nav.licenseModules" | ||
| 279 | + | "nav.dataProtection" | ||
| 280 | + | "nav.schoolMeals" | ||
| 281 | + | "nav.myClasses" | ||
| 282 | + | "nav.studentAnalysis" | ||
| 283 | + | "nav.pendingApprovals" | ||
| 284 | + | "nav.questionGeneration" | ||
| 285 | + | "nav.parentCommunication" | ||
| 286 | + | "nav.studyPlan" | ||
| 287 | + | "nav.topicMastery" | ||
| 288 | + | "nav.examResults" | ||
| 289 | + | "nav.myHomework" | ||
| 290 | + | "nav.progressReport" | ||
| 291 | + | "nav.absence" | ||
| 292 | + | "nav.childExamResults" | ||
| 293 | + | "nav.childStudyPlan" | ||
| 294 | + | "nav.appointmentsAndCommunication" | ||
| 295 | + | "nav.soon" | ||
| 296 | + | "comingSoon.title" | ||
| 297 | + | "comingSoon.description" | ||
| 298 | + | "comingSoon.emptyTitle" | ||
| 299 | + | "comingSoon.emptyDescription" | ||
| 261 | | "nav.darkMode" | 300 | | "nav.darkMode" |
| 262 | | "rightPanel.messagesTitle" | 301 | | "rightPanel.messagesTitle" |
| 263 | | "rightPanel.calendarTitle" | 302 | | "rightPanel.calendarTitle" |
| @@ -1794,9 +1833,9 @@ const en: Dict = { | |||
| 1794 | "nav.pomodoro": "Pomodoro", | 1833 | "nav.pomodoro": "Pomodoro", |
| 1795 | "nav.attendance": "Attendance", | 1834 | "nav.attendance": "Attendance", |
| 1796 | "nav.questions": "Question pool", | 1835 | "nav.questions": "Question pool", |
| 1797 | - "nav.work": "Work log", | 1836 | + "nav.work": "Shift", |
| 1798 | "nav.staffWork": "Staff shifts", | 1837 | "nav.staffWork": "Staff shifts", |
| 1799 | - "nav.users": "Users", | 1838 | + "nav.users": "Users & roles", |
| 1800 | "nav.studentMarks": "Student marks", | 1839 | "nav.studentMarks": "Student marks", |
| 1801 | "nav.studentAttendance": "Student attendance", | 1840 | "nav.studentAttendance": "Student attendance", |
| 1802 | "nav.studentPomodoro": "Student pomodoros", | 1841 | "nav.studentPomodoro": "Student pomodoros", |
| @@ -1820,6 +1859,45 @@ const en: Dict = { | |||
| 1820 | "nav.group.grades": "Grades", | 1859 | "nav.group.grades": "Grades", |
| 1821 | "nav.group.community": "Community", | 1860 | "nav.group.community": "Community", |
| 1822 | "nav.group.services": "School services", | 1861 | "nav.group.services": "School services", |
| 1862 | + "nav.group.operations": "Operations", | ||
| 1863 | + "nav.group.ai": "AI", | ||
| 1864 | + "nav.group.institution": "Institution", | ||
| 1865 | + "nav.group.myClassroom": "My classroom", | ||
| 1866 | + "nav.group.study": "Study", | ||
| 1867 | + "nav.group.other": "Other", | ||
| 1868 | + "nav.group.myStudent": "My student", | ||
| 1869 | + "nav.studentsRoster": "Students", | ||
| 1870 | + "nav.teachersRoster": "Teachers", | ||
| 1871 | + "nav.schedule": "Class schedule", | ||
| 1872 | + "nav.mySchedule": "My schedule", | ||
| 1873 | + "nav.mockExams": "Mock exams", | ||
| 1874 | + "nav.opticalReading": "Optical reading", | ||
| 1875 | + "nav.hezarfenZeka": "Hezarfen AI", | ||
| 1876 | + "nav.celebi": "Çelebi", | ||
| 1877 | + "nav.soundStudio": "Sound studio", | ||
| 1878 | + "nav.reports": "Reports", | ||
| 1879 | + "nav.licenseModules": "License & modules", | ||
| 1880 | + "nav.dataProtection": "Data protection & audit", | ||
| 1881 | + "nav.schoolMeals": "Cafeteria management", | ||
| 1882 | + "nav.myClasses": "My classes", | ||
| 1883 | + "nav.studentAnalysis": "Student analysis", | ||
| 1884 | + "nav.pendingApprovals": "Pending approvals", | ||
| 1885 | + "nav.questionGeneration": "Question generation", | ||
| 1886 | + "nav.parentCommunication": "Parent communication", | ||
| 1887 | + "nav.studyPlan": "Study plan", | ||
| 1888 | + "nav.topicMastery": "Topic mastery", | ||
| 1889 | + "nav.examResults": "My exam results", | ||
| 1890 | + "nav.myHomework": "My homework", | ||
| 1891 | + "nav.progressReport": "Progress report", | ||
| 1892 | + "nav.absence": "Absence", | ||
| 1893 | + "nav.childExamResults": "Exam results", | ||
| 1894 | + "nav.childStudyPlan": "Study plan", | ||
| 1895 | + "nav.appointmentsAndCommunication": "Appointments & messages", | ||
| 1896 | + "nav.soon": "Coming soon", | ||
| 1897 | + "comingSoon.title": "Coming soon", | ||
| 1898 | + "comingSoon.description": "This module is on its way — there is nothing to show here yet.", | ||
| 1899 | + "comingSoon.emptyTitle": "Not available yet", | ||
| 1900 | + "comingSoon.emptyDescription": "This part of Hezarfen is still being built. Check back soon.", | ||
| 1823 | "nav.darkMode": "Dark mode", | 1901 | "nav.darkMode": "Dark mode", |
| 1824 | "parents.title": "My Students", | 1902 | "parents.title": "My Students", |
| 1825 | "parents.subtitle": "Review academic records for the students linked to your account.", | 1903 | "parents.subtitle": "Review academic records for the students linked to your account.", |
| @@ -2893,9 +2971,9 @@ const en: Dict = { | |||
| 2893 | "meals.editDish": "Edit dish", | 2971 | "meals.editDish": "Edit dish", |
| 2894 | "meals.dishName": "Dish name", | 2972 | "meals.dishName": "Dish name", |
| 2895 | "meals.priceTry": "Price (TRY)", | 2973 | "meals.priceTry": "Price (TRY)", |
| 2896 | - "nav.payments": "Fees", | 2974 | + "nav.payments": "Payments & collection", |
| 2897 | "nav.paymentStatement": "My Fees", | 2975 | "nav.paymentStatement": "My Fees", |
| 2898 | - "nav.whiteboards": "Whiteboards", | 2976 | + "nav.whiteboards": "Board", |
| 2899 | "whiteboard.title": "Whiteboards", | 2977 | "whiteboard.title": "Whiteboards", |
| 2900 | "whiteboard.subtitle": "Live collaborative sketch boards.", | 2978 | "whiteboard.subtitle": "Live collaborative sketch boards.", |
| 2901 | "whiteboard.empty": "No whiteboards yet.", | 2979 | "whiteboard.empty": "No whiteboards yet.", |
| @@ -3136,7 +3214,7 @@ const tr: Dict = { | |||
| 3136 | "ai.skipTyping": "Cevabın tamamını göster", | 3214 | "ai.skipTyping": "Cevabın tamamını göster", |
| 3137 | "nav.today": "Bugün", | 3215 | "nav.today": "Bugün", |
| 3138 | "nav.classes": "Eğitim", | 3216 | "nav.classes": "Eğitim", |
| 3139 | - "nav.classGroups": "Şubeler", | 3217 | + "nav.classGroups": "Sınıflar", |
| 3140 | "classGroups.title": "Şubeler", | 3218 | "classGroups.title": "Şubeler", |
| 3141 | "classGroups.subtitle": "Aynı dersleri paylaşan öğrenci grupları.", | 3219 | "classGroups.subtitle": "Aynı dersleri paylaşan öğrenci grupları.", |
| 3142 | "classGroups.newClass": "Yeni şube", | 3220 | "classGroups.newClass": "Yeni şube", |
| @@ -3351,9 +3429,9 @@ const tr: Dict = { | |||
| 3351 | "nav.pomodoro": "Pomodoro", | 3429 | "nav.pomodoro": "Pomodoro", |
| 3352 | "nav.attendance": "Yoklama", | 3430 | "nav.attendance": "Yoklama", |
| 3353 | "nav.questions": "Soru havuzu", | 3431 | "nav.questions": "Soru havuzu", |
| 3354 | - "nav.work": "Çalışma kaydı", | 3432 | + "nav.work": "Mesai", |
| 3355 | - "nav.staffWork": "Personel mesaisi", | 3433 | + "nav.staffWork": "Personel Mesai", |
| 3356 | - "nav.users": "Kullanıcılar", | 3434 | + "nav.users": "Kullanıcılar ve roller", |
| 3357 | "nav.studentMarks": "Öğrenci notları", | 3435 | "nav.studentMarks": "Öğrenci notları", |
| 3358 | "nav.studentAttendance": "Öğrenci yoklamaları", | 3436 | "nav.studentAttendance": "Öğrenci yoklamaları", |
| 3359 | "nav.studentPomodoro": "Öğrenci pomodoroları", | 3437 | "nav.studentPomodoro": "Öğrenci pomodoroları", |
| @@ -3377,6 +3455,45 @@ const tr: Dict = { | |||
| 3377 | "nav.group.grades": "Notlar", | 3455 | "nav.group.grades": "Notlar", |
| 3378 | "nav.group.community": "Topluluk", | 3456 | "nav.group.community": "Topluluk", |
| 3379 | "nav.group.services": "Okul hizmetleri", | 3457 | "nav.group.services": "Okul hizmetleri", |
| 3458 | + "nav.group.operations": "Operasyon", | ||
| 3459 | + "nav.group.ai": "Yapay zekâ", | ||
| 3460 | + "nav.group.institution": "Kurum", | ||
| 3461 | + "nav.group.myClassroom": "Sınıfım", | ||
| 3462 | + "nav.group.study": "Çalışma", | ||
| 3463 | + "nav.group.other": "Diğer", | ||
| 3464 | + "nav.group.myStudent": "Öğrencim", | ||
| 3465 | + "nav.studentsRoster": "Öğrenciler", | ||
| 3466 | + "nav.teachersRoster": "Öğretmenler", | ||
| 3467 | + "nav.schedule": "Ders programı", | ||
| 3468 | + "nav.mySchedule": "Ders programım", | ||
| 3469 | + "nav.mockExams": "Deneme sınavları", | ||
| 3470 | + "nav.opticalReading": "Optik okuma", | ||
| 3471 | + "nav.hezarfenZeka": "Hezarfen Zekâ", | ||
| 3472 | + "nav.celebi": "Çelebi", | ||
| 3473 | + "nav.soundStudio": "Ses Atölyesi", | ||
| 3474 | + "nav.reports": "Raporlar", | ||
| 3475 | + "nav.licenseModules": "Lisans ve modüller", | ||
| 3476 | + "nav.dataProtection": "KVKK ve denetim", | ||
| 3477 | + "nav.schoolMeals": "Yemekhane Yönetimi", | ||
| 3478 | + "nav.myClasses": "Sınıflarım", | ||
| 3479 | + "nav.studentAnalysis": "Öğrenci analizi", | ||
| 3480 | + "nav.pendingApprovals": "Bekleyen onaylar", | ||
| 3481 | + "nav.questionGeneration": "Soru üretimi", | ||
| 3482 | + "nav.parentCommunication": "Veli iletişimi", | ||
| 3483 | + "nav.studyPlan": "Çalışma programım", | ||
| 3484 | + "nav.topicMastery": "Konu yetkinliğim", | ||
| 3485 | + "nav.examResults": "Sınav sonuçlarım", | ||
| 3486 | + "nav.myHomework": "Ödevlerim", | ||
| 3487 | + "nav.progressReport": "Gelişim raporu", | ||
| 3488 | + "nav.absence": "Devamsızlık", | ||
| 3489 | + "nav.childExamResults": "Sınav sonuçları", | ||
| 3490 | + "nav.childStudyPlan": "Çalışma planı", | ||
| 3491 | + "nav.appointmentsAndCommunication": "Randevu ve iletişim", | ||
| 3492 | + "nav.soon": "Yakında", | ||
| 3493 | + "comingSoon.title": "Yakında", | ||
| 3494 | + "comingSoon.description": "Bu modül hazırlanıyor — henüz gösterecek bir şey yok.", | ||
| 3495 | + "comingSoon.emptyTitle": "Henüz kullanıma açık değil", | ||
| 3496 | + "comingSoon.emptyDescription": "Hezarfen'in bu bölümü hâlâ hazırlanıyor. Yakında tekrar bakın.", | ||
| 3380 | "nav.darkMode": "Karanlık mod", | 3497 | "nav.darkMode": "Karanlık mod", |
| 3381 | "parents.title": "Öğrencilerim", | 3498 | "parents.title": "Öğrencilerim", |
| 3382 | "parents.subtitle": "Size bağlı öğrencilerin akademik kayıtlarını inceleyin.", | 3499 | "parents.subtitle": "Size bağlı öğrencilerin akademik kayıtlarını inceleyin.", |
| @@ -4450,9 +4567,9 @@ const tr: Dict = { | |||
| 4450 | "meals.editDish": "Yemeği düzenle", | 4567 | "meals.editDish": "Yemeği düzenle", |
| 4451 | "meals.dishName": "Yemek adı", | 4568 | "meals.dishName": "Yemek adı", |
| 4452 | "meals.priceTry": "Fiyat (TRY)", | 4569 | "meals.priceTry": "Fiyat (TRY)", |
| 4453 | - "nav.payments": "Ücretler", | 4570 | + "nav.payments": "Ödeme ve tahsilat", |
| 4454 | "nav.paymentStatement": "Ücretlerim", | 4571 | "nav.paymentStatement": "Ücretlerim", |
| 4455 | - "nav.whiteboards": "Beyaz tahtalar", | 4572 | + "nav.whiteboards": "Tahta", |
| 4456 | "whiteboard.title": "Beyaz tahtalar", | 4573 | "whiteboard.title": "Beyaz tahtalar", |
| 4457 | "whiteboard.subtitle": "Canlı ortak çizim tahtaları.", | 4574 | "whiteboard.subtitle": "Canlı ortak çizim tahtaları.", |
| 4458 | "whiteboard.empty": "Henüz beyaz tahta yok.", | 4575 | "whiteboard.empty": "Henüz beyaz tahta yok.", |
src/pages/coming-soon-page.tsxadded+58 -0
| @@ -0,0 +1,58 @@ | |||
| 1 | +import { useLocation } from "@tanstack/solid-router"; | ||
| 2 | +import { RouteGuard } from "@/components/layout/route-guard"; | ||
| 3 | +import { PageHeader } from "@/components/layout/page-header"; | ||
| 4 | +import { EmptyState } from "@/components/ui/empty-state"; | ||
| 5 | +import type { MessageKey } from "@/i18n/messages"; | ||
| 6 | +import { useT } from "@/stores/preferences-context"; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * One route per not-yet-built module (see router.tsx's comingSoonRoutes) so | ||
| 10 | + * each has its own URL, breadcrumb and back-button target, but they all | ||
| 11 | + * render this same "not ready yet" page. The label comes from the last path | ||
| 12 | + * segment, kept in step with COMING_SOON_LABELS below and with the matching | ||
| 13 | + * sidebar entry's own labelKey in nav-items.ts. | ||
| 14 | + */ | ||
| 15 | +const COMING_SOON_LABELS: Record<string, MessageKey> = { | ||
| 16 | + "hezarfen-zeka": "nav.hezarfenZeka", | ||
| 17 | + "ses-atolyesi": "nav.soundStudio", | ||
| 18 | + "deneme-sinavlari": "nav.mockExams", | ||
| 19 | + "optik-okuma": "nav.opticalReading", | ||
| 20 | + raporlar: "nav.reports", | ||
| 21 | + "lisans-modulleri": "nav.licenseModules", | ||
| 22 | + "kvkk-denetim": "nav.dataProtection", | ||
| 23 | + ogrenciler: "nav.studentsRoster", | ||
| 24 | + ogretmenler: "nav.teachersRoster", | ||
| 25 | + "ogrenci-analizi": "nav.studentAnalysis", | ||
| 26 | + "bekleyen-onaylar": "nav.pendingApprovals", | ||
| 27 | + "soru-uretimi": "nav.questionGeneration", | ||
| 28 | + "calisma-programim": "nav.studyPlan", | ||
| 29 | + devamsizlik: "nav.absence", | ||
| 30 | + "sinav-sonuclari-veli": "nav.childExamResults", | ||
| 31 | + "calisma-plani": "nav.childStudyPlan", | ||
| 32 | +}; | ||
| 33 | + | ||
| 34 | +export default function ComingSoonPage() { | ||
| 35 | + return ( | ||
| 36 | + <RouteGuard> | ||
| 37 | + <ComingSoonContent /> | ||
| 38 | + </RouteGuard> | ||
| 39 | + ); | ||
| 40 | +} | ||
| 41 | + | ||
| 42 | +function ComingSoonContent() { | ||
| 43 | + const t = useT(); | ||
| 44 | + const location = useLocation(); | ||
| 45 | + const slug = () => location().pathname.split("/").filter(Boolean).pop() ?? ""; | ||
| 46 | + const labelKey = () => COMING_SOON_LABELS[slug()]; | ||
| 47 | + const title = () => { | ||
| 48 | + const key = labelKey(); | ||
| 49 | + return key ? t(key) : t("comingSoon.title"); | ||
| 50 | + }; | ||
| 51 | + | ||
| 52 | + return ( | ||
| 53 | + <div class="space-y-6"> | ||
| 54 | + <PageHeader title={title()} description={t("comingSoon.description")} /> | ||
| 55 | + <EmptyState title={t("comingSoon.emptyTitle")} description={t("comingSoon.emptyDescription")} /> | ||
| 56 | + </div> | ||
| 57 | + ); | ||
| 58 | +} | ||
src/routes/router.tsxmodified+32 -0
| @@ -66,6 +66,7 @@ const ProfilePage = lazyRoute(() => import("@/pages/profile-page")); | |||
| 66 | const PaymentStatementPage = lazyRoute(() => import("@/pages/payment-statement-page")); | 66 | const PaymentStatementPage = lazyRoute(() => import("@/pages/payment-statement-page")); |
| 67 | const WhiteboardsPage = lazyRoute(() => import("@/pages/whiteboards-page")); | 67 | const WhiteboardsPage = lazyRoute(() => import("@/pages/whiteboards-page")); |
| 68 | const WhiteboardPage = lazyRoute(() => import("@/pages/whiteboard-page")); | 68 | const WhiteboardPage = lazyRoute(() => import("@/pages/whiteboard-page")); |
| 69 | +const ComingSoonPage = lazyRoute(() => import("@/pages/coming-soon-page")); | ||
| 69 | 70 | ||
| 70 | function RootComponent() { | 71 | function RootComponent() { |
| 71 | return ( | 72 | return ( |
| @@ -396,6 +397,36 @@ const whiteboardRoute = createRoute({ | |||
| 396 | component: WhiteboardPage, | 397 | component: WhiteboardPage, |
| 397 | }); | 398 | }); |
| 398 | 399 | ||
| 400 | +// One route per Figma menu entry with no backend yet — each gets its own URL | ||
| 401 | +// (so breadcrumbs, back and direct links behave normally) but all render the | ||
| 402 | +// same "not ready" page. Slugs are read back by coming-soon-page.tsx. | ||
| 403 | +const COMING_SOON_SLUGS = [ | ||
| 404 | + "hezarfen-zeka", | ||
| 405 | + "ses-atolyesi", | ||
| 406 | + "deneme-sinavlari", | ||
| 407 | + "optik-okuma", | ||
| 408 | + "raporlar", | ||
| 409 | + "lisans-modulleri", | ||
| 410 | + "kvkk-denetim", | ||
| 411 | + "ogrenciler", | ||
| 412 | + "ogretmenler", | ||
| 413 | + "ogrenci-analizi", | ||
| 414 | + "bekleyen-onaylar", | ||
| 415 | + "soru-uretimi", | ||
| 416 | + "calisma-programim", | ||
| 417 | + "devamsizlik", | ||
| 418 | + "sinav-sonuclari-veli", | ||
| 419 | + "calisma-plani", | ||
| 420 | +] as const; | ||
| 421 | + | ||
| 422 | +const comingSoonRoutes = COMING_SOON_SLUGS.map((slug) => | ||
| 423 | + createRoute({ | ||
| 424 | + getParentRoute: () => rootRoute, | ||
| 425 | + path: `/coming-soon/${slug}`, | ||
| 426 | + component: ComingSoonPage, | ||
| 427 | + }), | ||
| 428 | +); | ||
| 429 | + | ||
| 399 | const routeTree = rootRoute.addChildren([ | 430 | const routeTree = rootRoute.addChildren([ |
| 400 | indexRoute, | 431 | indexRoute, |
| 401 | loginRoute, | 432 | loginRoute, |
| @@ -445,6 +476,7 @@ const routeTree = rootRoute.addChildren([ | |||
| 445 | whiteboardRoute, | 476 | whiteboardRoute, |
| 446 | myProfileRoute, | 477 | myProfileRoute, |
| 447 | userProfileRoute, | 478 | userProfileRoute, |
| 479 | + ...comingSoonRoutes, | ||
| 448 | ]); | 480 | ]); |
| 449 | 481 | ||
| 450 | function RouterPending() { | 482 | function RouterPending() { |