diff options
author | Frankie <frankie.pangilinan@consensys.net> | 2016-08-11 04:43:01 +0800 |
---|---|---|
committer | Frankie <frankie.pangilinan@consensys.net> | 2016-08-11 04:43:01 +0800 |
commit | 9c6dd9ef4953f6e421feb6e6684ef43da26f6b75 (patch) | |
tree | 309366cc31236440709705e0a9a9e7eb183801a3 /ui/app/account-detail.js | |
parent | 667483ac2037bef5b412ce33f0d9bb0605d6c13b (diff) | |
download | tangerine-wallet-browser-9c6dd9ef4953f6e421feb6e6684ef43da26f6b75.tar tangerine-wallet-browser-9c6dd9ef4953f6e421feb6e6684ef43da26f6b75.tar.gz tangerine-wallet-browser-9c6dd9ef4953f6e421feb6e6684ef43da26f6b75.tar.bz2 tangerine-wallet-browser-9c6dd9ef4953f6e421feb6e6684ef43da26f6b75.tar.lz tangerine-wallet-browser-9c6dd9ef4953f6e421feb6e6684ef43da26f6b75.tar.xz tangerine-wallet-browser-9c6dd9ef4953f6e421feb6e6684ef43da26f6b75.tar.zst tangerine-wallet-browser-9c6dd9ef4953f6e421feb6e6684ef43da26f6b75.zip |
Create "buy form" add shape shift
Diffstat (limited to 'ui/app/account-detail.js')
-rw-r--r-- | ui/app/account-detail.js | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index 6d50dbd71..cf65cbb7d 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) { @@ -28,6 +28,7 @@ function mapStateToProps (state) { network: state.metamask.network, unconfTxs: valuesFor(state.metamask.unconfTxs), unconfMsgs: valuesFor(state.metamask.unconfMsgs), + isEthWarningConfirmed: state.metamask.isEthConfirmed, } } @@ -171,6 +172,21 @@ AccountDetailScreen.prototype.render = function () { }), h('button', { + onClick: this.buyButtonDeligator.bind(this), + style: { + marginBottom: '20px', + marginRight: '8px', + position: 'absolute', + left: '219px', + }, + }, props.accountDetail.subview === 'buyForm' ? [h('i.fa.fa-arrow-left', { + style: { + width: '22.641px', + height: '14px', + }, + })] : 'BUY'), + + h('button', { onClick: () => props.dispatch(actions.showSendPage()), style: { marginBottom: '20px', @@ -181,7 +197,7 @@ AccountDetailScreen.prototype.render = function () { ]), ]), - // subview (tx history, pk export confirm) + // subview (tx history, pk export confirm, buy eth warning) h(ReactCSSTransitionGroup, { className: 'css-transition-group', transitionName: 'main', @@ -209,6 +225,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() } @@ -239,3 +257,13 @@ 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.buyEthSubview()) + } +} |