Commit 85d181ad authored by Florent Chehab's avatar Florent Chehab

Merge branch 'fix/tweaksFirstRowModuleWrapper' into 'master'

Don't show a badge if nbversion <= 1 & fixed bug related to opening the moderation panel.

See merge request !60
parents 942857c3 43debf33
Pipeline #36166 passed with stages
in 5 minutes
...@@ -10,7 +10,7 @@ import Badge from "@material-ui/core/Badge"; ...@@ -10,7 +10,7 @@ import Badge from "@material-ui/core/Badge";
* @returns * @returns
*/ */
export default function MyBadge(props) { export default function MyBadge(props) {
if (props.badgeContent) { if (props.badgeContent > 1) {
return ( return (
<Badge badgeContent={props.badgeContent} color={props.color} max={5} > <Badge badgeContent={props.badgeContent} color={props.color} max={5} >
{props.children} {props.children}
......
...@@ -42,7 +42,7 @@ export default function renderFirstRow(userCanModerate) { ...@@ -42,7 +42,7 @@ export default function renderFirstRow(userCanModerate) {
<Tooltip title={moderTooltip} placement="top"> <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!! */} <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"> <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]} /> <VerifiedUserIcon className={classes[moderClass]} />
</IconButton> </IconButton>
</MyBadge> </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