From 2ff77f0b8d9a98cc2dd2dc7d3d59aa951f7a37bd Mon Sep 17 00:00:00 2001 From: "Adebanjo Abraham.I" Date: Fri, 8 May 2026 14:57:29 +0100 Subject: [PATCH 1/3] feat: implement responsive sidebar and mobile drawer for DeskLayout --- .../components/Desk/DeskLayout.jsx | 179 +++++++++++------- 1 file changed, 111 insertions(+), 68 deletions(-) diff --git a/web3nova-revamp/components/Desk/DeskLayout.jsx b/web3nova-revamp/components/Desk/DeskLayout.jsx index 2041d89..8efffe4 100644 --- a/web3nova-revamp/components/Desk/DeskLayout.jsx +++ b/web3nova-revamp/components/Desk/DeskLayout.jsx @@ -1,7 +1,7 @@ import { useEffect, useState } from "react"; import { useRouter } from "next/router"; import Link from "next/link"; -import { Users, UserCheck, Clock, LogOut, Wifi, RefreshCw } from "lucide-react"; +import { Users, UserCheck, Clock, LogOut, Wifi, RefreshCw, Menu, X } from "lucide-react"; import { getToken, clearToken, deskFetch } from "@/lib/deskApi"; const NAV = [ @@ -10,12 +10,85 @@ const NAV = [ { href: "/desk/attendance", label: "Attendance", icon: Clock }, ]; +function Sidebar({ router, hub, syncing, syncMsg, syncHubIp, logout, onClose }) { + return ( + + ); +} + export default function DeskLayout({ children, title }) { const router = useRouter(); const [ready, setReady] = useState(false); const [hub, setHub] = useState(null); const [syncing, setSyncing] = useState(false); const [syncMsg, setSyncMsg] = useState(null); + const [drawerOpen, setDrawerOpen] = useState(false); useEffect(() => { if (!getToken()) { @@ -26,6 +99,9 @@ export default function DeskLayout({ children, title }) { } }, [router]); + // Close drawer on route change + useEffect(() => { setDrawerOpen(false); }, [router.pathname]); + async function syncHubIp() { setSyncing(true); setSyncMsg(null); @@ -47,78 +123,45 @@ export default function DeskLayout({ children, title }) { if (!ready) return null; + const sidebarProps = { router, hub, syncing, syncMsg, syncHubIp, logout }; + return (
- + {/* Mobile drawer overlay */} + {drawerOpen && ( +
setDrawerOpen(false)} + /> + )} + + {/* Mobile drawer */} +
+ setDrawerOpen(false)} /> +
+ + {/* Main content */} +
+ + {/* Mobile top bar */} +
+ + {title || "Desk"} +
-
- {title &&

{title}

} - {children} -
+
+ {title &&

{title}

} + {children} +
+
); } From d109b26824e3f5dcc996c4c84911f252562e358d Mon Sep 17 00:00:00 2001 From: "Adebanjo Abraham.I" Date: Fri, 8 May 2026 15:18:42 +0100 Subject: [PATCH 2/3] feat: update Sidebar component for improved mobile navigation accessibility --- web3nova-revamp/components/Desk/DeskLayout.jsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/web3nova-revamp/components/Desk/DeskLayout.jsx b/web3nova-revamp/components/Desk/DeskLayout.jsx index 8efffe4..3542d84 100644 --- a/web3nova-revamp/components/Desk/DeskLayout.jsx +++ b/web3nova-revamp/components/Desk/DeskLayout.jsx @@ -12,14 +12,14 @@ const NAV = [ function Sidebar({ router, hub, syncing, syncMsg, syncHubIp, logout, onClose }) { return ( -