1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { Dispatch } from 'redux';
6 import { navigateTo } from 'store/navigation/navigation-action';
8 export const sidePanelActions = {
9 TOGGLE_COLLAPSE: 'TOGGLE_COLLAPSE',
10 SET_CURRENT_WIDTH: 'SET_CURRENT_WIDTH'
13 export const navigateFromSidePanel = (id: string) =>
14 (dispatch: Dispatch) => {
15 dispatch<any>(navigateTo(id));
18 export const toggleSidePanel = (collapsedState: boolean) => {
19 return (dispatch) => {
20 dispatch({type: sidePanelActions.TOGGLE_COLLAPSE, payload: !collapsedState})
24 export const setCurrentSideWidth = (width: number) => {
25 return (dispatch) => {
26 dispatch({type: sidePanelActions.SET_CURRENT_WIDTH, payload: width})