Give useIsMobile an initial state

This commit is contained in:
Alex Gleason committed 2025-09-13 18:34:30 -05:00
1 parent 0edef42bf2
commit 787b0bb777
4 files changed
+20 -39

No files matched your search

+1 -8
View File
@@ -27,14 +27,7 @@ export function AppLayout({
const navigate = useNavigate();
const isMobile = useIsMobile();
const [isSidebarVisible, setIsSidebarVisible] = useState(() => {
// On mobile, always start hidden
if (typeof window !== 'undefined' && window.innerWidth < 768) {
return false;
}
// On desktop, we'll set the initial state after projects load
return false; // Default to closed initially
});
const [isSidebarVisible, setIsSidebarVisible] = useState(!isMobile);
// Track if we've set the initial state based on projects
const [hasSetInitialState, setHasSetInitialState] = useState(false);