diff options
author | Kevin Serrano <kevin.serrano@consensys.net> | 2017-09-08 04:55:59 +0800 |
---|---|---|
committer | Kevin Serrano <kevin.serrano@consensys.net> | 2017-09-08 04:55:59 +0800 |
commit | 3a87a30912e8c5e212f7d0cc5e01ed1f873bfe33 (patch) | |
tree | badab428738de82e69fc3e04d732faf47eebf10d /ui/app | |
parent | 34e7bb50157462d0f0284f2df0fd116e5aff6840 (diff) | |
download | tangerine-wallet-browser-3a87a30912e8c5e212f7d0cc5e01ed1f873bfe33.tar tangerine-wallet-browser-3a87a30912e8c5e212f7d0cc5e01ed1f873bfe33.tar.gz tangerine-wallet-browser-3a87a30912e8c5e212f7d0cc5e01ed1f873bfe33.tar.bz2 tangerine-wallet-browser-3a87a30912e8c5e212f7d0cc5e01ed1f873bfe33.tar.lz tangerine-wallet-browser-3a87a30912e8c5e212f7d0cc5e01ed1f873bfe33.tar.xz tangerine-wallet-browser-3a87a30912e8c5e212f7d0cc5e01ed1f873bfe33.tar.zst tangerine-wallet-browser-3a87a30912e8c5e212f7d0cc5e01ed1f873bfe33.zip |
Fold submit and buy ether into one button slot
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/components/pending-tx.js | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js index 5324ccd64..65f64adfe 100644 --- a/ui/app/components/pending-tx.js +++ b/ui/app/components/pending-tx.js @@ -66,6 +66,7 @@ PendingTx.prototype.render = function () { const balanceBn = hexToBn(balance) const insufficientBalance = balanceBn.lt(maxCost) + const buyDisabled = insufficientBalance || !this.state.valid || !isValidAddress || this.state.submitting this.inputs = [] @@ -297,14 +298,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,13 +305,14 @@ 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, |