From 3b8cb49f2a259ea542658a8b2dd0c6ca371e5c14 Mon Sep 17 00:00:00 2001 From: seriouselly Date: Fri, 12 Jun 2026 12:35:46 +0700 Subject: [PATCH] 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. --- apps/web/src/components/layout/sidebar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/components/layout/sidebar.tsx b/apps/web/src/components/layout/sidebar.tsx index 725916a..0505098 100644 --- a/apps/web/src/components/layout/sidebar.tsx +++ b/apps/web/src/components/layout/sidebar.tsx @@ -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"