Use one const for action and component
[arvados-workbench2.git] / src / store / details-panel / details-panel-action.ts
index ed717165515435fc2eee433a7feb36e1cc8f0c15..0f13286535630a46b479d5a31e2423908513d249 100644 (file)
@@ -5,6 +5,8 @@
 import { unionize, ofType, UnionOf } from '~/common/unionize';
 import { Dispatch } from 'redux';
 
+export const SLIDE_TIMEOUT = 500;
+
 export const detailsPanelActions = unionize({
     TOGGLE_DETAILS_PANEL: ofType<{}>(),
     LOAD_DETAILS_PANEL: ofType<string>()
@@ -17,9 +19,8 @@ export const loadDetailsPanel = (uuid: string) => detailsPanelActions.LOAD_DETAI
 export const toggleDetailsPanel = () => (dispatch: Dispatch) => {
     // because of material-ui issue resizing details panel breaks tabs.
     // triggering window resize event fixes that.
-    const detailsPanelAnimationDuration = 500;
     setTimeout(() => {
         window.dispatchEvent(new Event('resize'));
-    }, detailsPanelAnimationDuration);
+    }, SLIDE_TIMEOUT);
     dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());
 };