diff --git a/src/app/(dashboard)/dashboard-shell.tsx b/src/app/(dashboard)/dashboard-shell.tsx index 68c4d51..24a4afb 100644 --- a/src/app/(dashboard)/dashboard-shell.tsx +++ b/src/app/(dashboard)/dashboard-shell.tsx @@ -1,6 +1,6 @@ "use client"; -import { useEffect } from "react"; +import { useCallback, useEffect, useState } from "react"; import { useRouter } from "next/navigation"; import { AuthProvider, useAuth } from "@/hooks/use-auth"; import { Sidebar } from "@/components/layout/sidebar"; @@ -14,6 +14,11 @@ function DashboardShellInner({ children }: { children: React.ReactNode }) { const { user, loading } = useAuth(); const router = useRouter(); + // Sidebar drawer state — only used on mobile. On lg+ the sidebar is + // always visible and this stays at `false` (ignored by the component). + const [sidebarOpen, setSidebarOpen] = useState(false); + const closeSidebar = useCallback(() => setSidebarOpen(false), []); + useEffect(() => { if (!loading && !user) { router.push("/login"); @@ -35,10 +40,11 @@ function DashboardShellInner({ children }: { children: React.ReactNode }) { return (