Use one const for action and component 14420-tabs-underline-issue
authorPawel Kromplewski <pawel.kromplewski@contractors.roche.com>
Wed, 14 Nov 2018 12:52:41 +0000 (13:52 +0100)
committerPawel Kromplewski <pawel.kromplewski@contractors.roche.com>
Wed, 14 Nov 2018 12:52:41 +0000 (13:52 +0100)
Feature #14420

Arvados-DCO-1.1-Signed-off-by: Pawel Kromplewski <pawel.kromplewski@contractors.roche.com>

src/store/details-panel/details-panel-action.ts
src/views-components/details-panel/details-panel.tsx

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());
 };
index 113cf09611e634a9c6464d48f00a392aee7c3a74..fe434b6c731aef10539945b662cb36bec2c8b9dd 100644 (file)
@@ -10,7 +10,6 @@ import { ArvadosTheme } from '~/common/custom-theme';
 import * as classnames from "classnames";
 import { connect } from 'react-redux';
 import { RootState } from '~/store/store';
-import { detailsPanelActions } from "~/store/details-panel/details-panel-action";
 import { CloseIcon } from '~/components/icon/icon';
 import { EmptyResource } from '~/models/empty';
 import { Dispatch } from "redux";
@@ -24,12 +23,11 @@ import { DetailsResource } from "~/models/details";
 import { getResource } from '~/store/resources/resources';
 import { ResourceData } from "~/store/resources-data/resources-data-reducer";
 import { getResourceData } from "~/store/resources-data/resources-data";
-import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
+import { toggleDetailsPanel, SLIDE_TIMEOUT } from '~/store/details-panel/details-panel-action';
 
 type CssRules = 'root' | 'container' | 'opened' | 'headerContainer' | 'headerIcon' | 'tabContainer';
 
 const DRAWER_WIDTH = 320;
-const SLIDE_TIMEOUT = 500;
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     root: {
         background: theme.palette.background.paper,