Commit 43debf33 authored by Florent Chehab's avatar Florent Chehab

Don't show a badge if nbversion <= 1

fixed bug related to opening the moderation panel.
parent 942857c3
Pipeline #36165 passed with stages
in 4 minutes and 47 seconds
......@@ -10,7 +10,7 @@ import Badge from "@material-ui/core/Badge";
* @returns
*/
export default function MyBadge(props) {
if (props.badgeContent) {
if (props.badgeContent > 1) {
return (
<Badge badgeContent={props.badgeContent} color={props.color} max={5} >
{props.children}
......
......@@ -42,7 +42,7 @@ export default function renderFirstRow(userCanModerate) {
<Tooltip title={moderTooltip} placement="top">
<div style={{ display: "inline-block" }}> {/* Needed to fire events for the tooltip when below is disabled! when below is disabled!! */}
<MyBadge className={classes.badge} badgeContent={nbPendingModeration} color="secondary">
<IconButton aria-label="Modération" disabled={moderClass == "disabled" || moderClass == "green"} onClick={() => this.handleOpenPendingModeration()} className={classes.button}>
<IconButton aria-label="Modération" disabled={moderClass == "disabled" || moderClass == "green"} onClick={() => this.openPendingModerationPanel()} className={classes.button}>
<VerifiedUserIcon className={classes[moderClass]} />
</IconButton>
</MyBadge>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment