diff --git a/src/App.css b/src/App.css index b9d355d..d981621 100644 --- a/src/App.css +++ b/src/App.css @@ -1,8 +1,7 @@ + #root { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - text-align: center; + width: 100%; + min-height: 100vh; } .logo { diff --git a/src/components/layout/Layout.tsx b/src/components/layout/Layout.tsx index e506dbb..1dcaaa1 100644 --- a/src/components/layout/Layout.tsx +++ b/src/components/layout/Layout.tsx @@ -1,7 +1,10 @@ -import React from 'react'; +import React, { useState, useEffect } from 'react'; import Sidebar from '@/components/layout/Sidebar'; import { useToast } from "@/components/ui/use-toast"; +import { Menu } from 'lucide-react'; +import { Button } from "@/components/ui/button"; +import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet"; interface LayoutProps { children: React.ReactNode; @@ -9,11 +12,39 @@ interface LayoutProps { const Layout: React.FC = ({ children }) => { const { toast } = useToast(); + const [isMobile, setIsMobile] = useState(false); + + useEffect(() => { + const checkIfMobile = () => { + setIsMobile(window.innerWidth < 768); + }; + + checkIfMobile(); + window.addEventListener('resize', checkIfMobile); + + return () => { + window.removeEventListener('resize', checkIfMobile); + }; + }, []); return (
- -
+ {isMobile ? ( + + + + + + + + + ) : ( + + )} +
{children}
diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx index a354193..a02ecc1 100644 --- a/src/components/layout/Sidebar.tsx +++ b/src/components/layout/Sidebar.tsx @@ -1,5 +1,5 @@ -import React, { useState } from 'react'; +import React from 'react'; import { Link, useLocation } from 'react-router-dom'; import { cn } from '@/lib/utils'; import { Button } from "@/components/ui/button"; @@ -34,12 +34,12 @@ interface SidebarProps { const Sidebar = ({ className }: SidebarProps) => { const location = useLocation(); - const [collapsed, setCollapsed] = useState(false); + const [collapsed, setCollapsed] = React.useState(false); return (