diff --git a/web/src/components/Sidebar.tsx b/web/src/components/Sidebar.tsx index e5a51a9..b6e5ab6 100644 --- a/web/src/components/Sidebar.tsx +++ b/web/src/components/Sidebar.tsx @@ -1,4 +1,6 @@ +import * as Dialog from '@radix-ui/react-dialog'; import { Link, useRouterState } from '@tanstack/react-router'; +import classNames from 'classnames'; import { FC } from 'react'; import { FiLock } from 'react-icons/fi'; import { GrWorkshop } from 'react-icons/gr'; @@ -44,36 +46,20 @@ export const NAV_ITEMS = [ }, ]; -export const Sidebar: FC = () => { - const { pathname } = useRouterState({ select: (s) => s.location }); - const { isAuthenticated } = useAuth(); - const { isSidebarOpen } = useApp(); - - if (!isSidebarOpen) { - // Keep the sidebar width for layout, but hide content - return ( -
- ); - } - +const SidebarContent: FC<{ + pathname: string; + isAuthenticated: boolean; + onNavigate?: () => void; +}> = ({ pathname, isAuthenticated, onNavigate }) => { return ( -
+
); }; + +export const Sidebar: FC = () => { + const { pathname } = useRouterState({ select: (s) => s.location }); + const { isAuthenticated } = useAuth(); + const { isSidebarOpen, closeSidebar } = useApp(); + + return ( + <> + {/* Desktop sidebar */} + + + {/* Mobile sidebar overlay */} + { + if (!v) closeSidebar(); + }} + > + + + + + + + + + ); +};