Skip to content

Commit 9f5d624

Browse files
committed
fix: solved issue on tokenIcons in reserve-overview page
1 parent c4d503f commit 9f5d624

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/modules/reserve-overview/ReserveTopDetailsWrapper.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { useState } from 'react';
1515
import { getMarketInfoById, MarketLogo } from 'src/components/MarketSwitcher';
1616
import { useWeb3Context } from 'src/libs/hooks/useWeb3Context';
1717
import { useRootStore } from 'src/store/root';
18+
import { fetchIconSymbolAndName } from 'src/ui-config/reservePatches';
1819
import { displayGhoForMintableMarket } from 'src/utils/ghoUtilities';
1920
import { useShallow } from 'zustand/shallow';
2021

@@ -50,10 +51,18 @@ export const ReserveTopDetailsWrapper = ({ underlyingAsset }: ReserveTopDetailsP
5051
const poolReserve = supplyReserves.find(
5152
(reserve) => reserve.underlyingToken.address.toLowerCase() === underlyingAsset?.toLowerCase()
5253
);
54+
const { iconSymbol } = fetchIconSymbolAndName({
55+
underlyingAsset: poolReserve!.underlyingToken.address,
56+
symbol: poolReserve!.underlyingToken.symbol,
57+
name: poolReserve!.underlyingToken.name,
58+
});
5359

54-
const [tokenSymbol, setTokenSymbol] = useState(
55-
poolReserve?.underlyingToken.symbol.toLowerCase() ?? 'default'
56-
);
60+
const displayIconSymbol =
61+
iconSymbol?.toLowerCase() !== poolReserve!.underlyingToken.symbol.toLowerCase()
62+
? iconSymbol
63+
: poolReserve!.underlyingToken.symbol;
64+
65+
const [tokenSymbol, setTokenSymbol] = useState(displayIconSymbol);
5766

5867
if (!poolReserve) {
5968
return null;

0 commit comments

Comments
 (0)