Prevent display error when no parole for an artist
This commit is contained in:
@@ -85,12 +85,16 @@ export default function AwtisDetay({anAwtis}) {
|
||||
</AccordionDetails>
|
||||
</Accordion>
|
||||
) : (
|
||||
<>
|
||||
<Typography gutterBottom textAlign='center' variant='body1' component='h2'><strong>Parole</strong></Typography>
|
||||
<Paper>
|
||||
<MizikLis paroles={paroles.data} />
|
||||
</Paper>
|
||||
</>
|
||||
paroles.data.length === 0 ? (
|
||||
<Typography gutterBottom textAlign='center' variant='body1' component='h2'><strong>Aucune parole pour le moment</strong></Typography>
|
||||
) : (
|
||||
<>
|
||||
<Typography gutterBottom textAlign='center' variant='body1' component='h2'><strong>Parole</strong></Typography>
|
||||
<Paper>
|
||||
<MizikLis paroles={paroles.data} />
|
||||
</Paper>
|
||||
</>
|
||||
)
|
||||
)}
|
||||
</Box>
|
||||
</Grid>
|
||||
|
||||
@@ -86,24 +86,26 @@ export default function AwtisKat({artiste}) {
|
||||
{alias}
|
||||
</Typography>
|
||||
<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>
|
||||
</CardContent>
|
||||
</CardActionArea>
|
||||
|
||||
<CardActions disableSpacing>
|
||||
<IconButton
|
||||
className={clsx(classes.expand, {
|
||||
[classes.expandOpen]: expanded
|
||||
})}
|
||||
aria-expanded={expanded}
|
||||
aria-label='show more'
|
||||
size='large'
|
||||
onClick={handleExpandClick}
|
||||
>
|
||||
<ExpandMoreIcon />
|
||||
</IconButton>
|
||||
</CardActions>
|
||||
{paroles.data.length > 0 && (
|
||||
<CardActions disableSpacing>
|
||||
<IconButton
|
||||
className={clsx(classes.expand, {
|
||||
[classes.expandOpen]: expanded
|
||||
})}
|
||||
aria-expanded={expanded}
|
||||
aria-label='show more'
|
||||
size='large'
|
||||
onClick={handleExpandClick}
|
||||
>
|
||||
<ExpandMoreIcon />
|
||||
</IconButton>
|
||||
</CardActions>
|
||||
)}
|
||||
<Collapse unmountOnExit in={expanded} timeout='auto'>
|
||||
<CardContent>
|
||||
<MizikLis paroles={paroles.data} />
|
||||
|
||||
Reference in New Issue
Block a user