fix(sidebar): toggle sidebar state when clicking navigation links

- Update the `onClick` handler for navigation links in `sidebar.tsx` to use `!isSidebarOpen` instead of a hardcoded boolean.
- Enable navigation items to act as smart toggles: expanding the sidebar when clicked in collapsed mode, and collapsing it when clicked in expanded mode.
- Improve overall user experience by reducing the need to manually click the main toggle button.
This commit is contained in:
seriouselly
2026-06-12 12:35:46 +07:00
parent a77a6c84ff
commit 3b8cb49f2a
+1 -1
View File
@@ -116,7 +116,7 @@ export function Sidebar() {
key={item.path}
to={item.path}
title={item.label}
onClick={() => setIsSidebarOpen(true)}
onClick={() => setIsSidebarOpen(!isSidebarOpen)}
className={`flex items-center rounded-full font-medium transition-all ${
isSidebarOpen
? "px-4 py-3 gap-3 text-[16px] w-full"