Feature #14137
Arvados-DCO-1.1-Signed-off-by: Janicki Artur <artur.janicki@contractors.roche.com>
interface SidePanelDataProps {
currentItemId: string;
interface SidePanelDataProps {
currentItemId: string;
+ buttonVisible: boolean;
}
interface SidePanelState {
}
interface SidePanelState {
-const checkButtonVisibility = ({ router }: RootState) => {
+const isButtonVisible = ({ router }: RootState) => {
const pathname = router.location ? router.location.pathname : '';
const match = matchProjectRoute(pathname);
return !!match;
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),
export const SidePanelButton = withStyles(styles)(
connect((state: RootState) => ({
currentItemId: getProperty(PROJECT_PANEL_CURRENT_UUID)(state.properties),
- showButton: checkButtonVisibility(state)
+ buttonVisible: isButtonVisible(state)
}))(
class extends React.Component<SidePanelProps> {
}))(
class extends React.Component<SidePanelProps> {
- const { classes, showButton } = this.props;
+ const { classes, buttonVisible } = this.props;
const { anchorEl } = this.state;
return <Toolbar>
const { anchorEl } = this.state;
return <Toolbar>
- {showButton && <Grid container>
+ {buttonVisible && <Grid container>
<Grid container item xs alignItems="center" justify="center">
<Button variant="contained" color="primary" size="small" className={classes.button}
aria-owns={anchorEl ? 'aside-menu-list' : undefined}
<Grid container item xs alignItems="center" justify="center">
<Button variant="contained" color="primary" size="small" className={classes.button}
aria-owns={anchorEl ? 'aside-menu-list' : undefined}