summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/viewer.reducer.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-10-02 15:40:13 +0200
committerJules Laplace <julescarbon@gmail.com>2020-10-02 15:40:13 +0200
commit2aa9ed562116225b155f8dec5616cf06c82ac446 (patch)
tree2ec15d2b3c7a3899cffbf12264791fdebe1778b1 /animism-align/frontend/app/views/viewer/viewer.reducer.js
parentc05f49f1cd5683b868c82e453a76aec185bcbe01 (diff)
convoluted forms of UI click logic
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,