feat: implement collapsable first level tree

This commit is contained in:
Jean-Philippe Sirois
2019-07-30 06:45:19 -04:00
parent 96d9aec89a
commit 021a1d4aa2
4 changed files with 79 additions and 8 deletions
+12
View File
@@ -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
}