Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Show transaction fee units on approve screen #7468

Merged
merged 1 commit into from
Nov 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/e2e/metamask-ui.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ describe('MetaMask', function () {
await driver.wait(until.stalenessOf(gasModal))

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 () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Identicon from '../../../components/ui/identicon'
import {
addressSummary,
} from '../../../helpers/utils/util'
import { formatCurrency } from '../../../helpers/utils/confirm-tx.util'

export default class ConfirmApproveContent extends Component {
static contextTypes = {
Expand All @@ -26,6 +27,7 @@ export default class ConfirmApproveContent extends Component {
tokenBalance: PropTypes.string,
data: PropTypes.string,
toAddress: PropTypes.string,
currentCurrency: PropTypes.string,
fiatTransactionTotal: PropTypes.string,
ethTransactionTotal: PropTypes.string,
}
Expand Down Expand Up @@ -68,6 +70,7 @@ export default class ConfirmApproveContent extends Component {
renderTransactionDetailsContent () {
const { t } = this.context
const {
currentCurrency,
ethTransactionTotal,
fiatTransactionTotal,
} = this.props
Expand All @@ -78,10 +81,10 @@ export default class ConfirmApproveContent extends Component {
</div>
<div className="confirm-approve-content__transaction-details-content__fee">
<div className="confirm-approve-content__transaction-details-content__primary-fee">
{ fiatTransactionTotal }
{ formatCurrency(fiatTransactionTotal, currentCurrency) }
</div>
<div className="confirm-approve-content__transaction-details-content__secondary-fee">
{ ethTransactionTotal }
{ `${ethTransactionTotal} ETH` }
</div>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions ui/app/pages/confirm-approve/confirm-approve.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default class ConfirmApprove extends Component {
data,
decimals,
txData,
currentCurrency,
ethTransactionTotal,
fiatTransactionTotal,
...restProps
Expand Down Expand Up @@ -95,6 +96,7 @@ export default class ConfirmApprove extends Component {
showEditApprovalPermissionModal={showEditApprovalPermissionModal}
data={data}
toAddress={toAddress}
currentCurrency={currentCurrency}
ethTransactionTotal={ethTransactionTotal}
fiatTransactionTotal={fiatTransactionTotal}
/>}
Expand Down