From 9c6dd9ef4953f6e421feb6e6684ef43da26f6b75 Mon Sep 17 00:00:00 2001 From: Frankie Date: Wed, 10 Aug 2016 13:43:01 -0700 Subject: Create "buy form" add shape shift --- ui/app/account-detail.js | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'ui/app/account-detail.js') 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, } } @@ -170,6 +171,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: { @@ -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()) + } +} -- cgit From 4ace425a9c4a5112692d1e9269d3074a0987e5e9 Mon Sep 17 00:00:00 2001 From: Frankie Date: Wed, 10 Aug 2016 13:51:14 -0700 Subject: Fix merge mess --- ui/app/account-detail.js | 8 -------- 1 file changed, 8 deletions(-) (limited to 'ui/app/account-detail.js') diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index 814d8bab0..cf65cbb7d 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -172,27 +172,19 @@ AccountDetailScreen.prototype.render = function () { }), h('button', { -<<<<<<< HEAD onClick: this.buyButtonDeligator.bind(this), -======= - onClick: () => props.dispatch(actions.buyEth(selected)), ->>>>>>> master style: { marginBottom: '20px', marginRight: '8px', position: 'absolute', left: '219px', }, -<<<<<<< HEAD }, props.accountDetail.subview === 'buyForm' ? [h('i.fa.fa-arrow-left', { style: { width: '22.641px', height: '14px', }, })] : 'BUY'), -======= - }, 'BUY'), ->>>>>>> master h('button', { onClick: () => props.dispatch(actions.showSendPage()), -- cgit From b4c9a5225947f9aadac5fd1bb23fde64740d774a Mon Sep 17 00:00:00 2001 From: Frankie Date: Fri, 12 Aug 2016 15:41:59 -0700 Subject: Change buy forms so that they are their own view and add Qr-code --- ui/app/account-detail.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui/app/account-detail.js') diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index cf65cbb7d..0053935f5 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -172,7 +172,7 @@ AccountDetailScreen.prototype.render = function () { }), h('button', { - onClick: this.buyButtonDeligator.bind(this), + onClick: () => props.dispatch(actions.buyEthView(selected)), style: { marginBottom: '20px', marginRight: '8px', @@ -264,6 +264,6 @@ AccountDetailScreen.prototype.buyButtonDeligator = function () { if (this.props.accountDetail.subview === 'buyForm') { props.dispatch(actions.backToAccountDetail(props.address)) } else { - props.dispatch(actions.buyEthSubview()) + props.dispatch(actions.buyEthView()) } } -- cgit