Merge branch '19434-collapse-left-panel' closes #19434
[arvados-workbench2.git] / src / store / side-panel / side-panel-reducer.tsx
diff --git a/src/store/side-panel/side-panel-reducer.tsx b/src/store/side-panel/side-panel-reducer.tsx
new file mode 100644 (file)
index 0000000..a6ed03b
--- /dev/null
@@ -0,0 +1,18 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { sidePanelActions } from "./side-panel-action"
+
+interface SidePanelState {
+  collapsedState: boolean
+}
+
+const sidePanelInitialState = {
+  collapsedState: false
+}
+
+export const sidePanelReducer = (state: SidePanelState = sidePanelInitialState, action)=>{
+  if(action.type === sidePanelActions.TOGGLE_COLLAPSE) return {...state, collapsedState: action.payload}
+  return state
+}
\ No newline at end of file