From 436f6d0ef9b2b885047f820bb6dcf6c4c299739a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Boduro=C4=9Flu?= <80620802+burakboduroglu@users.noreply.github.com> Date: Sun, 12 Jul 2026 17:53:18 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=94=92=20admin=20route=20guard,?= =?UTF-8?q?=20sidebar=20section=20&=20role-based=20dashboard=20actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/dashboard/role-home-panel.tsx | 4 +++- src/components/layout/side-nav.tsx | 17 +++++++++++++++-- src/i18n/messages.ts | 3 +++ src/routes/router.tsx | 19 +++++++++++++++++++ 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/src/components/dashboard/role-home-panel.tsx b/src/components/dashboard/role-home-panel.tsx index d30affd..8d99b9c 100644 --- a/src/components/dashboard/role-home-panel.tsx +++ b/src/components/dashboard/role-home-panel.tsx @@ -35,11 +35,13 @@ const ROLE_ACTIONS: Record = { { to: "/courses", title: "nav.courses", hint: "courses.subtitle", marker: "▣", tone: "violet" }, { to: "/events", title: "nav.events", hint: "events.subtitle", marker: "◷", tone: "sky" }, { to: "/exams", title: "exams.liveMonitor", hint: "exams.liveMonitorDesc", marker: "◎", tone: "amber" }, + { to: "/marks", title: "dashboard.action.marks", hint: "dashboard.action.marksHint", marker: "▤", tone: "mint" }, ], admin: [ { to: "/admin/users", title: "nav.users", hint: "admin.subtitle", marker: "◉", tone: "amber" }, { to: "/courses", title: "nav.courses", hint: "courses.subtitle", marker: "▣", tone: "violet" }, { to: "/events", title: "nav.events", hint: "events.subtitle", marker: "◷", tone: "sky" }, + { to: "/exams", title: "exams.liveMonitor", hint: "exams.liveMonitorDesc", marker: "◎", tone: "rose" }, ], }; @@ -68,7 +70,7 @@ export function RoleHomePanel(props: { role: Role }) { -
+
{(action) => ( void; collapsed?: boolean }) MAIN_ITEMS.filter((item) => !item.adminOnly || hasMinRole(auth.user()?.role, "admin")), ); + const t = useT(); + return (