From 8751ba26ebf7b7761b9e237f2bf3453623dd1018 Mon Sep 17 00:00:00 2001 From: polwex Date: Mon, 6 Oct 2025 10:13:39 +0700 Subject: added frontend WS connection for demonstration purposes --- gui/src/components/layout/Sidebar.tsx | 80 +++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 gui/src/components/layout/Sidebar.tsx (limited to 'gui/src/components/layout') diff --git a/gui/src/components/layout/Sidebar.tsx b/gui/src/components/layout/Sidebar.tsx new file mode 100644 index 0000000..c267e2f --- /dev/null +++ b/gui/src/components/layout/Sidebar.tsx @@ -0,0 +1,80 @@ +import { RADIO, versionNum } from "@/logic/constants"; +import { useLocation } from "wouter"; +import useLocalState from "@/state/state"; +import logo from "@/assets/icons/logo.png"; +import Icon from "@/components/Icon"; +import { ThemeSwitcher } from "@/styles/ThemeSwitcher"; + +function SlidingMenu() { + const [_, navigate] = useLocation(); + 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 ( +
+ +

Feeds

+
goto(`/feed/global`)}> + +
Home
+
+
+
+ + {unreadNotifications > 0 && ( + + {unreadNotifications > 99 ? "99+" : unreadNotifications} + + )} +
+
Notifications
+
+
+ +
goto("/chat")} + > + +
Messages
+
+
goto("/pals")}> + +
Pals
+
+
+
goto(`/feed/${api!.airlock.our}`)} + > + +
Profile
+
+
+
goto("/sets")}> + +
Settings
+
+ +
+ ); +} +export default SlidingMenu; -- cgit v1.2.3