Prevent display error when no parole for an artist

This commit is contained in:
2023-03-19 21:35:33 +04:00
parent ff7377f20a
commit cb049886bb
2 changed files with 26 additions and 20 deletions
+10 -6
View File
@@ -85,12 +85,16 @@ export default function AwtisDetay({anAwtis}) {
</AccordionDetails> </AccordionDetails>
</Accordion> </Accordion>
) : ( ) : (
<> paroles.data.length === 0 ? (
<Typography gutterBottom textAlign='center' variant='body1' component='h2'><strong>Parole</strong></Typography> <Typography gutterBottom textAlign='center' variant='body1' component='h2'><strong>Aucune parole pour le moment</strong></Typography>
<Paper> ) : (
<MizikLis paroles={paroles.data} /> <>
</Paper> <Typography gutterBottom textAlign='center' variant='body1' component='h2'><strong>Parole</strong></Typography>
</> <Paper>
<MizikLis paroles={paroles.data} />
</Paper>
</>
)
)} )}
</Box> </Box>
</Grid> </Grid>
+16 -14
View File
@@ -86,24 +86,26 @@ export default function AwtisKat({artiste}) {
{alias} {alias}
</Typography> </Typography>
<Typography align='center' variant='body2' color='textSecondary' component='h5'> <Typography align='center' variant='body2' color='textSecondary' component='h5'>
{`${paroles.data.length} ${paroles.data.length > 1 ? 'paroles' : 'parole'}`} {`${paroles.data.length === 0 ? 'Aucune parole pour le moment' : `${paroles.data.length} ${paroles.data.length > 1 ? 'paroles' : 'parole'}`}`}
</Typography> </Typography>
</CardContent> </CardContent>
</CardActionArea> </CardActionArea>
<CardActions disableSpacing> {paroles.data.length > 0 && (
<IconButton <CardActions disableSpacing>
className={clsx(classes.expand, { <IconButton
[classes.expandOpen]: expanded className={clsx(classes.expand, {
})} [classes.expandOpen]: expanded
aria-expanded={expanded} })}
aria-label='show more' aria-expanded={expanded}
size='large' aria-label='show more'
onClick={handleExpandClick} size='large'
> onClick={handleExpandClick}
<ExpandMoreIcon /> >
</IconButton> <ExpandMoreIcon />
</CardActions> </IconButton>
</CardActions>
)}
<Collapse unmountOnExit in={expanded} timeout='auto'> <Collapse unmountOnExit in={expanded} timeout='auto'>
<CardContent> <CardContent>
<MizikLis paroles={paroles.data} /> <MizikLis paroles={paroles.data} />