parent
2e1d4fdda1
commit
9eb7d45aea
@ -1,6 +1,7 @@
|
||||
import { BaseButton } from 'components/Button'
|
||||
import { LandingPageVariant, useLandingPageFlag } from 'featureFlags/flags/landingPage'
|
||||
import Swap from 'pages/Swap'
|
||||
import { useEffect } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { useIsDarkMode } from 'state/user/hooks'
|
||||
@ -130,7 +131,21 @@ export default function Landing() {
|
||||
const location = useLocation()
|
||||
const isOpen = location.pathname === '/'
|
||||
|
||||
if (useLandingPageFlag() === LandingPageVariant.Control || !isOpen) return null
|
||||
const landingPageFlag = useLandingPageFlag()
|
||||
|
||||
useEffect(() => {
|
||||
if (landingPageFlag) {
|
||||
document.body.style.overflow = 'hidden'
|
||||
return () => {
|
||||
document.body.style.overflow = 'auto'
|
||||
}
|
||||
}
|
||||
return () => {
|
||||
// need to have a return so the hook doesn't throw.
|
||||
}
|
||||
}, [landingPageFlag])
|
||||
|
||||
if (landingPageFlag === LandingPageVariant.Control || !isOpen) return null
|
||||
|
||||
return (
|
||||
<>
|
||||
|
Loading…
Reference in New Issue
Block a user