diff options
author | Frankie <frankie.pangilinan@consensys.net> | 2016-08-13 06:41:59 +0800 |
---|---|---|
committer | Frankie <frankie.pangilinan@consensys.net> | 2016-08-13 06:41:59 +0800 |
commit | b4c9a5225947f9aadac5fd1bb23fde64740d774a (patch) | |
tree | bd6af9ce87c7cbedc6aa2a6afe0e7f6ce424b49f /ui/app/reducers | |
parent | 2fc26fb264ba0df7e4fc60128c6cbe19d3141beb (diff) | |
download | tangerine-wallet-browser-b4c9a5225947f9aadac5fd1bb23fde64740d774a.tar tangerine-wallet-browser-b4c9a5225947f9aadac5fd1bb23fde64740d774a.tar.gz tangerine-wallet-browser-b4c9a5225947f9aadac5fd1bb23fde64740d774a.tar.bz2 tangerine-wallet-browser-b4c9a5225947f9aadac5fd1bb23fde64740d774a.tar.lz tangerine-wallet-browser-b4c9a5225947f9aadac5fd1bb23fde64740d774a.tar.xz tangerine-wallet-browser-b4c9a5225947f9aadac5fd1bb23fde64740d774a.tar.zst tangerine-wallet-browser-b4c9a5225947f9aadac5fd1bb23fde64740d774a.zip |
Change buy forms so that they are their own view and add Qr-code
Diffstat (limited to 'ui/app/reducers')
-rw-r--r-- | ui/app/reducers/app.js | 60 |
1 files changed, 27 insertions, 33 deletions
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index 3b23ce005..95b60f929 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -378,17 +378,17 @@ function reduceApp (state, action) { }, }) - case actions.BUY_ETH_SUBVIEW: + case actions.BUY_ETH_VIEW: return extend(appState, { transForward: true, currentView: { - name: 'accountDetail', + name: 'buyEth', context: appState.currentView.context, }, - accountDetail: { + buyView: { subview: 'buyForm', amount: '5.00', - buyAddress: appState.currentView.context, + buyAddress: action.value, formView: { coinbase: true, shapeshift: false, @@ -398,46 +398,46 @@ function reduceApp (state, action) { case actions.UPDATE_BUY_ADDRESS: return extend(appState, { - accountDetail: { + buyView: { subview: 'buyForm', formView: { - coinbase: true, - shapeshift: false, + coinbase: appState.buyView.formView.coinbase, + shapeshift: appState.buyView.formView.shapeshift, }, buyAddress: action.value, - amount: appState.accountDetail.amount, + amount: appState.buyView.amount, }, }) case actions.UPDATE_COINBASE_AMOUNT: return extend(appState, { - accountDetail: { + buyView: { subview: 'buyForm', formView: { coinbase: true, shapeshift: false, }, - buyAddress: appState.accountDetail.buyAddress, + buyAddress: appState.buyView.buyAddress, amount: action.value, }, }) case actions.COINBASE_SUBVIEW: return extend(appState, { - accountDetail: { + buyView: { subview: 'buyForm', formView: { coinbase: true, shapeshift: false, }, - buyAddress: appState.accountDetail.buyAddress, - amount: appState.accountDetail.amount, + buyAddress: appState.buyView.buyAddress, + amount: appState.buyView.amount, }, }) case actions.SHAPESHIFT_SUBVIEW: return extend(appState, { - accountDetail: { + buyView: { subview: 'buyForm', formView: { coinbase: false, @@ -445,41 +445,35 @@ function reduceApp (state, action) { marketinfo: action.value.marketinfo, coinOptions: action.value.coinOptions, }, - buyAddress: appState.accountDetail.buyAddress, - amount: appState.accountDetail.amount, + buyAddress: appState.buyView.buyAddress, + amount: appState.buyView.amount, }, }) case actions.PAIR_UPDATE: return extend(appState, { - accountDetail: { + buyView: { subview: 'buyForm', formView: { coinbase: false, shapeshift: true, marketinfo: action.value.marketinfo, - coinOptions: appState.accountDetail.formView.coinOptions, + coinOptions: appState.buyView.formView.coinOptions, }, - buyAddress: appState.accountDetail.buyAddress, - amount: appState.accountDetail.amount, + buyAddress: appState.buyView.buyAddress, + amount: appState.buyView.amount, warning: null, }, }) - case actions.COIN_SHIFT_REQUEST: + case actions.SHOW_QR: return extend(appState, { - accountDetail: { - subview: 'buyForm', - formView: { - coinbase: false, - shapeshift: true, - marketinfo: appState.accountDetail.formView.marketinfo, - coinOptions: appState.accountDetail.formView.coinOptions, - response: action.value.response, - }, - buyAddress: appState.accountDetail.buyAddress, - amount: appState.accountDetail.amount, - warning: null, + qrRequested: true, + transForward: true, + Qr: { + message: action.value.message, + image: action.value.qr, + data: action.value.data, }, }) default: |