Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Rename reducer files #1553

Benjamin King01c4a9cdb074
diff --git a/web/js/modules/migration/reducer.js b/web/js/modules/migration/reducers.js
similarity index 100%
rename from web/js/modules/migration/reducer.js
rename to web/js/modules/migration/reducers.js
diff --git a/web/js/modules/modal/reducer.js b/web/js/modules/modal/reducers.js
similarity index 57%
rename from web/js/modules/modal/reducer.js
rename to web/js/modules/modal/reducers.js
index 7e2867afb..f2fa4400c 100644
--- a/web/js/modules/modal/reducer.js
+++ b/web/js/modules/modal/reducers.js
@@ -1,20 +1,24 @@
-import { TOGGLE, OPEN_CUSTOM, OPEN_BASIC } from './constants';
+import { TOGGLE, OPEN_CUSTOM, OPEN_BASIC, RENDER_TEMPLATE } from './constants';
+import { requestReducer } from '../core/reducers';
import { assign as lodashAssign } from 'lodash';
import update from 'immutability-helper';
const modalState = {
- headerText: 'header Text',
- bodyText: 'Body Text',
+ headerText: '',
+ bodyText: '',
isOpen: false,
id: '__default__',
modalClassName: '',
headerChildren: null,
bodyHeader: null,
bodyChildren: null,
- isCustom: false
+ isCustom: false,
+ bodyHTML: null
};
-
-export default function modalReducer(state = modalState, action) {
+export function modalAboutPage(state = {}, action) {
+ return requestReducer('MODAL_ABOUT_PAGE_REQUEST', state, action);
+}
+export function modalReducer(state = modalState, action) {
switch (action.type) {
case TOGGLE:
return lodashAssign({}, state, {
@@ -29,7 +33,6 @@ export default function modalReducer(state = modalState, action) {
bodyText: action.bodyText
});
case OPEN_CUSTOM:
- console.log(action, state);
return update(state, {
isOpen: { $set: action.key === state.key ? !state.isOpen : true },
isCustom: { $set: true },
@@ -37,6 +40,15 @@ export default function modalReducer(state = modalState, action) {
headerText: { $set: action.headerText },
bodyText: { $set: action.bodyText }
});
+ case RENDER_TEMPLATE:
+ return update(state, {
+ isOpen: { $set: action.key === state.key ? !state.isOpen : true },
+ isCustom: { $set: false },
+ id: { $set: action.key },
+ headerText: { $set: action.headerText },
+ bodyText: { $set: null },
+ template: { $set: action.template }
+ });
default:
return state;
}