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.
feature/default_network_editable
Thomas Huang 4 years ago committed by GitHub
parent 293b8a0f53
commit 425ec6228c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ui/app/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js
  2. 7
      ui/app/pages/confirm-approve/confirm-approve.js

@ -24,6 +24,7 @@ export default class ConfirmApproveContent extends Component {
data: PropTypes.string, data: PropTypes.string,
toAddress: PropTypes.string, toAddress: PropTypes.string,
currentCurrency: PropTypes.string, currentCurrency: PropTypes.string,
nativeCurrency: PropTypes.string,
fiatTransactionTotal: PropTypes.string, fiatTransactionTotal: PropTypes.string,
ethTransactionTotal: PropTypes.string, ethTransactionTotal: PropTypes.string,
} }
@ -75,6 +76,7 @@ export default class ConfirmApproveContent extends Component {
const { t } = this.context const { t } = this.context
const { const {
currentCurrency, currentCurrency,
nativeCurrency,
ethTransactionTotal, ethTransactionTotal,
fiatTransactionTotal, fiatTransactionTotal,
} = this.props } = this.props
@ -88,7 +90,7 @@ export default class ConfirmApproveContent extends Component {
{formatCurrency(fiatTransactionTotal, currentCurrency)} {formatCurrency(fiatTransactionTotal, currentCurrency)}
</div> </div>
<div className="confirm-approve-content__transaction-details-content__secondary-fee"> <div className="confirm-approve-content__transaction-details-content__secondary-fee">
{`${ethTransactionTotal} ETH`} {`${ethTransactionTotal} ${nativeCurrency}`}
</div> </div>
</div> </div>
</div> </div>

@ -14,11 +14,10 @@ import { getTokens } from '../../ducks/metamask/metamask'
import { import {
transactionFeeSelector, transactionFeeSelector,
txDataSelector, txDataSelector,
} from '../../selectors/confirm-transaction'
import {
getCurrentCurrency, getCurrentCurrency,
getDomainMetadata, getDomainMetadata,
} from '../../selectors/selectors' getNativeCurrency,
} from '../../selectors'
import { currentNetworkTxListSelector } from '../../selectors/transactions' import { currentNetworkTxListSelector } from '../../selectors/transactions'
import { getCustomTxParamsData } from './confirm-approve.util' import { getCustomTxParamsData } from './confirm-approve.util'
import ConfirmApproveContent from './confirm-approve-content' import ConfirmApproveContent from './confirm-approve-content'
@ -32,6 +31,7 @@ export default function ConfirmApprove() {
} = useSelector(txDataSelector) } = useSelector(txDataSelector)
const currentCurrency = useSelector(getCurrentCurrency) const currentCurrency = useSelector(getCurrentCurrency)
const nativeCurrency = useSelector(getNativeCurrency)
const currentNetworkTxList = useSelector(currentNetworkTxListSelector) const currentNetworkTxList = useSelector(currentNetworkTxListSelector)
const domainMetadata = useSelector(getDomainMetadata) const domainMetadata = useSelector(getDomainMetadata)
const tokens = useSelector(getTokens) const tokens = useSelector(getTokens)
@ -133,6 +133,7 @@ export default function ConfirmApprove() {
data={customData || data} data={customData || data}
toAddress={toAddress} toAddress={toAddress}
currentCurrency={currentCurrency} currentCurrency={currentCurrency}
nativeCurrency={nativeCurrency}
ethTransactionTotal={ethTransactionTotal} ethTransactionTotal={ethTransactionTotal}
fiatTransactionTotal={fiatTransactionTotal} fiatTransactionTotal={fiatTransactionTotal}
/> />

Loading…
Cancel
Save