1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

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.
This commit is contained in:
Thomas Huang 2021-01-27 22:44:04 -08:00 committed by GitHub
parent 293b8a0f53
commit 425ec6228c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -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)}
</div>
<div className="confirm-approve-content__transaction-details-content__secondary-fee">
{`${ethTransactionTotal} ETH`}
{`${ethTransactionTotal} ${nativeCurrency}`}
</div>
</div>
</div>

View File

@ -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}
/>