From a3103692d4d0653051419636934f0b5a70850652 Mon Sep 17 00:00:00 2001 From: Sashimi <93623541+sashimi36@users.noreply.github.com> Date: Sat, 27 Aug 2022 17:18:10 -0700 Subject: [PATCH] Don't include rewards tokens in the token list (#254) --- .../liquidity/components/LiquidityRewardsCard.tsx | 4 ++-- .../liquidity/components/ManageLiquidityCard.tsx | 10 ++-------- .../liquidity/components/UnderlyingAssetRow.tsx | 15 ++++++++------- hooks/useRewardsQueries.ts | 5 +++-- hooks/useTokenList.ts | 10 +--------- 5 files changed, 16 insertions(+), 28 deletions(-) diff --git a/features/liquidity/components/LiquidityRewardsCard.tsx b/features/liquidity/components/LiquidityRewardsCard.tsx index 728c77cc..1b287512 100644 --- a/features/liquidity/components/LiquidityRewardsCard.tsx +++ b/features/liquidity/components/LiquidityRewardsCard.tsx @@ -146,8 +146,8 @@ export const LiquidityRewardsCard = ({ ))} {pendingRewardsRenderedInline?.map(({ tokenInfo, tokenAmount }) => ( ))} diff --git a/features/liquidity/components/ManageLiquidityCard.tsx b/features/liquidity/components/ManageLiquidityCard.tsx index 123549f1..ee48861d 100644 --- a/features/liquidity/components/ManageLiquidityCard.tsx +++ b/features/liquidity/components/ManageLiquidityCard.tsx @@ -93,14 +93,8 @@ export const ManageLiquidityCard = ({ Underlying assets - - + + {didProvideLiquidity && ( diff --git a/features/liquidity/components/UnderlyingAssetRow.tsx b/features/liquidity/components/UnderlyingAssetRow.tsx index 4bce522d..c02b41f5 100644 --- a/features/liquidity/components/UnderlyingAssetRow.tsx +++ b/features/liquidity/components/UnderlyingAssetRow.tsx @@ -1,5 +1,4 @@ import { useTokenDollarValue } from 'hooks/useTokenDollarValue' -import { useTokenInfo } from 'hooks/useTokenInfo' import { Button, dollarValueFormatterWithDecimals, @@ -12,20 +11,22 @@ import { Tooltip, } from 'junoblocks' +import { TokenInfo } from '../../../queries/usePoolsListQuery' + type UnderlyingAssetRowProps = { - tokenSymbol?: string + tokenInfo?: TokenInfo tokenAmount?: number visible?: boolean } export const UnderlyingAssetRow = ({ - tokenSymbol, + tokenInfo, tokenAmount, visible = true, }: UnderlyingAssetRowProps) => { - const token = useTokenInfo(visible ? tokenSymbol : undefined) + const token = visible ? tokenInfo : undefined const [tokenDollarValue] = useTokenDollarValue( - visible ? tokenSymbol : undefined + visible ? tokenInfo?.symbol : undefined ) const tokenAmountDollarValue = dollarValueFormatterWithDecimals( @@ -46,14 +47,14 @@ export const UnderlyingAssetRow = ({ logoURI={token?.logoURI} alt={token?.symbol} /> - {tokenSymbol} + {token?.symbol} {formatTokenBalance(tokenAmount, { includeCommaSeparation: true })} - {tokenSymbol} + {token?.symbol}