aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/reducers
diff options
context:
space:
mode:
authorsdtsui <szehungdanieltsui@gmail.com>2017-08-21 09:32:58 +0800
committersdtsui <szehungdanieltsui@gmail.com>2017-08-21 09:32:58 +0800
commit4e9376ca7129611d12a7ec263741f1dee0e4d79c (patch)
treeb3dbbeebb74713a0ccf65c7d9dce5fffb42dfbca /ui/app/reducers
parente550d360842074a59832e41ce211fae7f38085cc (diff)
downloadtangerine-wallet-browser-4e9376ca7129611d12a7ec263741f1dee0e4d79c.tar.gz
tangerine-wallet-browser-4e9376ca7129611d12a7ec263741f1dee0e4d79c.tar.zst
tangerine-wallet-browser-4e9376ca7129611d12a7ec263741f1dee0e4d79c.zip
Extend modal implementation and state management to accomodate multiple modal types
Diffstat (limited to 'ui/app/reducers')
-rw-r--r--ui/app/reducers/app.js19
1 files changed, 16 insertions, 3 deletions
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js
index 3e74fb732..ea7145f22 100644
--- a/ui/app/reducers/app.js
+++ b/ui/app/reducers/app.js
@@ -36,7 +36,12 @@ function reduceApp (state, action) {
var appState = extend({
shouldClose: false,
menuOpen: false,
- modalOpen: false,
+ modal: {
+ open: false,
+ modalState: {
+ name: null,
+ },
+ },
sidebarOpen: false,
networkDropdownOpen: false,
currentView: seedWords ? seedConfView : defaultView,
@@ -77,12 +82,20 @@ function reduceApp (state, action) {
// modal methods:
case actions.MODAL_OPEN:
return extend(appState, {
- modalOpen: true,
+ modal: Object.assign(
+ state.appState.modal,
+ { open: true },
+ { modalState: action.payload },
+ ),
})
case actions.MODAL_CLOSE:
return extend(appState, {
- modalOpen: false,
+ modal: Object.assign(
+ state.appState.modal,
+ { open: false },
+ { modalState: action.payload || state.appState.modal.modalState },
+ ),
})
// transition methods