Skip to content

Commit

Permalink
Add condition to hide Parameter button
Browse files Browse the repository at this point in the history
Signed-off-by: Lilian Houdelet <[email protected]>
  • Loading branch information
lilian-houdelet committed Dec 19, 2023
1 parent 8956c0a commit 04c899f
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions src/components/TopBar/TopBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,27 +569,29 @@ const TopBar = ({

{/* Settings */}
{/*If the callback onParametersClicked is undefined, parameters component should be disabled*/}
<StyledMenuItem
disabled={!onParametersClick}
onClick={onParametersClicked}
sx={styles.borderTop}
>
<CustomListItemIcon>
<SettingsIcon fontSize="small" />
</CustomListItemIcon>
<ListItemText>
<Typography
sx={styles.sizeLabel}
>
<FormattedMessage
id="top-bar/settings"
defaultMessage={
'Settings'
}
/>
</Typography>
</ListItemText>
</StyledMenuItem>
{onParametersClick && (
<StyledMenuItem
disabled={!onParametersClick}
onClick={onParametersClicked}
sx={styles.borderTop}
>
<CustomListItemIcon>
<SettingsIcon fontSize="small" />
</CustomListItemIcon>
<ListItemText>
<Typography
sx={styles.sizeLabel}
>
<FormattedMessage
id="top-bar/settings"
defaultMessage={
'Settings'
}
/>
</Typography>
</ListItemText>
</StyledMenuItem>
)}

{/* About */}
{/*If the callback onAboutClick is undefined, we open default about dialog*/}
Expand Down

0 comments on commit 04c899f

Please sign in to comment.