Files
supabase/apps/design-system/hooks/use-mobile-sidebar.ts
kemal.earth b97e41e20b chore(design-system): tidy up mobile styling (#41267)
* feat: tidy up header on mobile

* fix: graceful searchbar header

* fix: header classes and unused elements

* feat: trim down logo on header

* fix: logos again

* chore: remove dead code

* fix: classic dark logo header

* fix: page padding tidy ups

* fix: some font sizing

* feat: updated homepage cards

* fix: toc layout

* fix: toc again

* feat: homepage cards all the same size

* fix: footer paddings

* fix: pager if only 1 directional item

* fix: sidebar padding issues

* chore: killing all the defaults

* fix: import for side nav

* fix: sidebar complaining about dialog title

* fix: homepage paddings

* fix: killing one more default export

* feat: update colours icon to francescos

* fix: loose repeated copy
2025-12-12 10:08:48 +00:00

25 lines
610 B
TypeScript

'use client'
import { createContext, useContext } from 'react'
export interface MobileSidebarContextType {
open: boolean
setOpen: (open: boolean) => void
toggle: () => void
}
export const MobileSidebarContext = createContext<MobileSidebarContextType | null>(null)
export function useMobileSidebar(): MobileSidebarContextType {
const context = useContext(MobileSidebarContext)
if (context === null) {
throw new Error(
'useMobileSidebar must be used within a MobileSidebarProvider. ' +
'Ensure your component is wrapped with MobileSidebarProvider.'
)
}
return context
}