diff options
Diffstat (limited to 'src/reducers/modals.js')
| -rw-r--r-- | src/reducers/modals.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/reducers/modals.js b/src/reducers/modals.js new file mode 100644 index 00000000..e74b66b9 --- /dev/null +++ b/src/reducers/modals.js @@ -0,0 +1,30 @@ +import {combineReducers} from "redux"; +import {CLOSE_DELETE_PROFILE_MODAL, OPEN_DELETE_PROFILE_MODAL} from "../actions/profile"; +import {CLOSE_NEW_SIMULATION_MODAL, OPEN_NEW_SIMULATION_MODAL} from "../actions/simulations"; + +function newSimulationModalVisible(state = false, action) { + switch (action.type) { + case OPEN_NEW_SIMULATION_MODAL: + return true; + case CLOSE_NEW_SIMULATION_MODAL: + return false; + default: + return state; + } +} + +function deleteProfileModalVisible(state = false, action) { + switch (action.type) { + case OPEN_DELETE_PROFILE_MODAL: + return true; + case CLOSE_DELETE_PROFILE_MODAL: + return false; + default: + return state; + } +} + +export const modals = combineReducers({ + newSimulationModalVisible, + deleteProfileModalVisible, +}); |
