Show transaction fee units on approve screen (#7468)

The units for the amounts shown on the approve screen in the
transaction fee section were missing. It appears that they were present
in an early version of the approve screen (#7271) but they got lost
somewhere along the way.
feature/default_network_editable
Mark Stacey 5 years ago committed by GitHub
parent 346c1f2622
commit 5c356a4cac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      test/e2e/metamask-ui.spec.js
  2. 7
      ui/app/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js
  3. 2
      ui/app/pages/confirm-approve/confirm-approve.component.js

@ -1190,7 +1190,7 @@ describe('MetaMask', function () {
await driver.wait(until.stalenessOf(gasModal)) await driver.wait(until.stalenessOf(gasModal))
const gasFeeInEth = await findElement(driver, By.css('.confirm-approve-content__transaction-details-content__secondary-fee')) const gasFeeInEth = await findElement(driver, By.css('.confirm-approve-content__transaction-details-content__secondary-fee'))
assert.equal(await gasFeeInEth.getText(), '0.0006') assert.equal(await gasFeeInEth.getText(), '0.0006 ETH')
}) })
it('edits the permission', async () => { it('edits the permission', async () => {

@ -5,6 +5,7 @@ import Identicon from '../../../components/ui/identicon'
import { import {
addressSummary, addressSummary,
} from '../../../helpers/utils/util' } from '../../../helpers/utils/util'
import { formatCurrency } from '../../../helpers/utils/confirm-tx.util'
export default class ConfirmApproveContent extends Component { export default class ConfirmApproveContent extends Component {
static contextTypes = { static contextTypes = {
@ -26,6 +27,7 @@ export default class ConfirmApproveContent extends Component {
tokenBalance: PropTypes.string, tokenBalance: PropTypes.string,
data: PropTypes.string, data: PropTypes.string,
toAddress: PropTypes.string, toAddress: PropTypes.string,
currentCurrency: PropTypes.string,
fiatTransactionTotal: PropTypes.string, fiatTransactionTotal: PropTypes.string,
ethTransactionTotal: PropTypes.string, ethTransactionTotal: PropTypes.string,
} }
@ -68,6 +70,7 @@ export default class ConfirmApproveContent extends Component {
renderTransactionDetailsContent () { renderTransactionDetailsContent () {
const { t } = this.context const { t } = this.context
const { const {
currentCurrency,
ethTransactionTotal, ethTransactionTotal,
fiatTransactionTotal, fiatTransactionTotal,
} = this.props } = this.props
@ -78,10 +81,10 @@ export default class ConfirmApproveContent extends Component {
</div> </div>
<div className="confirm-approve-content__transaction-details-content__fee"> <div className="confirm-approve-content__transaction-details-content__fee">
<div className="confirm-approve-content__transaction-details-content__primary-fee"> <div className="confirm-approve-content__transaction-details-content__primary-fee">
{ fiatTransactionTotal } { 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 } { `${ethTransactionTotal} ETH` }
</div> </div>
</div> </div>
</div> </div>

@ -62,6 +62,7 @@ export default class ConfirmApprove extends Component {
data, data,
decimals, decimals,
txData, txData,
currentCurrency,
ethTransactionTotal, ethTransactionTotal,
fiatTransactionTotal, fiatTransactionTotal,
...restProps ...restProps
@ -95,6 +96,7 @@ export default class ConfirmApprove extends Component {
showEditApprovalPermissionModal={showEditApprovalPermissionModal} showEditApprovalPermissionModal={showEditApprovalPermissionModal}
data={data} data={data}
toAddress={toAddress} toAddress={toAddress}
currentCurrency={currentCurrency}
ethTransactionTotal={ethTransactionTotal} ethTransactionTotal={ethTransactionTotal}
fiatTransactionTotal={fiatTransactionTotal} fiatTransactionTotal={fiatTransactionTotal}
/>} />}

Loading…
Cancel
Save