feat: implement immersive routes with Large Title component
- Added Large Title component to manage immersive screen headers. - Created ImmersiveBarProvider to handle the sticky bar for immersive routes. - Updated RootLayout to conditionally render Header based on immersive routes. - Modified Sidebar to adjust its position and height in immersive mode. - Integrated Large Title in ClassAttendanceView and AnalyticsView for consistent header display. - Updated GroupHeader to use Large Title for better layout management. - Implemented isImmersiveRoute function to determine immersive routes. - Added tests for immersive route detection.
This commit is contained in:
@@ -3,11 +3,19 @@ import { cn } from '../../lib/utils'
|
||||
import { Logo } from '../brand'
|
||||
import { isNavItemActive, NAV_ITEMS } from './nav-items'
|
||||
|
||||
export function Sidebar() {
|
||||
export function Sidebar({ immersive = false }: { immersive?: boolean }) {
|
||||
const location = useLocation()
|
||||
|
||||
return (
|
||||
<aside className="sticky top-16 hidden h-[calc(100dvh-4rem)] w-64 shrink-0 flex-col border-r border-border bg-surface px-4 py-6 lg:flex">
|
||||
// Sin header global no hay nada que esquive arriba: la columna del sidebar
|
||||
// pasa a ocupar la ventana completa y queda a la altura de la barra de
|
||||
// LargeTitle.
|
||||
<aside
|
||||
className={cn(
|
||||
'sticky hidden w-64 shrink-0 flex-col border-r border-border bg-surface px-4 py-6 lg:flex',
|
||||
immersive ? 'top-0 h-dvh' : 'top-16 h-[calc(100dvh-4rem)]',
|
||||
)}
|
||||
>
|
||||
{/* `Link` y no `<a>`: un anchor recargaría el documento y perdería el
|
||||
estado en memoria (cache de React Query, evento de instalación). */}
|
||||
<Link to="/" className="mb-8 flex items-center px-1" aria-label="Gruperly inicio">
|
||||
|
||||
Reference in New Issue
Block a user