From ad7ebd1756956724e0b167d88f924e707401a9aa Mon Sep 17 00:00:00 2001 From: polwex Date: Thu, 18 Sep 2025 03:48:14 +0700 Subject: fuck yeah --- front/src/components/layout/Sidebar.tsx | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'front/src/components/layout/Sidebar.tsx') diff --git a/front/src/components/layout/Sidebar.tsx b/front/src/components/layout/Sidebar.tsx index d237fb5..c267e2f 100644 --- a/front/src/components/layout/Sidebar.tsx +++ b/front/src/components/layout/Sidebar.tsx @@ -7,10 +7,22 @@ import { ThemeSwitcher } from "@/styles/ThemeSwitcher"; function SlidingMenu() { const [_, navigate] = useLocation(); - const { api } = useLocalState((s) => ({ api: s.api })); + const { api, unreadNotifications, setModal } = useLocalState((s) => ({ + api: s.api, + unreadNotifications: s.unreadNotifications, + setModal: s.setModal + })); + function goto(to: string) { navigate(to); } + + function openNotifications() { + // We'll create this component next + import("../NotificationCenter").then(({ default: NotificationCenter }) => { + setModal(); + }); + } return (
-
goto(`/hark`)}> - -
Activity
+
+
+ + {unreadNotifications > 0 && ( + + {unreadNotifications > 99 ? "99+" : unreadNotifications} + + )} +
+
Notifications

-- cgit v1.2.3