Commit 7df53f30 authored by cartcrom's avatar cartcrom Committed by GitHub

feat: uniwallet banner (#6344)

* feat: update wallet banner display logic

* fix: linted

* fix: learn more link
parent 66497a01
...@@ -58,6 +58,5 @@ export function DownloadButton({ onClick, text = 'Download' }: { onClick?: () => ...@@ -58,6 +58,5 @@ export function DownloadButton({ onClick, text = 'Download' }: { onClick?: () =>
} }
export function LearnMoreButton() { export function LearnMoreButton() {
const navigate = useNavigate() return <BaseButton onClick={() => window.open('https://wallet.uniswap.org/', '_blank')}>Learn More</BaseButton>
return <BaseButton onClick={() => navigate('/wallet')}>Learn More</BaseButton>
} }
...@@ -3,8 +3,8 @@ import { useAccountDrawer } from 'components/AccountDrawer' ...@@ -3,8 +3,8 @@ import { useAccountDrawer } from 'components/AccountDrawer'
import { DownloadButton, LearnMoreButton } from 'components/AccountDrawer/DownloadButton' import { DownloadButton, LearnMoreButton } from 'components/AccountDrawer/DownloadButton'
import { AutoColumn } from 'components/Column' import { AutoColumn } from 'components/Column'
import Row, { RowBetween } from 'components/Row' import Row, { RowBetween } from 'components/Row'
import { useMgtmEnabled } from 'featureFlags/flags/mgtm'
import { X } from 'react-feather' import { X } from 'react-feather'
import { useLocation } from 'react-router-dom'
import { useHideUniswapWalletBanner } from 'state/user/hooks' import { useHideUniswapWalletBanner } from 'state/user/hooks'
import styled, { useTheme } from 'styled-components/macro' import styled, { useTheme } from 'styled-components/macro'
import { ThemedText } from 'theme' import { ThemedText } from 'theme'
...@@ -36,7 +36,7 @@ const PopupContainer = styled.div<{ show: boolean }>` ...@@ -36,7 +36,7 @@ const PopupContainer = styled.div<{ show: boolean }>`
}, },
}) => `${duration.slow} opacity ${timing.in}`}; }) => `${duration.slow} opacity ${timing.in}`};
width: 100%; width: 100%;
bottom: 56px; bottom: 52px;
height: 20%; height: 20%;
` `
...@@ -67,15 +67,11 @@ const StyledXButton = styled(X)` ...@@ -67,15 +67,11 @@ const StyledXButton = styled(X)`
export default function UniswapWalletBanner() { export default function UniswapWalletBanner() {
const [hideUniswapWalletBanner, toggleHideUniswapWalletBanner] = useHideUniswapWalletBanner() const [hideUniswapWalletBanner, toggleHideUniswapWalletBanner] = useHideUniswapWalletBanner()
const [walletDrawerOpen] = useAccountDrawer() const [walletDrawerOpen] = useAccountDrawer()
const mgtmEnabled = useMgtmEnabled()
const theme = useTheme() const theme = useTheme()
const { pathname } = useLocation() const shouldDisplay = Boolean(mgtmEnabled && !walletDrawerOpen && !hideUniswapWalletBanner && isIOS)
// hardcodeToFalse hardcodes the banner to never display, temporarily:
const hardcodeToFalse = false
const shouldDisplay = Boolean(
!walletDrawerOpen && !hideUniswapWalletBanner && isIOS && !pathname.startsWith('/wallet') && hardcodeToFalse
)
return ( return (
<PopupContainer show={shouldDisplay}> <PopupContainer show={shouldDisplay}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment