import { AddIcon, CollectionIcon, ProcessIcon, ProjectIcon } from '~/components/icon/icon';
import { openProjectCreateDialog } from '~/store/projects/project-create-actions';
import { openCollectionCreateDialog } from '~/store/collections/collection-create-actions';
-import { matchProjectRoute } from '~/routes/routes';
import { navigateToRunProcess } from '~/store/navigation/navigation-action';
import { runProcessPanelActions } from '~/store/run-process-panel/run-process-panel-actions';
interface SidePanelDataProps {
currentItemId: string;
- buttonVisible: boolean;
}
interface SidePanelState {
horizontal: 0
};
-const isButtonVisible = ({ router }: RootState) => {
- const pathname = router.location ? router.location.pathname : '';
- const match = matchProjectRoute(pathname);
- return !!match;
-};
-
export const SidePanelButton = withStyles(styles)(
connect((state: RootState) => ({
- currentItemId: getProperty(PROJECT_PANEL_CURRENT_UUID)(state.properties),
- buttonVisible: isButtonVisible(state)
+ currentItemId: getProperty(PROJECT_PANEL_CURRENT_UUID)(state.properties)
}))(
class extends React.Component<SidePanelProps> {
};
render() {
- const { classes, buttonVisible } = this.props;
+ const { classes } = this.props;
const { anchorEl } = this.state;
return <Toolbar>
- {buttonVisible && <Grid container>
+ <Grid container>
<Grid container item xs alignItems="center" justify="flex-start">
<Button variant="contained" color="primary" size="small" className={classes.button}
aria-owns={anchorEl ? 'aside-menu-list' : undefined}
</MenuItem>
</Menu>
</Grid>
- </Grid>}
+ </Grid>
</Toolbar>;
}