18874: Add 'services/workbench2/' from commit 'f6f88d9ca9cdeeeebfadcfe999789bfb9f69e5c6'
[arvados.git] / services / workbench2 / src / store / side-panel / side-panel-action.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { Dispatch } from 'redux';
6 import { navigateTo } from 'store/navigation/navigation-action';
7
8 export const sidePanelActions = {
9     TOGGLE_COLLAPSE: 'TOGGLE_COLLAPSE'
10 }
11
12 export const navigateFromSidePanel = (id: string) =>
13     (dispatch: Dispatch) => {
14         dispatch<any>(navigateTo(id));
15     };
16
17 export const toggleSidePanel = (collapsedState: boolean) => {
18     return (dispatch) => {
19         dispatch({type: sidePanelActions.TOGGLE_COLLAPSE, payload: !collapsedState})
20     }
21 }