auto collapse sidebar on small screens

This commit is contained in:
miloschwartz
2025-12-03 18:33:46 -05:00
parent 4b580105cd
commit 7efc947e26
3 changed files with 31 additions and 5 deletions

View File

@@ -30,6 +30,7 @@ export async function Layout({
}: LayoutProps) {
const allCookies = await cookies();
const sidebarStateCookie = allCookies.get("pangolin-sidebar-state")?.value;
const hasCookiePreference = sidebarStateCookie !== undefined;
const initialSidebarCollapsed =
sidebarStateCookie === "collapsed" ||
@@ -44,6 +45,7 @@ export async function Layout({
orgs={orgs}
navItems={navItems}
defaultSidebarCollapsed={initialSidebarCollapsed}
hasCookiePreference={hasCookiePreference}
/>
)}