From 425ec6228cc1848f170fbf2157b12c6857054be3 Mon Sep 17 00:00:00 2001 From: Thomas Huang Date: Wed, 27 Jan 2021 22:44:04 -0800 Subject: [PATCH] Use nativeCurrency in the confirm approve screen (#10298) Gets nativeCurrency from state and uses in place of the previously hardcoded ETH value in the confirm approve component. --- .../confirm-approve-content.component.js | 4 +++- ui/app/pages/confirm-approve/confirm-approve.js | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ui/app/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js b/ui/app/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js index 5486776b7..78fe41fe7 100644 --- a/ui/app/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js +++ b/ui/app/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js @@ -24,6 +24,7 @@ export default class ConfirmApproveContent extends Component { data: PropTypes.string, toAddress: PropTypes.string, currentCurrency: PropTypes.string, + nativeCurrency: PropTypes.string, fiatTransactionTotal: PropTypes.string, ethTransactionTotal: PropTypes.string, } @@ -75,6 +76,7 @@ export default class ConfirmApproveContent extends Component { const { t } = this.context const { currentCurrency, + nativeCurrency, ethTransactionTotal, fiatTransactionTotal, } = this.props @@ -88,7 +90,7 @@ export default class ConfirmApproveContent extends Component { {formatCurrency(fiatTransactionTotal, currentCurrency)}
- {`${ethTransactionTotal} ETH`} + {`${ethTransactionTotal} ${nativeCurrency}`}
diff --git a/ui/app/pages/confirm-approve/confirm-approve.js b/ui/app/pages/confirm-approve/confirm-approve.js index e1109c473..9b8d7abde 100644 --- a/ui/app/pages/confirm-approve/confirm-approve.js +++ b/ui/app/pages/confirm-approve/confirm-approve.js @@ -14,11 +14,10 @@ import { getTokens } from '../../ducks/metamask/metamask' import { transactionFeeSelector, txDataSelector, -} from '../../selectors/confirm-transaction' -import { getCurrentCurrency, getDomainMetadata, -} from '../../selectors/selectors' + getNativeCurrency, +} from '../../selectors' import { currentNetworkTxListSelector } from '../../selectors/transactions' import { getCustomTxParamsData } from './confirm-approve.util' import ConfirmApproveContent from './confirm-approve-content' @@ -32,6 +31,7 @@ export default function ConfirmApprove() { } = useSelector(txDataSelector) const currentCurrency = useSelector(getCurrentCurrency) + const nativeCurrency = useSelector(getNativeCurrency) const currentNetworkTxList = useSelector(currentNetworkTxListSelector) const domainMetadata = useSelector(getDomainMetadata) const tokens = useSelector(getTokens) @@ -133,6 +133,7 @@ export default function ConfirmApprove() { data={customData || data} toAddress={toAddress} currentCurrency={currentCurrency} + nativeCurrency={nativeCurrency} ethTransactionTotal={ethTransactionTotal} fiatTransactionTotal={fiatTransactionTotal} />