diff --git a/src/components/YieldPools/ElasticFarmGroup/FarmCard.tsx b/src/components/YieldPools/ElasticFarmGroup/FarmCard.tsx index da59ae8b83..119ecd2f3c 100644 --- a/src/components/YieldPools/ElasticFarmGroup/FarmCard.tsx +++ b/src/components/YieldPools/ElasticFarmGroup/FarmCard.tsx @@ -109,12 +109,12 @@ const FarmCard = ({ const token0Symbol = getTokenSymbolWithHardcode( chainId, pool?.token0?.wrapped?.address, - pool.token0.isNative ? pool.token0.symbol : allTokens[pool.token0.wrapped.address].symbol, + pool.token0.isNative ? pool.token0.symbol : allTokens[pool.token0.wrapped.address]?.symbol || pool.token0.symbol, ) const token1Symbol = getTokenSymbolWithHardcode( chainId, pool?.token1?.wrapped?.address, - pool.token1.isNative ? pool.token1.symbol : allTokens[pool.token1.wrapped.address].symbol, + pool.token1.isNative ? pool.token1.symbol : allTokens[pool.token1.wrapped.address]?.symbol || pool.token1.symbol, ) return ( diff --git a/src/components/YieldPools/ElasticFarmGroup/Row.tsx b/src/components/YieldPools/ElasticFarmGroup/Row.tsx index 1141ed3295..1cf7af8ec4 100644 --- a/src/components/YieldPools/ElasticFarmGroup/Row.tsx +++ b/src/components/YieldPools/ElasticFarmGroup/Row.tsx @@ -311,12 +311,16 @@ const Row = ({ const symbol0 = getTokenSymbolWithHardcode( chainId, farmingPool.token0.wrapped.address, - farmingPool.token0.isNative ? farmingPool.token0.symbol : allTokens[farmingPool.token0.wrapped.address].symbol, + farmingPool.token0.isNative + ? farmingPool.token0.symbol + : allTokens[farmingPool.token0.wrapped.address]?.symbol || farmingPool.token0.symbol, ) const symbol1 = getTokenSymbolWithHardcode( chainId, farmingPool.token1.wrapped.address, - farmingPool.token1.isNative ? farmingPool.token1.symbol : allTokens[farmingPool.token1.wrapped.address].symbol, + farmingPool.token1.isNative + ? farmingPool.token1.symbol + : allTokens[farmingPool.token1.wrapped.address]?.symbol || farmingPool.token1.symbol, ) return ( diff --git a/src/pages/Farm/ElasticFarmv2/components/FarmCard.tsx b/src/pages/Farm/ElasticFarmv2/components/FarmCard.tsx index 3de0fdcf6c..8466f71570 100644 --- a/src/pages/Farm/ElasticFarmv2/components/FarmCard.tsx +++ b/src/pages/Farm/ElasticFarmv2/components/FarmCard.tsx @@ -29,6 +29,7 @@ import { APRTooltipContent } from 'components/YieldPools/FarmingPoolAPRCell' import { PartnerFarmTag } from 'components/YieldPools/PartnerFarmTag' import { APP_PATHS, ELASTIC_BASE_FEE_UNIT } from 'constants/index' import { useActiveWeb3React } from 'hooks' +import { useAllTokens } from 'hooks/Tokens' import useTheme from 'hooks/useTheme' import { useShareFarmAddress } from 'state/farms/classic/hooks' import { useFarmV2Action, useUserFarmV2Info } from 'state/farms/elasticv2/hooks' @@ -208,6 +209,8 @@ function FarmCard({ const range = farm.ranges.find(range => range.index === activeRangeIndex) + const allTokens = useAllTokens() + return ( <> @@ -221,8 +224,21 @@ function FarmCard({ }} > - {getTokenSymbolWithHardcode(chainId, farm.token0.wrapped.address, farm.token0.symbol)} -{' '} - {getTokenSymbolWithHardcode(chainId, farm.token1.wrapped.address, farm.token1.symbol)} + {getTokenSymbolWithHardcode( + chainId, + farm.token0.wrapped.address, + farm.token0.isNative + ? farm.token0.symbol + : allTokens[farm.token0.address]?.symbol || farm.token0.symbol, + )}{' '} + -{' '} + {getTokenSymbolWithHardcode( + chainId, + farm.token1.wrapped.address, + farm.token1.isNative + ? farm.token1.symbol + : allTokens[farm.token1.address]?.symbol || farm.token1.symbol, + )} diff --git a/src/pages/Farm/ElasticFarmv2/components/ListView.tsx b/src/pages/Farm/ElasticFarmv2/components/ListView.tsx index a4058de4cc..5596654067 100644 --- a/src/pages/Farm/ElasticFarmv2/components/ListView.tsx +++ b/src/pages/Farm/ElasticFarmv2/components/ListView.tsx @@ -27,6 +27,7 @@ import { PartnerFarmTag } from 'components/YieldPools/PartnerFarmTag' import { ElasticFarmV2TableRow } from 'components/YieldPools/styleds' import { APP_PATHS, ELASTIC_BASE_FEE_UNIT } from 'constants/index' import { useActiveWeb3React } from 'hooks' +import { useAllTokens } from 'hooks/Tokens' import useTheme from 'hooks/useTheme' import { useShareFarmAddress } from 'state/farms/classic/hooks' import { useFarmV2Action, useUserFarmV2Info } from 'state/farms/elasticv2/hooks' @@ -114,6 +115,8 @@ export const ListView = ({ const [errorMessage, setErrorMessage] = useState('') const [attemptingTxn, setAttemptingTxn] = useState(false) + const allTokens = useAllTokens() + const handleDismiss = () => { setTxHash('') setShowConfirmModal(false) @@ -173,8 +176,21 @@ export const ListView = ({ }} > - {getTokenSymbolWithHardcode(chainId, farm.token0.wrapped.address, farm.token0.symbol)} -{' '} - {getTokenSymbolWithHardcode(chainId, farm.token1.wrapped.address, farm.token1.symbol)} + {getTokenSymbolWithHardcode( + chainId, + farm.token0.wrapped.address, + farm.token0.isNative + ? farm.token0.symbol + : allTokens[farm.token0.address]?.symbol || farm.token0.symbol, + )}{' '} + -{' '} + {getTokenSymbolWithHardcode( + chainId, + farm.token1.wrapped.address, + farm.token1.isNative + ? farm.token1.symbol + : allTokens[farm.token1.address]?.symbol || farm.token1.symbol, + )}