feat: static header + collapsible sidebar navigation
Replace floating pill header with static variant for authenticated views. Add collapsible sidebar with site picker, grouped navigation (Analytics/Infrastructure), and mobile overlay drawer. Remove horizontal SiteNav tab bar.
This commit is contained in:
31
lib/sidebar-context.tsx
Normal file
31
lib/sidebar-context.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
'use client'
|
||||
|
||||
import { createContext, useCallback, useContext, useState } from 'react'
|
||||
|
||||
interface SidebarContextValue {
|
||||
mobileOpen: boolean
|
||||
openMobile: () => void
|
||||
closeMobile: () => void
|
||||
}
|
||||
|
||||
const SidebarContext = createContext<SidebarContextValue>({
|
||||
mobileOpen: false,
|
||||
openMobile: () => {},
|
||||
closeMobile: () => {},
|
||||
})
|
||||
|
||||
export function SidebarProvider({ children }: { children: React.ReactNode }) {
|
||||
const [mobileOpen, setMobileOpen] = useState(false)
|
||||
const openMobile = useCallback(() => setMobileOpen(true), [])
|
||||
const closeMobile = useCallback(() => setMobileOpen(false), [])
|
||||
|
||||
return (
|
||||
<SidebarContext.Provider value={{ mobileOpen, openMobile, closeMobile }}>
|
||||
{children}
|
||||
</SidebarContext.Provider>
|
||||
)
|
||||
}
|
||||
|
||||
export function useSidebar() {
|
||||
return useContext(SidebarContext)
|
||||
}
|
||||
Reference in New Issue
Block a user