diff options
author | Dan Finlay <flyswatter@users.noreply.github.com> | 2017-09-12 05:31:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-12 05:31:59 +0800 |
commit | e7159f0e4857d3f1d4fcf793faf2b36159214e75 (patch) | |
tree | ed46605e46452f1b2b484b11eea79044ece70ec4 /ui/app/components | |
parent | 96107556dcc57f04aeebfc7d775d5a60a88cb450 (diff) | |
parent | 27ba7f6ed3b0c55f6f5d7fa7e3829bdc06e0df9f (diff) | |
download | tangerine-wallet-browser-e7159f0e4857d3f1d4fcf793faf2b36159214e75.tar tangerine-wallet-browser-e7159f0e4857d3f1d4fcf793faf2b36159214e75.tar.gz tangerine-wallet-browser-e7159f0e4857d3f1d4fcf793faf2b36159214e75.tar.bz2 tangerine-wallet-browser-e7159f0e4857d3f1d4fcf793faf2b36159214e75.tar.lz tangerine-wallet-browser-e7159f0e4857d3f1d4fcf793faf2b36159214e75.tar.xz tangerine-wallet-browser-e7159f0e4857d3f1d4fcf793faf2b36159214e75.tar.zst tangerine-wallet-browser-e7159f0e4857d3f1d4fcf793faf2b36159214e75.zip |
Merge pull request #2045 from MetaMask/rejectallunapproved
Feature - Reject all unapproved transactions button (MM Submission: feat. @davidp94)
Diffstat (limited to 'ui/app/components')
-rw-r--r-- | ui/app/components/pending-tx.js | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js index 5324ccd64..3e53d47f9 100644 --- a/ui/app/components/pending-tx.js +++ b/ui/app/components/pending-tx.js @@ -66,6 +66,8 @@ PendingTx.prototype.render = function () { const balanceBn = hexToBn(balance) const insufficientBalance = balanceBn.lt(maxCost) + const buyDisabled = insufficientBalance || !this.state.valid || !isValidAddress || this.state.submitting + const showRejectAll = props.unconfTxListLength > 1 this.inputs = [] @@ -297,14 +299,6 @@ PendingTx.prototype.render = function () { margin: '14px 25px', }, }, [ - - - insufficientBalance ? - h('button.btn-green', { - onClick: props.buyEth, - }, 'Buy Ether') - : null, - h('button', { onClick: (event) => { this.resetGasFields() @@ -312,18 +306,30 @@ PendingTx.prototype.render = function () { }, }, 'Reset'), - // Accept Button - h('input.confirm.btn-green', { - type: 'submit', - value: 'SUBMIT', - style: { marginLeft: '10px' }, - disabled: insufficientBalance || !this.state.valid || !isValidAddress || this.state.submitting, - }), + // Accept Button or Buy Button + insufficientBalance ? h('button.btn-green', { onClick: props.buyEth }, 'Buy Ether') : + h('input.confirm.btn-green', { + type: 'submit', + value: 'SUBMIT', + style: { marginLeft: '10px' }, + disabled: buyDisabled, + }), h('button.cancel.btn-red', { onClick: props.cancelTransaction, }, 'Reject'), ]), + showRejectAll ? h('.flex-row.flex-space-around.conf-buttons', { + style: { + display: 'flex', + justifyContent: 'flex-end', + margin: '14px 25px', + }, + }, [ + h('button.cancel.btn-red', { + onClick: props.cancelAllTransactions, + }, 'Reject All'), + ]) : null, ]), ]) ) |