Commit 1b351280 authored by Noah Zinsmeister's avatar Noah Zinsmeister

clarify migrate ui

parent 1e5519de
...@@ -113,7 +113,7 @@ function V2PairMigration({ ...@@ -113,7 +113,7 @@ function V2PairMigration({
const theme = useTheme() const theme = useTheme()
const pairFactory = useSingleCallResult(pair, 'factory') const pairFactory = useSingleCallResult(pair, 'factory')
const isNotUniswap = pairFactory.result?.[0] !== FACTORY_ADDRESS const isNotUniswap = pairFactory.result?.[0] !== FACTORY_ADDRESS ?? false
const deadline = useTransactionDeadline() // custom from users settings const deadline = useTransactionDeadline() // custom from users settings
const blockTimestamp = useCurrentBlockTimestamp() const blockTimestamp = useCurrentBlockTimestamp()
...@@ -218,12 +218,12 @@ function V2PairMigration({ ...@@ -218,12 +218,12 @@ function V2PairMigration({
) )
const refund0 = useMemo( const refund0 = useMemo(
() => v3Amount0Min && new TokenAmount(token0, JSBI.subtract(token0Value.raw, v3Amount0Min.raw)), () => position && new TokenAmount(token0, JSBI.subtract(token0Value.raw, position.amount0.raw)),
[token0Value, v3Amount0Min, token0] [token0Value, position, token0]
) )
const refund1 = useMemo( const refund1 = useMemo(
() => v3Amount1Min && new TokenAmount(token1, JSBI.subtract(token1Value.raw, v3Amount1Min.raw)), () => position && new TokenAmount(token1, JSBI.subtract(token1Value.raw, position.amount1.raw)),
[token1Value, v3Amount1Min, token1] [token1Value, position, token1]
) )
const [confirmingMigration, setConfirmingMigration] = useState<boolean>(false) const [confirmingMigration, setConfirmingMigration] = useState<boolean>(false)
...@@ -516,13 +516,13 @@ function V2PairMigration({ ...@@ -516,13 +516,13 @@ function V2PairMigration({
</YellowCard> </YellowCard>
) : null} ) : null}
{v3Amount0Min && v3Amount1Min ? ( {position ? (
<DarkGreyCard> <DarkGreyCard>
<AutoColumn gap="md"> <AutoColumn gap="md">
<LiquidityInfo token0Amount={v3Amount0Min} token1Amount={v3Amount1Min} /> <LiquidityInfo token0Amount={position.amount0} token1Amount={position.amount1} />
{chainId && refund0 && refund1 ? ( {chainId && refund0 && refund1 ? (
<TYPE.black fontSize={12}> <TYPE.black fontSize={12}>
{formatTokenAmount(refund0, 4)} {token0.equals(WETH9[chainId]) ? 'ETH' : token0.symbol} and{' '} At least {formatTokenAmount(refund0, 4)} {token0.equals(WETH9[chainId]) ? 'ETH' : token0.symbol} and{' '}
{formatTokenAmount(refund1, 4)} {token1.equals(WETH9[chainId]) ? 'ETH' : token1.symbol} will be {formatTokenAmount(refund1, 4)} {token1.equals(WETH9[chainId]) ? 'ETH' : token1.symbol} will be
refunded to your wallet due to selected price range. refunded to your wallet due to selected price range.
</TYPE.black> </TYPE.black>
......
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