Skip to content

Commit

Permalink
fix(trackerForm): disable add defaultComp if already full
Browse files Browse the repository at this point in the history
  • Loading branch information
Clm-Roig committed Apr 23, 2022
1 parent 8a4e515 commit 2198eb3
Showing 1 changed file with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
IconButton,
InputLabel,
MenuItem,
Tooltip,
Typography,
useTheme
} from '@mui/material';
Expand Down Expand Up @@ -165,13 +166,24 @@ const DefaultCompletionsForm: FC<Props> = ({
</Grid>
</FieldsetGrid>
))}
<Button
onClick={() => append({})}
startIcon={<AddCircleOutlineIcon />}
sx={{ mb: 2 }}
variant="contained">
Réalisation par défaut
</Button>

<Tooltip
title={
requiredCompletions.length === defaultCompletions.length
? 'Tous les objectifs ont déjà une réalisation par défaut.'
: ''
}>
<span>
<Button
disabled={requiredCompletions.length === defaultCompletions.length}
onClick={() => append({})}
startIcon={<AddCircleOutlineIcon />}
sx={{ mb: 2 }}
variant="contained">
Réalisation par défaut
</Button>
</span>
</Tooltip>
</Box>
);
};
Expand Down

0 comments on commit 2198eb3

Please sign in to comment.