Commit e340f405 authored by vignesh mohankumar's avatar vignesh mohankumar Committed by GitHub

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

parent 24fc39b0
......@@ -82,7 +82,8 @@ export default function MobileBalanceSummaryFooter({
tokenAmount,
nativeCurrencyAmount,
isNative,
}: BalanceSummaryProps) {
tokenAddress,
}: BalanceSummaryProps & { tokenAddress?: string }) {
const balanceUsdValue = useStablecoinValue(tokenAmount)
const nativeBalanceUsdValue = useStablecoinValue(nativeCurrencyAmount)
......@@ -97,8 +98,6 @@ export default function MobileBalanceSummaryFooter({
: undefined
const nativeBalanceUsd = nativeBalanceUsdValue ? currencyAmountToPreciseFloat(nativeBalanceUsdValue) : undefined
const outputTokenAddress = tokenAmount?.currency.address ?? nativeCurrencyAmount?.wrapped.currency.address
return (
<Wrapper>
{Boolean(formattedBalance !== undefined && !isNative && tokenAmount?.greaterThan(0)) && (
......@@ -123,7 +122,7 @@ export default function MobileBalanceSummaryFooter({
</BalanceTotal>
</BalanceInfo>
)}
<SwapButton to={`/swap?outputCurrency=${outputTokenAddress}`}>
<SwapButton to={`/swap?outputCurrency=${tokenAddress}`}>
<Trans>Swap</Trans>
</SwapButton>
</Wrapper>
......
......@@ -171,6 +171,7 @@ export default function TokenDetails() {
<MobileBalanceSummaryFooter
tokenAmount={tokenBalance}
tokenAddress={tokenQueryAddress}
nativeCurrencyAmount={nativeCurrencyBalance}
isNative={isNative}
/>
......
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