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/index.js4
-rw-r--r--web/src/js/ducks/view.js50
2 files changed, 53 insertions, 1 deletions
diff --git a/web/src/js/ducks/index.js b/web/src/js/ducks/index.js
index 6c521a70..2638272d 100644
--- a/web/src/js/ducks/index.js
+++ b/web/src/js/ducks/index.js
@@ -2,11 +2,13 @@ import {combineReducers} from 'redux'
import eventLog from './eventLog'
import websocket from './websocket'
import flows from './flows'
+import view from './view'
const rootReducer = combineReducers({
eventLog,
websocket,
flows,
+ view
})
-export default rootReducer \ No newline at end of file
+export default rootReducer
diff --git a/web/src/js/ducks/view.js b/web/src/js/ducks/view.js
new file mode 100644
index 00000000..8a4c25a1
--- /dev/null
+++ b/web/src/js/ducks/view.js
@@ -0,0 +1,50 @@
+const ACTIVE_MENU = 'ACTIVE_MENU'
+const DEFAULT_MENU = 'DEFAULT_MENU'
+const FLOW_MENU = 'FLOW_MENU'
+
+
+const defaultState = {
+ active_menu: 'Start',
+}
+export default function reducer(state = defaultState, action) {
+ switch (action.type) {
+ case ACTIVE_MENU:
+ return {
+ ...state,
+ active_menu: action.active_menu
+ }
+ case DEFAULT_MENU:
+ return {
+ ...state,
+ active_menu: defaultState.active_menu
+ }
+ case FLOW_MENU:
+ return {
+ ... state,
+ active_menu: "Flow"
+ }
+
+
+ default:
+ return state
+ }
+}
+
+export function setDefaultMenu(active_menu) {
+ return {
+ type: DEFAULT_MENU,
+ }
+}
+export function setFlowMenu() {
+ return {
+ type: FLOW_MENU,
+ }
+}
+
+export function setActiveMenu(active_menu) {
+ return {
+ type: ACTIVE_MENU,
+ active_menu
+ }
+}
+