From e543050868b58ea1a1b0cad363d763eab2ade25d Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Sun, 23 Apr 2017 15:27:17 +0400 Subject: [PATCH 1/5] remove extra buyAddress in state --- ui/app/reducers/app.js | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index 6b040e988..036286a8b 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -470,7 +470,6 @@ function reduceApp (state, action) { context: appState.currentView.name, }, identity: state.metamask.identities[action.value], - buyAddress: action.value, buyView: { subview: 'Coinbase', amount: '15.00', From 7a8496f9da894bf8821e91746b33f53fe23cf150 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Sun, 23 Apr 2017 15:28:45 +0400 Subject: [PATCH 2/5] remove buyButtonDeligator function --- ui/app/account-detail.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index 018e74893..d4b371947 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -262,15 +262,3 @@ AccountDetailScreen.prototype.transactionList = function () { AccountDetailScreen.prototype.requestAccountExport = function () { this.props.dispatch(actions.requestExportAccount()) } - - -AccountDetailScreen.prototype.buyButtonDeligator = function () { - var props = this.props - var selected = props.address || Object.keys(props.accounts)[0] - - if (this.props.accountDetail.subview === 'buyForm') { - props.dispatch(actions.backToAccountDetail(props.address)) - } else { - props.dispatch(actions.buyEthView(selected)) - } -} From c1df7dedd9065c8fe600642638e0e0a5d71e6f6e Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Sun, 23 Apr 2017 15:36:48 +0400 Subject: [PATCH 3/5] remove case buyForm --- ui/app/account-detail.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index d4b371947..d592a5ad6 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -16,7 +16,6 @@ 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) { @@ -238,8 +237,6 @@ 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() } From 5cabd3e02d0eeef8bd7c65db193b0bdb8cc9cc04 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Sun, 23 Apr 2017 21:18:14 +0400 Subject: [PATCH 4/5] remove updateBuyAddress action --- ui/app/actions.js | 9 --------- ui/app/components/coinbase-form.js | 4 +--- ui/app/components/shapeshift-form.js | 4 ---- ui/app/reducers/app.js | 13 ------------- 4 files changed, 1 insertion(+), 29 deletions(-) diff --git a/ui/app/actions.js b/ui/app/actions.js index 8934299e7..f08a93ff4 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -136,8 +136,6 @@ var actions = { BUY_ETH_VIEW: 'BUY_ETH_VIEW', UPDATE_COINBASE_AMOUNT: 'UPDATE_COIBASE_AMOUNT', updateCoinBaseAmount: updateCoinBaseAmount, - UPDATE_BUY_ADDRESS: 'UPDATE_BUY_ADDRESS', - updateBuyAddress: updateBuyAddress, COINBASE_SUBVIEW: 'COINBASE_SUBVIEW', coinBaseSubview: coinBaseSubview, SHAPESHIFT_SUBVIEW: 'SHAPESHIFT_SUBVIEW', @@ -859,13 +857,6 @@ function updateCoinBaseAmount (value) { } } -function updateBuyAddress (value) { - return { - type: actions.UPDATE_BUY_ADDRESS, - value, - } -} - function coinBaseSubview () { return { type: actions.COINBASE_SUBVIEW, diff --git a/ui/app/components/coinbase-form.js b/ui/app/components/coinbase-form.js index b92799375..82d1458bf 100644 --- a/ui/app/components/coinbase-form.js +++ b/ui/app/components/coinbase-form.js @@ -48,9 +48,7 @@ CoinbaseForm.prototype.render = function () { CoinbaseForm.prototype.handleAmount = function (event) { this.props.dispatch(actions.updateCoinBaseAmount(event.target.value)) } -CoinbaseForm.prototype.handleAddress = function (event) { - this.props.dispatch(actions.updateBuyAddress(event.target.value)) -} + CoinbaseForm.prototype.toCoinbase = function () { const props = this.props const address = props.buyView.buyAddress diff --git a/ui/app/components/shapeshift-form.js b/ui/app/components/shapeshift-form.js index 2745b1b11..f0a067c05 100644 --- a/ui/app/components/shapeshift-form.js +++ b/ui/app/components/shapeshift-form.js @@ -276,10 +276,6 @@ ShapeshiftForm.prototype.renderInfo = function () { ]) } -ShapeshiftForm.prototype.handleAddress = function (event) { - this.props.dispatch(actions.updateBuyAddress(event.target.value)) -} - ShapeshiftForm.prototype.activeToggle = function (elementType) { if (!this.props.buyView.formView.response || this.props.warning) return elementType return `${elementType}.inactive` diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index 036286a8b..016ddb569 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -481,19 +481,6 @@ function reduceApp (state, action) { }, }) - case actions.UPDATE_BUY_ADDRESS: - return extend(appState, { - buyView: { - subview: appState.subview, - formView: { - coinbase: appState.buyView.formView.coinbase, - shapeshift: appState.buyView.formView.shapeshift, - }, - buyAddress: action.value, - amount: appState.buyView.amount, - }, - }) - case actions.UPDATE_COINBASE_AMOUNT: return extend(appState, { buyView: { From 7f12be6a014286d727766174bff9391b2cc55ae9 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Mon, 24 Apr 2017 12:18:54 +0400 Subject: [PATCH 5/5] remove updateCoinBaseAmount action --- ui/app/actions.js | 9 --------- ui/app/components/coinbase-form.js | 3 --- ui/app/reducers/app.js | 13 ------------- 3 files changed, 25 deletions(-) diff --git a/ui/app/actions.js b/ui/app/actions.js index f08a93ff4..18f341411 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -134,8 +134,6 @@ var actions = { buyEth: buyEth, buyEthView: buyEthView, BUY_ETH_VIEW: 'BUY_ETH_VIEW', - UPDATE_COINBASE_AMOUNT: 'UPDATE_COIBASE_AMOUNT', - updateCoinBaseAmount: updateCoinBaseAmount, COINBASE_SUBVIEW: 'COINBASE_SUBVIEW', coinBaseSubview: coinBaseSubview, SHAPESHIFT_SUBVIEW: 'SHAPESHIFT_SUBVIEW', @@ -850,13 +848,6 @@ function buyEthView (address) { } } -function updateCoinBaseAmount (value) { - return { - type: actions.UPDATE_COINBASE_AMOUNT, - value, - } -} - function coinBaseSubview () { return { type: actions.COINBASE_SUBVIEW, diff --git a/ui/app/components/coinbase-form.js b/ui/app/components/coinbase-form.js index 82d1458bf..7ba8ca79e 100644 --- a/ui/app/components/coinbase-form.js +++ b/ui/app/components/coinbase-form.js @@ -45,9 +45,6 @@ CoinbaseForm.prototype.render = function () { ]), ]) } -CoinbaseForm.prototype.handleAmount = function (event) { - this.props.dispatch(actions.updateCoinBaseAmount(event.target.value)) -} CoinbaseForm.prototype.toCoinbase = function () { const props = this.props diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index 016ddb569..324a4df35 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -481,19 +481,6 @@ function reduceApp (state, action) { }, }) - case actions.UPDATE_COINBASE_AMOUNT: - return extend(appState, { - buyView: { - subview: 'Coinbase', - formView: { - coinbase: true, - shapeshift: false, - }, - buyAddress: appState.buyView.buyAddress, - amount: action.value, - }, - }) - case actions.COINBASE_SUBVIEW: return extend(appState, { buyView: {