From 1baacb6bb7c557bc43266d5ab9bcec9b1222b267 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Thu, 21 Nov 2024 14:23:11 +0100 Subject: [PATCH 1/2] fix: fix display amount when price checker off --- .../app/wallet-overview/coin-overview.tsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ui/components/app/wallet-overview/coin-overview.tsx b/ui/components/app/wallet-overview/coin-overview.tsx index 93d9e1061428..20d232294836 100644 --- a/ui/components/app/wallet-overview/coin-overview.tsx +++ b/ui/components/app/wallet-overview/coin-overview.tsx @@ -60,7 +60,10 @@ import { import Spinner from '../../ui/spinner'; import { PercentageAndAmountChange } from '../../multichain/token-list-item/price/percentage-and-amount-change/percentage-and-amount-change'; -import { getMultichainIsEvm } from '../../../selectors/multichain'; +import { + getMultichainIsEvm, + getMultichainShouldShowFiat, +} from '../../../selectors/multichain'; import { useAccountTotalFiatBalance } from '../../../hooks/useAccountTotalFiatBalance'; import { setAggregatedBalancePopoverShown, @@ -72,6 +75,7 @@ import { useI18nContext } from '../../../hooks/useI18nContext'; import WalletOverview from './wallet-overview'; import CoinButtons from './coin-buttons'; import { AggregatedPercentageOverview } from './aggregated-percentage-overview'; +import { useMultichainSelector } from '../../../hooks/useMultichainSelector'; export type CoinOverviewProps = { balance: string; @@ -144,9 +148,14 @@ export const CoinOverview = ({ shouldHideZeroBalanceTokens, ); + const shouldShowFiat = useMultichainSelector( + getMultichainShouldShowFiat, + account, + ); + const isEvm = useSelector(getMultichainIsEvm); const isNotAggregatedFiatBalance = - showNativeTokenAsMainBalance || isTestnet || !isEvm; + !shouldShowFiat || showNativeTokenAsMainBalance || isTestnet || !isEvm; let balanceToDisplay; if (isNotAggregatedFiatBalance) { balanceToDisplay = balance; @@ -278,7 +287,9 @@ export const CoinOverview = ({ hideTitle shouldCheckShowNativeToken isAggregatedFiatOverviewBalance={ - !showNativeTokenAsMainBalance && !isTestnet + !showNativeTokenAsMainBalance && + !isTestnet && + shouldShowFiat } privacyMode={privacyMode} /> From 8b1240ee5be713ca87f5cef39513c5086f3cf10d Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Thu, 21 Nov 2024 14:48:46 +0100 Subject: [PATCH 2/2] fix: lint --- ui/components/app/wallet-overview/coin-overview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/components/app/wallet-overview/coin-overview.tsx b/ui/components/app/wallet-overview/coin-overview.tsx index 20d232294836..18628c2be7ec 100644 --- a/ui/components/app/wallet-overview/coin-overview.tsx +++ b/ui/components/app/wallet-overview/coin-overview.tsx @@ -72,10 +72,10 @@ import { import { useTheme } from '../../../hooks/useTheme'; import { getSpecificSettingsRoute } from '../../../helpers/utils/settings-search'; import { useI18nContext } from '../../../hooks/useI18nContext'; +import { useMultichainSelector } from '../../../hooks/useMultichainSelector'; import WalletOverview from './wallet-overview'; import CoinButtons from './coin-buttons'; import { AggregatedPercentageOverview } from './aggregated-percentage-overview'; -import { useMultichainSelector } from '../../../hooks/useMultichainSelector'; export type CoinOverviewProps = { balance: string;