Merge branch 'master' into 14137-new-button
[arvados.git] / src / views-components / side-panel-button / side-panel-button.tsx
index 80b3163f8f2e93e16888d11a1e0fa03ad14c729f..e39b3782739adbfe48b367c6334c1b8ab18406cf 100644 (file)
@@ -34,7 +34,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 
 interface SidePanelDataProps {
     currentItemId: string;
-    showButton: boolean;
+    buttonVisible: boolean;
 }
 
 interface SidePanelState {
@@ -48,16 +48,16 @@ const transformOrigin: PopoverOrigin = {
     horizontal: 45
 };
 
-const checkButtonVisibility = ({ router }: RootState) => {
+const isButtonVisible = ({ router }: RootState) => {
     const pathname = router.location ? router.location.pathname : '';
     const match = matchProjectRoute(pathname);
-    return match ? true : false;
+    return !!match;
 };
 
 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> {
 
@@ -66,10 +66,10 @@ export const SidePanelButton = withStyles(styles)(
             };
 
             render() {
-                const { classes, showButton } = this.props;
+                const { classes, buttonVisible  } = this.props;
                 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}