summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/viewer.reducer.js
diff options
context:
space:
mode:
Diffstat (limited to 'animism-align/frontend/app/views/viewer/viewer.reducer.js')
-rw-r--r--animism-align/frontend/app/views/viewer/viewer.reducer.js22
1 files changed, 17 insertions, 5 deletions
diff --git a/animism-align/frontend/app/views/viewer/viewer.reducer.js b/animism-align/frontend/app/views/viewer/viewer.reducer.js
index bb36d61..d8ffd34 100644
--- a/animism-align/frontend/app/views/viewer/viewer.reducer.js
+++ b/animism-align/frontend/app/views/viewer/viewer.reducer.js
@@ -1,15 +1,20 @@
import * as types from 'app/types'
import { GROWL } from 'app/constants'
+const navComponents = {
+ /* UI components that close if anything else opens */
+ share: false,
+ subscribe: false,
+ footnotes: false,
+}
+
const initialState = {
/* UI component display state */
- transcript: false,
- checklist: false,
+ ...navComponents,
nav: false,
- share: false,
credits: false,
- subscribe: false,
- footnotes: false,
+ checklist: false,
+ transcript: false,
/* section look and navigation */
sections: { loading: true },
@@ -47,6 +52,13 @@ export default function viewerReducer(state = initialState, action) {
[action.key]: action.value,
}
+ case types.viewer.toggle_nav_component:
+ return {
+ ...state,
+ ...navComponents,
+ [action.key]: action.value,
+ }
+
case types.audio.play:
return {
...state,