From 2aa9ed562116225b155f8dec5616cf06c82ac446 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 2 Oct 2020 15:40:13 +0200 Subject: convoluted forms of UI click logic --- .../frontend/app/views/viewer/viewer.reducer.js | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'animism-align/frontend/app/views/viewer/viewer.reducer.js') 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, -- cgit v1.2.3-70-g09d2