mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-06 07:56:11 +02:00
feat: implement collapsable first level tree
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { useContext } from "react"
|
||||
import { SidebarContext, SidebarContextInterface } from "../SidebarProvider"
|
||||
|
||||
export default function useSidebar(): SidebarContextInterface {
|
||||
const sidebarContext = useContext(SidebarContext)
|
||||
|
||||
if (!sidebarContext) {
|
||||
throw Error("Need context")
|
||||
}
|
||||
|
||||
return sidebarContext
|
||||
}
|
||||
Reference in New Issue
Block a user