From 8751ba26ebf7b7761b9e237f2bf3453623dd1018 Mon Sep 17 00:00:00 2001
From: polwex <polwex@sortug.com>
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/Sidebar.tsx')

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(<NotificationCenter />);
+    });
+  }
+  return (
+    <div id="left-menu">
+      <div id="logo">
+        <img src={logo} />
+        <h3> Nostrill </h3>
+      </div>
+      <h3>Feeds</h3>
+      <div className="opt" role="link" onClick={() => goto(`/feed/global`)}>
+        <Icon name="home" size={20} />
+        <div>Home</div>
+      </div>
+      <div className="opt notification-item" role="link" onClick={openNotifications}>
+        <div className="notification-icon-wrapper">
+          <Icon name="bell" size={20} />
+          {unreadNotifications > 0 && (
+            <span className="notification-badge">
+              {unreadNotifications > 99 ? "99+" : unreadNotifications}
+            </span>
+          )}
+        </div>
+        <div>Notifications</div>
+      </div>
+      <hr />
+
+      <div
+        className="opt tbd"
+        role="link"
+        // onClick={() => goto("/chat")}
+      >
+        <Icon name="messages" size={20} />
+        <div>Messages</div>
+      </div>
+      <div className="opt" role="link" onClick={() => goto("/pals")}>
+        <Icon name="pals" size={20} />
+        <div>Pals</div>
+      </div>
+      <hr />
+      <div
+        className="opt"
+        role="link"
+        onClick={() => goto(`/feed/${api!.airlock.our}`)}
+      >
+        <Icon name="profile" size={20} />
+        <div>Profile</div>
+      </div>
+      <hr />
+      <div className="opt" role="link" onClick={() => goto("/sets")}>
+        <Icon name="settings" size={20} />
+        <div>Settings</div>
+      </div>
+      <ThemeSwitcher />
+    </div>
+  );
+}
+export default SlidingMenu;
-- 
cgit v1.2.3

