diff --git a/components/dashboard/Sidebar.tsx b/components/dashboard/Sidebar.tsx index 8cbf35a..ec938ff 100644 --- a/components/dashboard/Sidebar.tsx +++ b/components/dashboard/Sidebar.tsx @@ -193,7 +193,7 @@ function SitePicker({ sites, siteId, collapsed, onExpand, onCollapse, wasCollaps {open && ( -
+
{ onNavigate(href); onClick?.() }} - title={collapsed ? item.label : undefined} - className={`flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm font-medium overflow-hidden ${ - active - ? 'bg-brand-orange/10 text-brand-orange' - : 'text-neutral-400 hover:text-white hover:bg-neutral-800' - }`} - > - - - - - +
+ { onNavigate(href); onClick?.() }} + className={`flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm font-medium overflow-hidden transition-all duration-150 ${ + active + ? 'bg-brand-orange/10 text-brand-orange' + : 'text-neutral-400 hover:text-white hover:bg-neutral-800 hover:translate-x-0.5' + }`} + > + + + + + + {collapsed && ( + + {item.label} + + )} +
) } @@ -365,12 +371,17 @@ function SidebarContent({
{/* Notifications, Profile — same layout as nav items */}
- +
- - + {c && ( + + Notifications + + )} +
+
- + {c && ( + + {user?.display_name?.trim() || 'Profile'} + + )} +
{/* Settings + Collapse */}
{!isMobile && ( - +
+ + {c && ( + + Expand (press [) + + )} +
)}
@@ -424,6 +446,7 @@ export default function Sidebar({ const [sites, setSites] = useState([]) const [orgs, setOrgs] = useState([]) const [pendingHref, setPendingHref] = useState(null) + const [mobileClosing, setMobileClosing] = useState(false) const wasCollapsedRef = useRef(false) const pickerOpenCallbackRef = useRef<(() => void) | null>(null) // Safe to read localStorage directly — this component is loaded with ssr:false @@ -477,6 +500,14 @@ export default function Sidebar({ setCollapsed(true); localStorage.setItem(SIDEBAR_KEY, 'true') }, []) + const handleMobileClose = useCallback(() => { + setMobileClosing(true) + setTimeout(() => { + setMobileClosing(false) + onMobileClose() + }, 200) + }, [onMobileClose]) + const handleNavigate = useCallback((href: string) => { setPendingHref(href) }, []) return ( @@ -514,13 +545,24 @@ export default function Sidebar({ {/* Mobile overlay */} - {mobileOpen && ( + {(mobileOpen || mobileClosing) && ( <> -
-