mirror of
https://github.com/supabase/supabase.git
synced 2026-10-13 21:29:08 +03:00
* 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
25 lines
610 B
TypeScript
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
|
|
}
|