added side-panel-reducer file, minor code cleanup Arvados-DCO-1.1-Signed-off-by:...
[arvados-workbench2.git] / src / store / side-panel / side-panel-action.ts
index 9e8da28307fc410467c594ba75d702e96f9d5db8..e4f53ceaa6be6df93c35c0831fb4d8c93d986d59 100644 (file)
@@ -5,7 +5,17 @@
 import { Dispatch } from 'redux';
 import { navigateTo } from 'store/navigation/navigation-action';
 
+export const sidePanelActions = {
+    TOGGLE_COLLAPSE: 'TOGGLE_COLLAPSE'
+}
+
 export const navigateFromSidePanel = (id: string) =>
     (dispatch: Dispatch) => {
         dispatch<any>(navigateTo(id));
     };
+
+export const toggleSidePanel = (collapsedState: boolean) => {
+    return (dispatch) => {
+        dispatch({type: sidePanelActions.TOGGLE_COLLAPSE, payload: !collapsedState})
+    }
+}
\ No newline at end of file