Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

add ui module with distractionfreemode state, pass state to components to hide, WIP initial toolbar invoke

Edward Plato438ea754a22a
diff --git a/web/js/modules/ui/actions.js b/web/js/modules/ui/actions.js
new file mode 100644
index 000000000..b97ca2080
--- /dev/null
+++ b/web/js/modules/ui/actions.js
@@ -0,0 +1,9 @@
+import { TOGGLE_DISTRACTION_FREE_MODE } from './constants';
+
+export function toggleDistractionFreeMode() {
+ return (dispatch) => {
+ dispatch({
+ type: TOGGLE_DISTRACTION_FREE_MODE
+ });
+ };
+}
diff --git a/web/js/modules/ui/constants.js b/web/js/modules/ui/constants.js
new file mode 100644
index 000000000..107968a74
--- /dev/null
+++ b/web/js/modules/ui/constants.js
@@ -0,0 +1 @@
+export const TOGGLE_DISTRACTION_FREE_MODE = 'UI/TOGGLE_DISTRACTION_FREE_MODE';
diff --git a/web/js/modules/ui/reducers.js b/web/js/modules/ui/reducers.js
new file mode 100644
index 000000000..0315bd003
--- /dev/null
+++ b/web/js/modules/ui/reducers.js
@@ -0,0 +1,17 @@
+import { TOGGLE_DISTRACTION_FREE_MODE } from './constants';
+import { assign as lodashAssign } from 'lodash';
+
+export const uiState = {
+ isDistractionFreeModeActive: false
+};
+
+export default function uiReducers(state = uiState, action) {
+ switch (action.type) {
+ case TOGGLE_DISTRACTION_FREE_MODE:
+ return lodashAssign({}, state, {
+ isDistractionFreeModeActive: !state.isDistractionFreeModeActive
+ });
+ default:
+ return state;
+ }
+}