diff --git a/apps/web/src/components/layout/main-layout.tsx b/apps/web/src/components/layout/main-layout.tsx index 6ec3a1e..5179f45 100644 --- a/apps/web/src/components/layout/main-layout.tsx +++ b/apps/web/src/components/layout/main-layout.tsx @@ -3,19 +3,29 @@ import { Footer } from "./footer"; import { Sidebar } from "./sidebar"; import { MobileNav } from "./mobile-nav"; import { Leaf, Menu } from "lucide-react"; +import { useUiStore } from "@/store/ui-store"; type Props = { children: ReactNode }; export function MainLayout({ children }: Props) { const [mobileMenuOpen, setMobileMenuOpen] = useState(false); + const isSidebarOpen = useUiStore((state) => state.isSidebarOpen); + const setIsSidebarOpen = useUiStore((state) => state.setIsSidebarOpen); + return (
{/* Sidebar Desktop */} {/* Main Content */} -
+
{ + if (isSidebarOpen) { + setIsSidebarOpen(false); + } + }} + > {/* Header Mobile */}
@@ -40,10 +50,12 @@ export function MainLayout({ children }: Props) {
{/* Mobile Navigation */} - setMobileMenuOpen(false)} - /> +
+ setMobileMenuOpen(false)} + /> +
{/* Page Content */}