chore: remove landing page flag (#5673)
This commit is contained in:
parent
e95e2321b4
commit
3690936aff
@ -1,5 +1,4 @@
|
|||||||
import { BaseVariant, FeatureFlag, featureFlagSettings, useUpdateFlag } from 'featureFlags'
|
import { BaseVariant, FeatureFlag, featureFlagSettings, useUpdateFlag } from 'featureFlags'
|
||||||
import { LandingPageVariant, useLandingPageFlag } from 'featureFlags/flags/landingPage'
|
|
||||||
import { Permit2Variant, usePermit2Flag } from 'featureFlags/flags/permit2'
|
import { Permit2Variant, usePermit2Flag } from 'featureFlags/flags/permit2'
|
||||||
import { TraceJsonRpcVariant, useTraceJsonRpcFlag } from 'featureFlags/flags/traceJsonRpc'
|
import { TraceJsonRpcVariant, useTraceJsonRpcFlag } from 'featureFlags/flags/traceJsonRpc'
|
||||||
import { useAtomValue, useUpdateAtom } from 'jotai/utils'
|
import { useAtomValue, useUpdateAtom } from 'jotai/utils'
|
||||||
@ -203,12 +202,6 @@ export default function FeatureFlagModal() {
|
|||||||
<X size={24} />
|
<X size={24} />
|
||||||
</CloseButton>
|
</CloseButton>
|
||||||
</Header>
|
</Header>
|
||||||
<FeatureFlagOption
|
|
||||||
variant={LandingPageVariant}
|
|
||||||
value={useLandingPageFlag()}
|
|
||||||
featureFlag={FeatureFlag.landingPage}
|
|
||||||
label="Landing page"
|
|
||||||
/>
|
|
||||||
<FeatureFlagOption
|
<FeatureFlagOption
|
||||||
variant={Permit2Variant}
|
variant={Permit2Variant}
|
||||||
value={usePermit2Flag()}
|
value={usePermit2Flag()}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
export enum FeatureFlag {
|
export enum FeatureFlag {
|
||||||
traceJsonRpc = 'traceJsonRpc',
|
traceJsonRpc = 'traceJsonRpc',
|
||||||
landingPage = 'landingPage',
|
|
||||||
permit2 = 'permit2',
|
permit2 = 'permit2',
|
||||||
}
|
}
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
import { BaseVariant } from '../index'
|
|
||||||
|
|
||||||
export function useLandingPageFlag(): BaseVariant {
|
|
||||||
return BaseVariant.Enabled
|
|
||||||
}
|
|
||||||
|
|
||||||
export { BaseVariant as LandingPageVariant }
|
|
@ -4,7 +4,6 @@ import Loader from 'components/Loader'
|
|||||||
import { MenuDropdown } from 'components/NavBar/MenuDropdown'
|
import { MenuDropdown } from 'components/NavBar/MenuDropdown'
|
||||||
import TopLevelModals from 'components/TopLevelModals'
|
import TopLevelModals from 'components/TopLevelModals'
|
||||||
import { useFeatureFlagsIsLoaded } from 'featureFlags'
|
import { useFeatureFlagsIsLoaded } from 'featureFlags'
|
||||||
import { LandingPageVariant, useLandingPageFlag } from 'featureFlags/flags/landingPage'
|
|
||||||
import ApeModeQueryParamReader from 'hooks/useApeModeQueryParamReader'
|
import ApeModeQueryParamReader from 'hooks/useApeModeQueryParamReader'
|
||||||
import { Box } from 'nft/components/Box'
|
import { Box } from 'nft/components/Box'
|
||||||
import { CollectionPageSkeleton } from 'nft/components/collection/CollectionPageSkeleton'
|
import { CollectionPageSkeleton } from 'nft/components/collection/CollectionPageSkeleton'
|
||||||
@ -202,8 +201,6 @@ export default function App() {
|
|||||||
|
|
||||||
const isHeaderTransparent = !scrolledState
|
const isHeaderTransparent = !scrolledState
|
||||||
|
|
||||||
const landingPageFlag = useLandingPageFlag()
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<DarkModeQueryParamReader />
|
<DarkModeQueryParamReader />
|
||||||
@ -220,7 +217,7 @@ export default function App() {
|
|||||||
<Suspense fallback={<Loader />}>
|
<Suspense fallback={<Loader />}>
|
||||||
{isLoaded ? (
|
{isLoaded ? (
|
||||||
<Routes>
|
<Routes>
|
||||||
{landingPageFlag === LandingPageVariant.Enabled && <Route path="/" element={<Landing />} />}
|
<Route path="/" element={<Landing />} />
|
||||||
<Route path="tokens" element={<Tokens />}>
|
<Route path="tokens" element={<Tokens />}>
|
||||||
<Route path=":chainName" />
|
<Route path=":chainName" />
|
||||||
</Route>
|
</Route>
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Trace, TraceEvent } from '@uniswap/analytics'
|
import { Trace, TraceEvent } from '@uniswap/analytics'
|
||||||
import { BrowserEvent, ElementName, EventName, PageName } from '@uniswap/analytics-events'
|
import { BrowserEvent, ElementName, EventName, PageName } from '@uniswap/analytics-events'
|
||||||
import { BaseButton } from 'components/Button'
|
import { BaseButton } from 'components/Button'
|
||||||
import { LandingPageVariant, useLandingPageFlag } from 'featureFlags/flags/landingPage'
|
|
||||||
import Swap from 'pages/Swap'
|
import Swap from 'pages/Swap'
|
||||||
import { useEffect } from 'react'
|
import { useEffect } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
@ -170,21 +169,14 @@ export default function Landing() {
|
|||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
const isOpen = location.pathname === '/'
|
const isOpen = location.pathname === '/'
|
||||||
|
|
||||||
const landingPageFlag = useLandingPageFlag()
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (landingPageFlag) {
|
document.body.style.overflow = 'hidden'
|
||||||
document.body.style.overflow = 'hidden'
|
|
||||||
return () => {
|
|
||||||
document.body.style.overflow = 'auto'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return () => {
|
return () => {
|
||||||
// need to have a return so the hook doesn't throw.
|
document.body.style.overflow = 'auto'
|
||||||
}
|
}
|
||||||
}, [landingPageFlag])
|
}, [])
|
||||||
|
|
||||||
if (landingPageFlag === LandingPageVariant.Control || !isOpen) return null
|
if (!isOpen) return null
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Trace page={PageName.LANDING_PAGE} shouldLogImpression>
|
<Trace page={PageName.LANDING_PAGE} shouldLogImpression>
|
||||||
|
Loading…
Reference in New Issue
Block a user