diff options
author | Dan Finlay <somniac@me.com> | 2016-09-16 06:00:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-16 06:00:42 +0800 |
commit | a5e45820cc7359491d1d7b06a5358d99b9c97305 (patch) | |
tree | 521c1baf581454c29b05c53a6598d5ec6fe8caa4 /ui/app/components/pending-tx.js | |
parent | 06b9adf172010600c7ac1127ff2ee76a7433e97b (diff) | |
parent | cf484d735fab021a0dfe509243b957e8c6278532 (diff) | |
download | tangerine-wallet-browser-a5e45820cc7359491d1d7b06a5358d99b9c97305.tar.gz tangerine-wallet-browser-a5e45820cc7359491d1d7b06a5358d99b9c97305.tar.zst tangerine-wallet-browser-a5e45820cc7359491d1d7b06a5358d99b9c97305.zip |
Merge pull request #673 from MetaMask/i#519buyButtonTxConf
Drop the buy button in if tx is more then account balance
Diffstat (limited to 'ui/app/components/pending-tx.js')
-rw-r--r-- | ui/app/components/pending-tx.js | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js index 1feedbbbc..4c27a8092 100644 --- a/ui/app/components/pending-tx.js +++ b/ui/app/components/pending-tx.js @@ -3,7 +3,6 @@ const h = require('react-hyperscript') const inherits = require('util').inherits const PendingTxDetails = require('./pending-tx-details') - module.exports = PendingTx inherits(PendingTx, Component) @@ -31,6 +30,15 @@ PendingTx.prototype.render = function () { } `), + state.insufficientBalance ? + h('span.error', { + style: { + marginLeft: 50, + fontSize: '0.9em', + }, + }, 'Insufficient balance for transaction') + : null, + // send + cancel h('.flex-row.flex-space-around.conf-buttons', { style: { @@ -39,17 +47,22 @@ PendingTx.prototype.render = function () { margin: '14px 25px', }, }, [ + + state.insufficientBalance ? + h('button.btn-green', { + onClick: state.buyEth, + }, 'Buy Ether') + : null, + h('button.confirm', { + disabled: state.insufficientBalance, onClick: state.sendTransaction, - style: { background: 'rgb(251,117,1)' }, }, 'Accept'), - h('button.cancel', { + h('button.cancel.btn-red', { onClick: state.cancelTransaction, - style: { background: 'rgb(254,35,17)' }, }, 'Reject'), ]), ]) ) } - |