aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/reducers
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2016-08-14 23:18:20 +0800
committerGitHub <noreply@github.com>2016-08-14 23:18:20 +0800
commitf7a5a4e170538792f00aa8f05d46144734f361d2 (patch)
treefa0cad900c2834039055cdf26d4671adee40fe74 /ui/app/reducers
parent4572e689cf3feef22d49ee71f1465a11b305a13c (diff)
parent31d6d5c50916a98c7cdc1cf898eeb9a046a60c72 (diff)
downloadtangerine-wallet-browser-f7a5a4e170538792f00aa8f05d46144734f361d2.tar
tangerine-wallet-browser-f7a5a4e170538792f00aa8f05d46144734f361d2.tar.gz
tangerine-wallet-browser-f7a5a4e170538792f00aa8f05d46144734f361d2.tar.bz2
tangerine-wallet-browser-f7a5a4e170538792f00aa8f05d46144734f361d2.tar.lz
tangerine-wallet-browser-f7a5a4e170538792f00aa8f05d46144734f361d2.tar.xz
tangerine-wallet-browser-f7a5a4e170538792f00aa8f05d46144734f361d2.tar.zst
tangerine-wallet-browser-f7a5a4e170538792f00aa8f05d46144734f361d2.zip
Merge pull request #529 from MetaMask/buyForm
Buy form
Diffstat (limited to 'ui/app/reducers')
-rw-r--r--ui/app/reducers/app.js104
1 files changed, 100 insertions, 4 deletions
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js
index a9d6e4ff0..95b60f929 100644
--- a/ui/app/reducers/app.js
+++ b/ui/app/reducers/app.js
@@ -317,6 +317,15 @@ function reduceApp (state, action) {
isLoading: false,
})
+ case actions.SHOW_SUB_LOADING_INDICATION:
+ return extend(appState, {
+ isSubLoading: true,
+ })
+
+ case actions.HIDE_SUB_LOADING_INDICATION:
+ return extend(appState, {
+ isSubLoading: false,
+ })
case actions.CLEAR_SEED_WORD_CACHE:
return extend(appState, {
transForward: true,
@@ -369,15 +378,102 @@ function reduceApp (state, action) {
},
})
- case actions.SHOW_ETH_WARNING:
+ case actions.BUY_ETH_VIEW:
return extend(appState, {
transForward: true,
currentView: {
- name: 'accountDetail',
+ name: 'buyEth',
context: appState.currentView.context,
},
- accountDetail: {
- subview: 'buy-eth-warning',
+ buyView: {
+ subview: 'buyForm',
+ amount: '5.00',
+ buyAddress: action.value,
+ formView: {
+ coinbase: true,
+ shapeshift: false,
+ },
+ },
+ })
+
+ case actions.UPDATE_BUY_ADDRESS:
+ return extend(appState, {
+ buyView: {
+ subview: 'buyForm',
+ 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: {
+ subview: 'buyForm',
+ formView: {
+ coinbase: true,
+ shapeshift: false,
+ },
+ buyAddress: appState.buyView.buyAddress,
+ amount: action.value,
+ },
+ })
+
+ case actions.COINBASE_SUBVIEW:
+ return extend(appState, {
+ buyView: {
+ subview: 'buyForm',
+ formView: {
+ coinbase: true,
+ shapeshift: false,
+ },
+ buyAddress: appState.buyView.buyAddress,
+ amount: appState.buyView.amount,
+ },
+ })
+
+ case actions.SHAPESHIFT_SUBVIEW:
+ return extend(appState, {
+ buyView: {
+ subview: 'buyForm',
+ formView: {
+ coinbase: false,
+ shapeshift: true,
+ marketinfo: action.value.marketinfo,
+ coinOptions: action.value.coinOptions,
+ },
+ buyAddress: appState.buyView.buyAddress,
+ amount: appState.buyView.amount,
+ },
+ })
+
+ case actions.PAIR_UPDATE:
+ return extend(appState, {
+ buyView: {
+ subview: 'buyForm',
+ formView: {
+ coinbase: false,
+ shapeshift: true,
+ marketinfo: action.value.marketinfo,
+ coinOptions: appState.buyView.formView.coinOptions,
+ },
+ buyAddress: appState.buyView.buyAddress,
+ amount: appState.buyView.amount,
+ warning: null,
+ },
+ })
+
+ case actions.SHOW_QR:
+ return extend(appState, {
+ qrRequested: true,
+ transForward: true,
+ Qr: {
+ message: action.value.message,
+ image: action.value.qr,
+ data: action.value.data,
},
})
default: