diff options
author | Frankie <frankie.pangilinan@consensys.net> | 2016-09-16 09:16:41 +0800 |
---|---|---|
committer | Frankie <frankie.pangilinan@consensys.net> | 2016-09-16 09:16:41 +0800 |
commit | dcda841f4d33f96a5620b2458decd94339d5ee52 (patch) | |
tree | 07cce20fe4474c2424026703a4482b2867eb5beb /ui/app/components | |
parent | bc33c88ae53fbc08e75db025888d5bc3bcfe236d (diff) | |
parent | a5e45820cc7359491d1d7b06a5358d99b9c97305 (diff) | |
download | tangerine-wallet-browser-dcda841f4d33f96a5620b2458decd94339d5ee52.tar tangerine-wallet-browser-dcda841f4d33f96a5620b2458decd94339d5ee52.tar.gz tangerine-wallet-browser-dcda841f4d33f96a5620b2458decd94339d5ee52.tar.bz2 tangerine-wallet-browser-dcda841f4d33f96a5620b2458decd94339d5ee52.tar.lz tangerine-wallet-browser-dcda841f4d33f96a5620b2458decd94339d5ee52.tar.xz tangerine-wallet-browser-dcda841f4d33f96a5620b2458decd94339d5ee52.tar.zst tangerine-wallet-browser-dcda841f4d33f96a5620b2458decd94339d5ee52.zip |
Merge branch 'master' into tx-viz
Diffstat (limited to 'ui/app/components')
-rw-r--r-- | ui/app/components/buy-button-subview.js | 11 | ||||
-rw-r--r-- | ui/app/components/pending-tx-details.js | 4 | ||||
-rw-r--r-- | ui/app/components/pending-tx.js | 23 |
3 files changed, 30 insertions, 8 deletions
diff --git a/ui/app/components/buy-button-subview.js b/ui/app/components/buy-button-subview.js index c3e9e5d7b..7daf41206 100644 --- a/ui/app/components/buy-button-subview.js +++ b/ui/app/components/buy-button-subview.js @@ -16,6 +16,7 @@ function mapStateToProps (state) { buyView: state.appState.buyView, network: state.metamask.network, provider: state.metamask.provider, + context: state.appState.currentView.context, } } @@ -38,7 +39,7 @@ BuyButtonSubview.prototype.render = function () { }, }, [ h('i.fa.fa-arrow-left.fa-lg.cursor-pointer.color-orange', { - onClick: () => props.dispatch(actions.backToAccountDetail(props.selectedAccount)), + onClick: this.backButtonContext.bind(this), style: { position: 'absolute', left: '10px', @@ -121,3 +122,11 @@ BuyButtonSubview.prototype.formVersionSubview = function () { BuyButtonSubview.prototype.navigateTo = function (url) { extension.tabs.create({ url }) } + +BuyButtonSubview.prototype.backButtonContext = function () { + if (this.props.context === 'confTx') { + this.props.dispatch(actions.showConfTxPage(false)) + } else { + this.props.dispatch(actions.goHome()) + } +} diff --git a/ui/app/components/pending-tx-details.js b/ui/app/components/pending-tx-details.js index 148b5c6df..d8e8524bf 100644 --- a/ui/app/components/pending-tx-details.js +++ b/ui/app/components/pending-tx-details.js @@ -4,12 +4,12 @@ const inherits = require('util').inherits const MiniAccountPanel = require('./mini-account-panel') const EthBalance = require('./eth-balance') -const addressSummary = require('../util').addressSummary +const util = require('../util') +const addressSummary = util.addressSummary const nameForAddress = require('../../lib/contract-namer') const ethUtil = require('ethereumjs-util') const BN = ethUtil.BN - module.exports = PendingTxDetails inherits(PendingTxDetails, Component) 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'), ]), ]) ) } - |