From 95604a19b155a9a725e5336f80bd0f3f19165c72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Such=C3=BD?= Date: Sat, 21 Sep 2024 12:01:37 +0200 Subject: [PATCH] fix(mobile): reflect token fiat value in account list (#14446) --- .../src/components/AccountListItem.tsx | 24 +++++++++++++++---- .../components/AccountListItemInteractive.tsx | 1 + 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/suite-native/accounts/src/components/AccountListItem.tsx b/suite-native/accounts/src/components/AccountListItem.tsx index eb3795885a7..9bc8088e695 100644 --- a/suite-native/accounts/src/components/AccountListItem.tsx +++ b/suite-native/accounts/src/components/AccountListItem.tsx @@ -6,7 +6,11 @@ import { useFormatters } from '@suite-common/formatters'; import { AccountsRootState, selectFormattedAccountType } from '@suite-common/wallet-core'; import { Account, AccountKey } from '@suite-common/wallet-types'; import { Badge, RoundedIcon } from '@suite-native/atoms'; -import { CryptoAmountFormatter, CryptoToFiatAmountFormatter } from '@suite-native/formatters'; +import { + CryptoAmountFormatter, + CryptoToFiatAmountFormatter, + FiatAmountFormatter, +} from '@suite-native/formatters'; import { Translation } from '@suite-native/intl'; import { isCoinWithTokens, @@ -19,6 +23,7 @@ import { AccountListItemBase } from './AccountListItemBase'; export type AccountListItemProps = { account: Account; + fiatBalance?: string | null; hideTokens?: boolean; onPress?: TouchableOpacityProps['onPress']; @@ -44,6 +49,7 @@ export const AccountListItem = ({ onPress, disabled, hideTokens = false, + fiatBalance, }: AccountListItemProps) => { const { accountLabel } = account; const { NetworkNameFormatter } = useFormatters(); @@ -80,10 +86,18 @@ export const AccountListItem = ({ } mainValue={ - + shouldShowTokenBadge && fiatBalance !== undefined ? ( + + ) : ( + + ) } secondaryValue={ onSelectAccount({ account,