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.
32 lines
807 B
TypeScript
32 lines
807 B
TypeScript
'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)
|
|
}
|