Merge branch '21128-toolbar-context-menu'
[arvados-workbench2.git] / 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 }