Merge branch 'master' of git.curoverse.com:arvados-workbench2 into 14433_properties_i...
[arvados-workbench2.git] / src / views-components / main-content-bar / main-content-bar.tsx
index 41442bba0d395e0f02f43d4ae6b3adb3bab00cbb..b0478377ba1a8f05490a662966a0cd7755d4bfc8 100644 (file)
@@ -10,22 +10,23 @@ import { detailsPanelActions } from "~/store/details-panel/details-panel-action"
 import { connect } from 'react-redux';
 import { RootState } from '~/store/store';
 import { matchWorkflowRoute } from '~/routes/routes';
+import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
 
 interface MainContentBarProps {
     onDetailsPanelToggle: () => void;
     buttonVisible: boolean;
 }
 
-const isButtonVisible = ({ router }: RootState) => {
+const isWorkflowPath = ({ router }: RootState) => {
     const pathname = router.location ? router.location.pathname : '';
-    const match = !matchWorkflowRoute(pathname);
+    const match = matchWorkflowRoute(pathname);
     return !!match;
 };
 
 export const MainContentBar = connect((state: RootState) => ({
-    buttonVisible: isButtonVisible(state)
+    buttonVisible: !isWorkflowPath(state)
 }), {
-        onDetailsPanelToggle: detailsPanelActions.TOGGLE_DETAILS_PANEL
+        onDetailsPanelToggle: toggleDetailsPanel
     })((props: MainContentBarProps) =>
         <Toolbar>
             <Grid container>