Spaces:
Runtime error
Runtime error
Greg
Claude Opus 4.7 (1M context)
fix(ta-01): replace mobile topbar with floating hamburger button
d456a34 Download frontend/src/components/Layout.tsx from Talosware/talos-access: direct link, hf CLI and curl.
- Browser
- Download file 1.14 kB
-
https://huggingface.co/spaces/Talosware/talos-access/resolve/main/frontend/src/components/Layout.tsx
- Command line
-
hf download hf://spaces/Talosware/talos-access/frontend/src/components/Layout.tsx
-
curl -L -o Layout.tsx https://huggingface.co/spaces/Talosware/talos-access/resolve/main/frontend/src/components/Layout.tsx
1.14 kB
| import { Outlet, useLocation } from 'react-router-dom'; | |
| import { useState, useEffect } from 'react'; | |
| import { Menu } from 'lucide-react'; | |
| import Sidebar from './Sidebar'; | |
| export default function Layout() { | |
| const [mobileOpen, setMobileOpen] = useState(false); | |
| const location = useLocation(); | |
| // Close drawer whenever the route changes. | |
| useEffect(() => { | |
| setMobileOpen(false); | |
| }, [location.pathname]); | |
| return ( | |
| <div className="app-layout"> | |
| {/* Floating hamburger (mobile only, no full topbar) */} | |
| <button | |
| type="button" | |
| onClick={() => setMobileOpen(true)} | |
| aria-label="Abrir menú" | |
| className="mobile-menu-fab md:hidden" | |
| > | |
| <Menu size={20} /> | |
| </button> | |
| {/* Backdrop for mobile drawer */} | |
| {mobileOpen && ( | |
| <div | |
| className="fixed inset-0 bg-black/50 z-30 md:hidden" | |
| onClick={() => setMobileOpen(false)} | |
| aria-hidden="true" | |
| /> | |
| )} | |
| <Sidebar mobileOpen={mobileOpen} onClose={() => setMobileOpen(false)} /> | |
| <main className="main-content"> | |
| <Outlet /> | |
| </main> | |
| </div> | |
| ); | |
| } | |