Commit 06291a15 authored by vignesh mohankumar's avatar vignesh mohankumar Committed by GitHub

revert: removing phase0 bug fixes temporarily (#4886)

* Revert "fix: handle backspace out of /tokens (#4879)"

This reverts commit 3e40a6f5.

* Revert "fix: add padding-bottom to TokenDetailsLayout (#4882)"

This reverts commit f91b48e2.

* Revert "fix: updates outputCurrency link in mobile balance footer (#4885)"

This reverts commit e340f405.
parent 3e40a6f5
...@@ -82,8 +82,7 @@ export default function MobileBalanceSummaryFooter({ ...@@ -82,8 +82,7 @@ export default function MobileBalanceSummaryFooter({
tokenAmount, tokenAmount,
nativeCurrencyAmount, nativeCurrencyAmount,
isNative, isNative,
tokenAddress, }: BalanceSummaryProps) {
}: BalanceSummaryProps & { tokenAddress?: string }) {
const balanceUsdValue = useStablecoinValue(tokenAmount) const balanceUsdValue = useStablecoinValue(tokenAmount)
const nativeBalanceUsdValue = useStablecoinValue(nativeCurrencyAmount) const nativeBalanceUsdValue = useStablecoinValue(nativeCurrencyAmount)
...@@ -98,6 +97,8 @@ export default function MobileBalanceSummaryFooter({ ...@@ -98,6 +97,8 @@ export default function MobileBalanceSummaryFooter({
: undefined : undefined
const nativeBalanceUsd = nativeBalanceUsdValue ? currencyAmountToPreciseFloat(nativeBalanceUsdValue) : undefined const nativeBalanceUsd = nativeBalanceUsdValue ? currencyAmountToPreciseFloat(nativeBalanceUsdValue) : undefined
const outputTokenAddress = tokenAmount?.currency.address ?? nativeCurrencyAmount?.wrapped.currency.address
return ( return (
<Wrapper> <Wrapper>
{Boolean(formattedBalance !== undefined && !isNative && tokenAmount?.greaterThan(0)) && ( {Boolean(formattedBalance !== undefined && !isNative && tokenAmount?.greaterThan(0)) && (
...@@ -122,7 +123,7 @@ export default function MobileBalanceSummaryFooter({ ...@@ -122,7 +123,7 @@ export default function MobileBalanceSummaryFooter({
</BalanceTotal> </BalanceTotal>
</BalanceInfo> </BalanceInfo>
)} )}
<SwapButton to={`/swap?outputCurrency=${tokenAddress}`}> <SwapButton to={`/swap?outputCurrency=${outputTokenAddress}`}>
<Trans>Swap</Trans> <Trans>Swap</Trans>
</SwapButton> </SwapButton>
</Wrapper> </Wrapper>
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { useWeb3React } from '@web3-react/core'
import { chainIdToBackendName } from 'graphql/data/util'
import { X } from 'react-feather' import { X } from 'react-feather'
import { Link } from 'react-router-dom' import { Link, useNavigate } from 'react-router-dom'
import { useShowTokensPromoBanner } from 'state/user/hooks' import { useShowTokensPromoBanner } from 'state/user/hooks'
import styled, { useTheme } from 'styled-components/macro' import styled, { useTheme } from 'styled-components/macro'
import { opacify } from 'theme/utils' import { opacify } from 'theme/utils'
...@@ -9,10 +11,9 @@ import { Z_INDEX } from 'theme/zIndex' ...@@ -9,10 +11,9 @@ import { Z_INDEX } from 'theme/zIndex'
import tokensPromoDark from '../../assets/images/tokensPromoDark.png' import tokensPromoDark from '../../assets/images/tokensPromoDark.png'
import tokensPromoLight from '../../assets/images/tokensPromoLight.png' import tokensPromoLight from '../../assets/images/tokensPromoLight.png'
const PopupContainer = styled(Link)<{ show: boolean }>` const PopupContainer = styled.div<{ show: boolean }>`
position: fixed; position: fixed;
display: ${({ show }) => (show ? 'flex' : 'none')}; display: ${({ show }) => (show ? 'flex' : 'none')};
text-decoration: none;
flex-direction: column; flex-direction: column;
padding: 12px 16px 12px 20px; padding: 12px 16px 12px 20px;
gap: 8px; gap: 8px;
...@@ -42,31 +43,37 @@ const Header = styled.div` ...@@ -42,31 +43,37 @@ const Header = styled.div`
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
` `
const HeaderText = styled.span` const HeaderText = styled(Link)`
font-weight: 600; font-weight: 600;
font-size: 14px; font-size: 14px;
line-height: 20px; line-height: 20px;
text-decoration: none;
color: ${({ theme }) => theme.textPrimary};
` `
const Description = styled(Link)`
const Description = styled.span`
font-weight: 400; font-weight: 400;
font-size: 12px; font-size: 12px;
line-height: 16px; line-height: 16px;
width: 75%; width: 75%;
text-decoration: none;
color: ${({ theme }) => theme.textPrimary};
` `
export default function TokensBanner() { export default function TokensBanner() {
const theme = useTheme() const theme = useTheme()
const [showTokensPromoBanner, setShowTokensPromoBanner] = useShowTokensPromoBanner() const [showTokensPromoBanner, setShowTokensPromoBanner] = useShowTokensPromoBanner()
const navigate = useNavigate()
const { chainId: connectedChainId } = useWeb3React()
const chainName = chainIdToBackendName(connectedChainId).toLowerCase()
const closeBanner = () => { const navigateToExplorePage = () => {
setShowTokensPromoBanner(false) navigate(`/tokens/${chainName}`)
} }
return ( return (
<PopupContainer show={showTokensPromoBanner} to="/tokens" onClick={closeBanner}> <PopupContainer show={showTokensPromoBanner} onClick={navigateToExplorePage}>
<Header> <Header>
<HeaderText> <HeaderText to={'/tokens'}>
<Trans>Explore Top Tokens on Uniswap</Trans> <Trans>Explore Top Tokens on Uniswap</Trans>
</HeaderText> </HeaderText>
<X <X
...@@ -75,13 +82,13 @@ export default function TokensBanner() { ...@@ -75,13 +82,13 @@ export default function TokensBanner() {
onClick={(e) => { onClick={(e) => {
e.preventDefault() e.preventDefault()
e.stopPropagation() e.stopPropagation()
closeBanner() setShowTokensPromoBanner(false)
}} }}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
/> />
</Header> </Header>
<Description> <Description to={'/tokens'}>
<Trans>Sort and filter assets across networks on the new Tokens page.</Trans> <Trans>Sort and filter assets across networks on the new Tokens page.</Trans>
</Description> </Description>
</PopupContainer> </PopupContainer>
......
...@@ -33,7 +33,7 @@ const Hr = styled.hr` ...@@ -33,7 +33,7 @@ const Hr = styled.hr`
` `
export const TokenDetailsLayout = styled.div` export const TokenDetailsLayout = styled.div`
display: flex; display: flex;
padding: 0 8px 52px; padding: 0 8px;
justify-content: center; justify-content: center;
width: 100%; width: 100%;
...@@ -171,7 +171,6 @@ export default function TokenDetails() { ...@@ -171,7 +171,6 @@ export default function TokenDetails() {
<MobileBalanceSummaryFooter <MobileBalanceSummaryFooter
tokenAmount={tokenBalance} tokenAmount={tokenBalance}
tokenAddress={tokenQueryAddress}
nativeCurrencyAmount={nativeCurrencyBalance} nativeCurrencyAmount={nativeCurrencyBalance}
isNative={isNative} isNative={isNative}
/> />
......
...@@ -85,13 +85,13 @@ const Tokens = () => { ...@@ -85,13 +85,13 @@ const Tokens = () => {
useEffect(() => { useEffect(() => {
if (!chainNameParam) { if (!chainNameParam) {
navigate(`/tokens/${connectedChainName.toLowerCase()}`, { replace: true }) navigate(`/tokens/${connectedChainName.toLowerCase()}`)
} }
}, [chainNameParam, connectedChainName, navigate]) }, [chainNameParam, connectedChainName, navigate])
useOnGlobalChainSwitch((chain) => { useOnGlobalChainSwitch((chain) => {
if (isValidBackendChainName(chain)) { if (isValidBackendChainName(chain)) {
navigate(`/tokens/${chain.toLowerCase()}`, { replace: true }) navigate(`/tokens/${chain.toLowerCase()}`)
} }
}) })
......
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