Merge pull request #138 from the-programmers-hangout/fix-resolve-locked-body-from-resources

fix: resolve locked body back from resources on mobile
This commit is contained in:
Jean-Philippe Sirois
2019-10-09 00:25:37 -04:00
committed by GitHub
+9 -1
View File
@@ -6,18 +6,26 @@
*/
import { RouteComponentProps } from "@reach/router"
import React, { FC, Fragment } from "react"
import React, { FC, Fragment, useEffect } from "react"
import { Container } from "../../components/Container"
import { Footer } from "../../components/Footer"
import { Header } from "../../components/Header"
import { WavesBottom } from "../../components/Waves"
import { GlobalStyles } from "../../globalStyles"
import { useLockBodyScroll } from "../../hooks/useLockBodyScroll"
import { ThemeProvider } from "../../ThemeProvider"
import * as SC from "./styles"
export const Layout: FC<RouteComponentProps> = ({ children, location }) => {
const isHome = location ? location.pathname === "/" : false
const { locked, unlock } = useLockBodyScroll()
useEffect(() => {
if (locked) {
unlock()
}
}, [locked])
return (
<ThemeProvider>