aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/ducks
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/js/ducks')
-rw-r--r--web/src/js/ducks/ui.js40
1 files changed, 26 insertions, 14 deletions
diff --git a/web/src/js/ducks/ui.js b/web/src/js/ducks/ui.js
index f8234fdb..f513f49c 100644
--- a/web/src/js/ducks/ui.js
+++ b/web/src/js/ducks/ui.js
@@ -1,42 +1,54 @@
-import {SELECT} from "./views/main"
-export const SET_ACTIVE_MENU = 'SET_ACTIVE_MENU';
+import { SELECT as SELECT_FLOW } from './views/main'
+export const SET_ACTIVE_MENU = 'UI_SET_ACTIVE_MENU'
+export const SET_CONTENT_VIEW = 'UI_SET_CONTENT_VIEW'
const defaultState = {
activeMenu: 'Start',
+ contentView: 'ViewAuto',
}
+
export default function reducer(state = defaultState, action) {
switch (action.type) {
+
case SET_ACTIVE_MENU:
return {
...state,
- activeMenu: action.activeMenu
+ activeMenu: action.activeMenu,
}
- case SELECT:
- let isNewSelect = (action.flowId && !action.currentSelection)
- let isDeselect = (!action.flowId && action.currentSelection)
- if(isNewSelect) {
+
+ case SELECT_FLOW:
+ if (action.flowId && !action.currentSelection) {
return {
...state,
- activeMenu: "Flow"
+ activeMenu: 'Flow',
}
}
- if(isDeselect && state.activeMenu === "Flow") {
+
+ if (!action.flowId && state.activeMenu === 'Flow') {
return {
...state,
- activeMenu: "Start"
+ activeMenu: 'Start',
}
}
+
return state
+
+ case SET_CONTENT_VIEW:
+ return {
+ ...state,
+ contentView: action.contentView,
+ }
+
default:
return state
}
}
export function setActiveMenu(activeMenu) {
- return {
- type: SET_ACTIVE_MENU,
- activeMenu
- }
+ return { type: SET_ACTIVE_MENU, activeMenu }
}
+export function setContentView(contentView) {
+ return { type: SET_CONTENT_VIEW, contentView }
+}