import { connect } from 'react-redux';
import { RootState } from '~/store/store';
import { matchWorkflowRoute } from '~/routes/routes';
+import { matchVirtualMachineRoute } from '~/routes/routes';
interface MainContentBarProps {
onDetailsPanelToggle: () => void;
return !!match;
};
+const isVirtualMachinePath = ({ router }: RootState) => {
+ const pathname = router.location ? router.location.pathname : '';
+ const match = matchVirtualMachineRoute(pathname);
+ return !!match;
+};
+
export const MainContentBar = connect((state: RootState) => ({
- buttonVisible: !isWorkflowPath(state)
+ buttonVisible: !isWorkflowPath(state) && !isVirtualMachinePath(state)
}), {
onDetailsPanelToggle: detailsPanelActions.TOGGLE_DETAILS_PANEL
})((props: MainContentBarProps) =>
<Breadcrumbs />
</Grid>
<Grid item>
- {props.buttonVisible ? <Tooltip title="Additional Info">
+ {props.buttonVisible && <Tooltip title="Additional Info">
<IconButton color="inherit" onClick={props.onDetailsPanelToggle}>
<DetailsIcon />
</IconButton>
- </Tooltip> : null}
+ </Tooltip>}
</Grid>
</Grid>
</Toolbar>);