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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user