Commit 37cf492d authored by Yuta Sugimura's avatar Yuta Sugimura Committed by GitHub

fix: Add SwitchLocaleLink to a page where it does not exist (#1867)

parent 9e93f809
...@@ -55,6 +55,7 @@ import RateToggle from 'components/RateToggle' ...@@ -55,6 +55,7 @@ import RateToggle from 'components/RateToggle'
import { BigNumber } from '@ethersproject/bignumber' import { BigNumber } from '@ethersproject/bignumber'
import { AddRemoveTabs } from 'components/NavigationTabs' import { AddRemoveTabs } from 'components/NavigationTabs'
import HoverInlineText from 'components/HoverInlineText' import HoverInlineText from 'components/HoverInlineText'
import { SwitchLocaleLink } from 'components/SwitchLocaleLink'
const DEFAULT_ADD_IN_RANGE_SLIPPAGE_TOLERANCE = new Percent(50, 10_000) const DEFAULT_ADD_IN_RANGE_SLIPPAGE_TOLERANCE = new Percent(50, 10_000)
...@@ -385,6 +386,7 @@ export default function AddLiquidity({ ...@@ -385,6 +386,7 @@ export default function AddLiquidity({
!argentWalletContract && approvalB !== ApprovalState.APPROVED && !!parsedAmounts[Field.CURRENCY_B] !argentWalletContract && approvalB !== ApprovalState.APPROVED && !!parsedAmounts[Field.CURRENCY_B]
return ( return (
<>
<ScrollablePage> <ScrollablePage>
<TransactionConfirmationModal <TransactionConfirmationModal
isOpen={showConfirm} isOpen={showConfirm}
...@@ -562,7 +564,10 @@ export default function AddLiquidity({ ...@@ -562,7 +564,10 @@ export default function AddLiquidity({
</DynamicSection> </DynamicSection>
)} )}
<DynamicSection gap="md" disabled={!feeAmount || invalidPool || (noLiquidity && !startPriceTypedValue)}> <DynamicSection
gap="md"
disabled={!feeAmount || invalidPool || (noLiquidity && !startPriceTypedValue)}
>
<RowBetween> <RowBetween>
<TYPE.label> <TYPE.label>
<Trans>Set Price Range</Trans> <Trans>Set Price Range</Trans>
...@@ -576,7 +581,9 @@ export default function AddLiquidity({ ...@@ -576,7 +581,9 @@ export default function AddLiquidity({
onLeftRangeInput('') onLeftRangeInput('')
onRightRangeInput('') onRightRangeInput('')
history.push( history.push(
`/add/${currencyIdB as string}/${currencyIdA as string}${feeAmount ? '/' + feeAmount : ''}` `/add/${currencyIdB as string}/${currencyIdA as string}${
feeAmount ? '/' + feeAmount : ''
}`
) )
}} }}
/> />
...@@ -635,8 +642,8 @@ export default function AddLiquidity({ ...@@ -635,8 +642,8 @@ export default function AddLiquidity({
<AlertTriangle stroke={theme.yellow3} size="16px" /> <AlertTriangle stroke={theme.yellow3} size="16px" />
<TYPE.yellow ml="12px" fontSize="12px"> <TYPE.yellow ml="12px" fontSize="12px">
<Trans> <Trans>
Your position will not earn fees or be used in trades until the market price moves into your Your position will not earn fees or be used in trades until the market price moves into
range. your range.
</Trans> </Trans>
</TYPE.yellow> </TYPE.yellow>
</RowBetween> </RowBetween>
...@@ -773,5 +780,7 @@ export default function AddLiquidity({ ...@@ -773,5 +780,7 @@ export default function AddLiquidity({
/> />
)} )}
</ScrollablePage> </ScrollablePage>
<SwitchLocaleLink />
</>
) )
} }
...@@ -42,6 +42,7 @@ import { ConfirmAddModalBottom } from './ConfirmAddModalBottom' ...@@ -42,6 +42,7 @@ import { ConfirmAddModalBottom } from './ConfirmAddModalBottom'
import { currencyId } from '../../utils/currencyId' import { currencyId } from '../../utils/currencyId'
import { PoolPriceBar } from './PoolPriceBar' import { PoolPriceBar } from './PoolPriceBar'
import UnsupportedCurrencyFooter from 'components/swap/UnsupportedCurrencyFooter' import UnsupportedCurrencyFooter from 'components/swap/UnsupportedCurrencyFooter'
import { SwitchLocaleLink } from 'components/SwitchLocaleLink'
import { t, Trans } from '@lingui/macro' import { t, Trans } from '@lingui/macro'
const DEFAULT_ADD_V2_SLIPPAGE_TOLERANCE = new Percent(50, 10_000) const DEFAULT_ADD_V2_SLIPPAGE_TOLERANCE = new Percent(50, 10_000)
...@@ -485,6 +486,8 @@ export default function AddLiquidity({ ...@@ -485,6 +486,8 @@ export default function AddLiquidity({
</AutoColumn> </AutoColumn>
</Wrapper> </Wrapper>
</AppBody> </AppBody>
<SwitchLocaleLink />
{!addIsUnsupported ? ( {!addIsUnsupported ? (
pair && !noLiquidity && pairState !== PairState.INVALID ? ( pair && !noLiquidity && pairState !== PairState.INVALID ? (
<AutoColumn style={{ minWidth: '20rem', width: '100%', maxWidth: '400px', marginTop: '1rem' }}> <AutoColumn style={{ minWidth: '20rem', width: '100%', maxWidth: '400px', marginTop: '1rem' }}>
......
...@@ -16,6 +16,7 @@ import { Dots } from '../../components/swap/styleds' ...@@ -16,6 +16,7 @@ import { Dots } from '../../components/swap/styleds'
import { toV2LiquidityToken, useTrackedTokenPairs } from '../../state/user/hooks' import { toV2LiquidityToken, useTrackedTokenPairs } from '../../state/user/hooks'
import MigrateV2PositionCard from 'components/PositionCard/V2' import MigrateV2PositionCard from 'components/PositionCard/V2'
import MigrateSushiPositionCard from 'components/PositionCard/Sushi' import MigrateSushiPositionCard from 'components/PositionCard/Sushi'
import { SwitchLocaleLink } from 'components/SwitchLocaleLink'
import { PairState, useV2Pairs } from 'hooks/useV2Pairs' import { PairState, useV2Pairs } from 'hooks/useV2Pairs'
import { getCreate2Address } from '@ethersproject/address' import { getCreate2Address } from '@ethersproject/address'
import { pack, keccak256 } from '@ethersproject/solidity' import { pack, keccak256 } from '@ethersproject/solidity'
...@@ -110,6 +111,7 @@ export default function MigrateV2() { ...@@ -110,6 +111,7 @@ export default function MigrateV2() {
const v2IsLoading = fetchingPairBalances || v2Pairs.some(([pairState]) => pairState === PairState.LOADING) const v2IsLoading = fetchingPairBalances || v2Pairs.some(([pairState]) => pairState === PairState.LOADING)
return ( return (
<>
<BodyWrapper style={{ padding: 24 }}> <BodyWrapper style={{ padding: 24 }}>
<AutoColumn gap="16px"> <AutoColumn gap="16px">
<AutoRow style={{ alignItems: 'center', justifyContent: 'space-between' }} gap="8px"> <AutoRow style={{ alignItems: 'center', justifyContent: 'space-between' }} gap="8px">
...@@ -178,5 +180,7 @@ export default function MigrateV2() { ...@@ -178,5 +180,7 @@ export default function MigrateV2() {
</AutoColumn> </AutoColumn>
</AutoColumn> </AutoColumn>
</BodyWrapper> </BodyWrapper>
<SwitchLocaleLink />
</>
) )
} }
...@@ -37,6 +37,7 @@ import useTheme from '../../hooks/useTheme' ...@@ -37,6 +37,7 @@ import useTheme from '../../hooks/useTheme'
import RateToggle from '../../components/RateToggle' import RateToggle from '../../components/RateToggle'
import { useSingleCallResult } from 'state/multicall/hooks' import { useSingleCallResult } from 'state/multicall/hooks'
import RangeBadge from '../../components/Badge/RangeBadge' import RangeBadge from '../../components/Badge/RangeBadge'
import { SwitchLocaleLink } from '../../components/SwitchLocaleLink'
import useUSDCPrice from 'hooks/useUSDCPrice' import useUSDCPrice from 'hooks/useUSDCPrice'
import Loader from 'components/Loader' import Loader from 'components/Loader'
import Toggle from 'components/Toggle' import Toggle from 'components/Toggle'
...@@ -495,6 +496,7 @@ export function PositionPage({ ...@@ -495,6 +496,7 @@ export function PositionPage({
<div /> <div />
</LoadingRows> </LoadingRows>
) : ( ) : (
<>
<PageWrapper> <PageWrapper>
<TransactionConfirmationModal <TransactionConfirmationModal
isOpen={showConfirm} isOpen={showConfirm}
...@@ -828,5 +830,7 @@ export function PositionPage({ ...@@ -828,5 +830,7 @@ export function PositionPage({
</DarkCard> </DarkCard>
</AutoColumn> </AutoColumn>
</PageWrapper> </PageWrapper>
<SwitchLocaleLink />
</>
) )
} }
...@@ -19,6 +19,7 @@ import { useV2Pairs } from '../../hooks/useV2Pairs' ...@@ -19,6 +19,7 @@ import { useV2Pairs } from '../../hooks/useV2Pairs'
import { toV2LiquidityToken, useTrackedTokenPairs } from '../../state/user/hooks' import { toV2LiquidityToken, useTrackedTokenPairs } from '../../state/user/hooks'
import { Dots } from '../../components/swap/styleds' import { Dots } from '../../components/swap/styleds'
import { CardSection, DataCard, CardNoise, CardBGImage } from '../../components/earn/styled' import { CardSection, DataCard, CardNoise, CardBGImage } from '../../components/earn/styled'
import { SwitchLocaleLink } from '../../components/SwitchLocaleLink'
import { useStakingInfo } from '../../state/stake/hooks' import { useStakingInfo } from '../../state/stake/hooks'
import { BIG_INT_ZERO } from '../../constants/misc' import { BIG_INT_ZERO } from '../../constants/misc'
import { Pair } from '@uniswap/v2-sdk' import { Pair } from '@uniswap/v2-sdk'
...@@ -256,6 +257,7 @@ export default function Pool() { ...@@ -256,6 +257,7 @@ export default function Pool() {
</AutoColumn> </AutoColumn>
</AutoColumn> </AutoColumn>
</PageWrapper> </PageWrapper>
<SwitchLocaleLink />
</> </>
) )
} }
...@@ -11,6 +11,7 @@ import { FindPoolTabs } from '../../components/NavigationTabs' ...@@ -11,6 +11,7 @@ import { FindPoolTabs } from '../../components/NavigationTabs'
import { MinimalPositionCard } from '../../components/PositionCard' import { MinimalPositionCard } from '../../components/PositionCard'
import Row from '../../components/Row' import Row from '../../components/Row'
import CurrencySearchModal from '../../components/SearchModal/CurrencySearchModal' import CurrencySearchModal from '../../components/SearchModal/CurrencySearchModal'
import { SwitchLocaleLink } from '../../components/SwitchLocaleLink'
import { ExtendedEther } from '../../constants/tokens' import { ExtendedEther } from '../../constants/tokens'
import { PairState, useV2Pair } from '../../hooks/useV2Pairs' import { PairState, useV2Pair } from '../../hooks/useV2Pairs'
import { useActiveWeb3React } from '../../hooks/web3' import { useActiveWeb3React } from '../../hooks/web3'
...@@ -93,6 +94,7 @@ export default function PoolFinder() { ...@@ -93,6 +94,7 @@ export default function PoolFinder() {
) )
return ( return (
<>
<AppBody> <AppBody>
<FindPoolTabs origin={query.get('origin') ?? '/pool/v2'} /> <FindPoolTabs origin={query.get('origin') ?? '/pool/v2'} />
<AutoColumn style={{ padding: '1rem' }} gap="md"> <AutoColumn style={{ padding: '1rem' }} gap="md">
...@@ -224,5 +226,7 @@ export default function PoolFinder() { ...@@ -224,5 +226,7 @@ export default function PoolFinder() {
selectedCurrency={(activeField === Fields.TOKEN0 ? currency1 : currency0) ?? undefined} selectedCurrency={(activeField === Fields.TOKEN0 ? currency1 : currency0) ?? undefined}
/> />
</AppBody> </AppBody>
<SwitchLocaleLink />
</>
) )
} }
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