Skip to content

Commit 1b3f194

Browse files
committed
Show transaction fee units on approve screen
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.
1 parent 86b165e commit 1b3f194

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

test/e2e/metamask-ui.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ describe('MetaMask', function () {
11901190
await driver.wait(until.stalenessOf(gasModal))
11911191

11921192
const gasFeeInEth = await findElement(driver, By.css('.confirm-approve-content__transaction-details-content__secondary-fee'))
1193-
assert.equal(await gasFeeInEth.getText(), '0.0006')
1193+
assert.equal(await gasFeeInEth.getText(), '0.0006 ETH')
11941194
})
11951195

11961196
it('edits the permission', async () => {

ui/app/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Identicon from '../../../components/ui/identicon'
55
import {
66
addressSummary,
77
} from '../../../helpers/utils/util'
8+
import { formatCurrency } from '../../../helpers/utils/confirm-tx.util'
89

910
export default class ConfirmApproveContent extends Component {
1011
static contextTypes = {
@@ -26,6 +27,7 @@ export default class ConfirmApproveContent extends Component {
2627
tokenBalance: PropTypes.string,
2728
data: PropTypes.string,
2829
toAddress: PropTypes.string,
30+
currentCurrency: PropTypes.string,
2931
fiatTransactionTotal: PropTypes.string,
3032
ethTransactionTotal: PropTypes.string,
3133
}
@@ -68,6 +70,7 @@ export default class ConfirmApproveContent extends Component {
6870
renderTransactionDetailsContent () {
6971
const { t } = this.context
7072
const {
73+
currentCurrency,
7174
ethTransactionTotal,
7275
fiatTransactionTotal,
7376
} = this.props
@@ -78,10 +81,10 @@ export default class ConfirmApproveContent extends Component {
7881
</div>
7982
<div className="confirm-approve-content__transaction-details-content__fee">
8083
<div className="confirm-approve-content__transaction-details-content__primary-fee">
81-
{ fiatTransactionTotal }
84+
{ formatCurrency(fiatTransactionTotal, currentCurrency) }
8285
</div>
8386
<div className="confirm-approve-content__transaction-details-content__secondary-fee">
84-
{ ethTransactionTotal }
87+
{ `${ethTransactionTotal} ETH` }
8588
</div>
8689
</div>
8790
</div>

ui/app/pages/confirm-approve/confirm-approve.component.js

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export default class ConfirmApprove extends Component {
6262
data,
6363
decimals,
6464
txData,
65+
currentCurrency,
6566
ethTransactionTotal,
6667
fiatTransactionTotal,
6768
...restProps
@@ -95,6 +96,7 @@ export default class ConfirmApprove extends Component {
9596
showEditApprovalPermissionModal={showEditApprovalPermissionModal}
9697
data={data}
9798
toAddress={toAddress}
99+
currentCurrency={currentCurrency}
98100
ethTransactionTotal={ethTransactionTotal}
99101
fiatTransactionTotal={fiatTransactionTotal}
100102
/>}

0 commit comments

Comments
 (0)