diff --git a/src/admin/layout/AdminLayout.jsx b/src/admin/layout/AdminLayout.jsx index 1cbe569..5f02ac5 100644 --- a/src/admin/layout/AdminLayout.jsx +++ b/src/admin/layout/AdminLayout.jsx @@ -1,8 +1,9 @@ import { useState, useEffect } from 'react'; import { Outlet, useLocation } from 'react-router-dom'; -import { Plus } from 'lucide-react'; +import { Plus, Menu } from 'lucide-react'; import Sidebar from './Sidebar'; import { supabase } from '../../lib/supabase'; +import { useIsMobile } from '../../hooks/useIsMobile'; const PAGE_TITLES = { '/admin/kanban': 'Канбан', @@ -15,6 +16,8 @@ const AdminLayout = () => { const title = PAGE_TITLES[location.pathname] || 'Панель управления'; const [showNewOrder, setShowNewOrder] = useState(false); const [newCount, setNewCount] = useState(0); + const [sidebarOpen, setSidebarOpen] = useState(false); + const isMobile = useIsMobile(); useEffect(() => { const refreshBadge = () => { @@ -33,10 +36,31 @@ const AdminLayout = () => { return () => supabase.removeChannel(channel); }, []); + useEffect(() => { + setSidebarOpen(false); + }, [location.pathname]); + return (
Панель управления
+ {isMobile && ( + + )}