From fb9147a40e8199e9993892446d3ed023873f4ebd Mon Sep 17 00:00:00 2001 From: yushi Date: Fri, 27 Sep 2024 01:46:38 +0800 Subject: [PATCH 1/2] always show total ADA amount in wallet list --- .../app/components/topbar/WalletListDialog.js | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/packages/yoroi-extension/app/components/topbar/WalletListDialog.js b/packages/yoroi-extension/app/components/topbar/WalletListDialog.js index 580034cd94..f39f2740aa 100644 --- a/packages/yoroi-extension/app/components/topbar/WalletListDialog.js +++ b/packages/yoroi-extension/app/components/topbar/WalletListDialog.js @@ -19,7 +19,7 @@ import DialogCloseButton from '../widgets/DialogCloseButton'; import styles from './WalletListDialog.scss'; import WalletCard from './WalletCard'; import globalMessages from '../../i18n/global-messages'; -import AmountDisplay, { FiatDisplay } from '../common/AmountDisplay'; +import AmountDisplay from '../common/AmountDisplay'; import type { WalletType } from '../../../chrome/extension/background/types'; import type { WalletChecksum } from '@emurgo/cip4-js'; import { Typography, styled } from '@mui/material'; @@ -293,27 +293,16 @@ export default class WalletListDialog extends Component { renderWalletsTotal(): ?Node { const { unitOfAccountSetting, cardanoWallets, shouldHideBalance, getCurrentPrice } = this.props; - if (unitOfAccountSetting.enabled) { - const adaFiat = this.sumWallets(cardanoWallets).fiat; - if (adaFiat != null) { - const totalFiat = adaFiat; - const { currency } = unitOfAccountSetting; - return ; - } - } - // either unit of account is not enabled, or fails to convert to fiat - const amount = this.sumWallets(cardanoWallets).sum; - const totalAmountId = `changeWalletDialog:total`; return ( ); } From 9253da25dab490481cc527548f891fe36e5d1b18 Mon Sep 17 00:00:00 2001 From: Denis Nebytov Date: Fri, 27 Sep 2024 11:39:58 +0300 Subject: [PATCH 2/2] fix for YOEXT-1220 --- .../app/components/common/AmountDisplay.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/yoroi-extension/app/components/common/AmountDisplay.js b/packages/yoroi-extension/app/components/common/AmountDisplay.js index 0597c5ba81..df7aade6b6 100644 --- a/packages/yoroi-extension/app/components/common/AmountDisplay.js +++ b/packages/yoroi-extension/app/components/common/AmountDisplay.js @@ -47,11 +47,7 @@ export default class AmountDisplay extends Component { if (shouldHideBalance) { balanceDisplay = {hiddenAmount}; - fiatDisplay = ( - - {hiddenAmount} {currency} - - ); + fiatDisplay = {hiddenAmount}; } else { const shiftedAmount = defaultEntry.amount.shiftedBy(-tokenInfo.Metadata.numberOfDecimals); @@ -90,7 +86,7 @@ export default class AmountDisplay extends Component { )} {showFiat === true && ( - {fiatDisplay || '-'} {currency || 'USD'} + {fiatDisplay || '-'} {currency || 'USD'} )}