From 9b872b1e101349451678e007c0fee7562f3c2942 Mon Sep 17 00:00:00 2001 From: Kurt Date: Wed, 5 Jun 2024 16:49:05 +0200 Subject: [PATCH] fix token symbol (#3489) --- .../src/features/round/ViewRoundPage.tsx | 31 +++---------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/packages/grant-explorer/src/features/round/ViewRoundPage.tsx b/packages/grant-explorer/src/features/round/ViewRoundPage.tsx index 756ddcd5d..0191729b2 100644 --- a/packages/grant-explorer/src/features/round/ViewRoundPage.tsx +++ b/packages/grant-explorer/src/features/round/ViewRoundPage.tsx @@ -73,28 +73,6 @@ import { import { Box, Tab, Tabs } from "@chakra-ui/react"; import GenericModal from "../common/GenericModal"; -const defaultVotingTokens: Record = Object.entries( - getTokens() -).reduce( - (acc, [chainId, tokens]) => { - const votingToken = tokens.find((token) => token.canVote); - if (votingToken) { - acc[Number(chainId)] = votingToken; - } - return acc; - }, - {} as Record -); - -const nativePayoutToken: TToken | undefined = Object.entries( - defaultVotingTokens -).find(([chainId, token]) => { - return ( - Number(chainId) === Number(chainId) && - token.address === getAddress(token.address) - ); -})?.[1]; - export default function ViewRound() { datadogLogs.logger.info("====> Route: /round/:chainId/:roundId"); datadogLogs.logger.info(`====> URL: ${window.location.href}`); @@ -1244,10 +1222,9 @@ function PreRoundPage(props: { chainId: Number(chainId), }); - const tokenData = data ?? { - ...nativePayoutToken, - symbol: nativePayoutToken?.code ?? "ETH", - }; + const tokenData = getTokensByChainId(Number(chainId)).find( + (t) => t.address.toLowerCase() === props.round.token.toLowerCase() + ); return (
@@ -1329,7 +1306,7 @@ function PreRoundPage(props: {   {round.roundMetadata?.quadraticFundingConfig?.matchingFundsAvailable.toLocaleString()}   - {tokenData?.symbol ?? "..."} + {tokenData?.code ?? "..."}