summaryrefslogtreecommitdiff
path: root/src/reducers/modals.js
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-08-19 15:39:58 +0200
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-23 10:05:43 +0200
commit19033b8460cb43dc2fa34a2cffa932b5efe111ca (patch)
tree79bde2093acce8d8192d27e288d61bc53cf99e07 /src/reducers/modals.js
parent434be6d21ad665cb6abdf5138d0c563efbfe00b4 (diff)
Add profile page
Diffstat (limited to 'src/reducers/modals.js')
-rw-r--r--src/reducers/modals.js30
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,
+});