fix(resources): lock body on opening sidebar

This commit is contained in:
Jean-Philippe Sirois
2019-09-24 01:31:48 -04:00
parent 0931f9e4ce
commit 94e2489a85
3 changed files with 29 additions and 1 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ import { graphql, Link, useStaticQuery } from "gatsby"
import React, { FC, HTMLAttributes, memo, useState } from "react"
import Scrollbar from "react-perfect-scrollbar"
import "react-perfect-scrollbar/dist/css/styles.css"
import { useLockBodyScroll } from "../../hooks/useLockBodyScroll"
import TriangleDown from "../../icons/triangle-down.svg"
import Banner from "../../images/tph-banner.svg"
import { IAllResourcesQuery, IFileOrFolder, IFolder } from "../../types"
@@ -95,7 +96,7 @@ const MenuItem: FC<IMenuItemProps> = ({ children, to }) => {
)
}
export const ResourcesSidebar: FC<HTMLAttributes<HTMLDivElement>> = (props) => {
export const ResourcesSidebar: FC<HTMLAttributes<HTMLDivElement>> = props => {
const resources = useStaticQuery<IAllResourcesQuery>(ALL_RESOURCES)
const tree = useBuildTree(resources)