diff options
Diffstat (limited to 'ui/app/account-detail.js')
-rw-r--r-- | ui/app/account-detail.js | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index 3cc1fb8ba..7af8aece7 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -15,7 +15,7 @@ const ExportAccountView = require('./components/account-export') const ethUtil = require('ethereumjs-util') const EditableLabel = require('./components/editable-label') const Tooltip = require('./components/tooltip') - +const BuyButtonSubview = require('./components/buy-button-subview') module.exports = connect(mapStateToProps)(AccountDetailScreen) function mapStateToProps (state) { @@ -173,14 +173,19 @@ AccountDetailScreen.prototype.render = function () { }), h('button', { - onClick: () => props.dispatch(actions.buyEth(selected)), + onClick: () => props.dispatch(actions.buyEthView(selected)), style: { marginBottom: '20px', marginRight: '8px', position: 'absolute', left: '219px', }, - }, 'BUY'), + }, props.accountDetail.subview === 'buyForm' ? [h('i.fa.fa-arrow-left', { + style: { + width: '22.641px', + height: '14px', + }, + })] : 'BUY'), h('button', { onClick: () => props.dispatch(actions.showSendPage()), @@ -221,6 +226,8 @@ AccountDetailScreen.prototype.subview = function () { case 'export': var state = extend({key: 'export'}, this.props) return h(ExportAccountView, state) + case 'buyForm': + return h(BuyButtonSubview, extend({key: 'buyForm'}, this.props)) default: return this.transactionList() } @@ -251,3 +258,14 @@ AccountDetailScreen.prototype.transactionList = function () { AccountDetailScreen.prototype.requestAccountExport = function () { this.props.dispatch(actions.requestExportAccount()) } + + +AccountDetailScreen.prototype.buyButtonDeligator = function () { + var props = this.props + + if (this.props.accountDetail.subview === 'buyForm') { + props.dispatch(actions.backToAccountDetail(props.address)) + } else { + props.dispatch(actions.buyEthView()) + } +} |