X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/185f57cf4371e7811077bee56976028dd640688d..cc72c29b709759a4498ad232e3f0374e857c7a62:/src/views-components/main-content-bar/main-content-bar.tsx diff --git a/src/views-components/main-content-bar/main-content-bar.tsx b/src/views-components/main-content-bar/main-content-bar.tsx index b0478377..66d7cabc 100644 --- a/src/views-components/main-content-bar/main-content-bar.tsx +++ b/src/views-components/main-content-bar/main-content-bar.tsx @@ -6,10 +6,9 @@ import * as React from "react"; import { Toolbar, IconButton, Tooltip, Grid } from "@material-ui/core"; import { DetailsIcon } from "~/components/icon/icon"; import { Breadcrumbs } from "~/views-components/breadcrumbs/breadcrumbs"; -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 { matchWorkflowRoute, matchSshKeysRoute, matchRepositoriesRoute, matchVirtualMachineRoute, matchKeepServicesRoute } from '~/routes/routes'; import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action'; interface MainContentBarProps { @@ -17,14 +16,14 @@ interface MainContentBarProps { buttonVisible: boolean; } -const isWorkflowPath = ({ router }: RootState) => { +const isButtonVisible = ({ router }: RootState) => { const pathname = router.location ? router.location.pathname : ''; - const match = matchWorkflowRoute(pathname); - return !!match; + return !matchWorkflowRoute(pathname) && !matchVirtualMachineRoute(pathname) && + !matchRepositoriesRoute(pathname) && !matchSshKeysRoute(pathname) && !matchKeepServicesRoute(pathname); }; export const MainContentBar = connect((state: RootState) => ({ - buttonVisible: !isWorkflowPath(state) + buttonVisible: isButtonVisible(state) }), { onDetailsPanelToggle: toggleDetailsPanel })((props: MainContentBarProps) => @@ -34,11 +33,11 @@ export const MainContentBar = connect((state: RootState) => ({ - {props.buttonVisible ? + {props.buttonVisible && - : null} + } );