aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/account-detail.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/account-detail.js')
-rw-r--r--ui/app/account-detail.js32
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())
+ }
+}