diff --git a/src/pages/Landing/index.tsx b/src/pages/Landing/index.tsx index 48931f5df4..6300793be5 100644 --- a/src/pages/Landing/index.tsx +++ b/src/pages/Landing/index.tsx @@ -3,7 +3,7 @@ import { BrowserEvent, ElementName, EventName, PageName } from '@uniswap/analyti import { BaseButton } from 'components/Button' import { LandingRedirectVariant, useLandingRedirectFlag } from 'featureFlags/flags/landingRedirect' import Swap from 'pages/Swap' -import { useEffect } from 'react' +import { useEffect, useState } from 'react' import { useLocation, useNavigate } from 'react-router-dom' import { Link as NativeLink } from 'react-router-dom' import { useAppSelector } from 'state/hooks' @@ -178,12 +178,19 @@ export default function Landing() { } }, []) + const [showContent, setShowContent] = useState(false) const selectedWallet = useAppSelector((state) => state.user.selectedWallet) const landingRedirectFlag = useLandingRedirectFlag() const navigate = useNavigate() useEffect(() => { - if (selectedWallet && landingRedirectFlag === LandingRedirectVariant.Enabled) { - navigate('/swap') + if (selectedWallet) { + if (landingRedirectFlag === LandingRedirectVariant.Enabled) { + navigate('/swap') + } else { + setShowContent(true) + } + } else { + setShowContent(true) } }, [navigate, selectedWallet, landingRedirectFlag]) @@ -191,36 +198,38 @@ export default function Landing() { return ( - - - - - - - - - - Trade crypto & NFTs with confidence - - Buy, sell, and explore tokens and NFTs - - - - - Get started - - - - - + {showContent && ( + + + + + + + + + + Trade crypto & NFTs with confidence + + Buy, sell, and explore tokens and NFTs + + + + + Get started + + + + + + )} ) }