about summary refs log tree commit diff
path: root/app/javascript/mastodon/reducers/modal.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/javascript/mastodon/reducers/modal.js')
-rw-r--r--app/javascript/mastodon/reducers/modal.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/javascript/mastodon/reducers/modal.js b/app/javascript/mastodon/reducers/modal.js
new file mode 100644
index 000000000..3566820ef
--- /dev/null
+++ b/app/javascript/mastodon/reducers/modal.js
@@ -0,0 +1,18 @@
+import { MODAL_OPEN, MODAL_CLOSE } from '../actions/modal';
+import Immutable from 'immutable';
+
+const initialState = {
+  modalType: null,
+  modalProps: {}
+};
+
+export default function modal(state = initialState, action) {
+  switch(action.type) {
+  case MODAL_OPEN:
+    return { modalType: action.modalType, modalProps: action.modalProps };
+  case MODAL_CLOSE:
+    return initialState;
+  default:
+    return state;
+  }
+};