Fix username display
This commit is contained in:
@@ -51,7 +51,7 @@ export default function Pataje({parole, setError, setSuccess}) {
|
||||
const alias = artistes.data.map(({attributes}) => attributes.alias)
|
||||
const renderAwtis = new Intl.ListFormat('fr').format(alias)
|
||||
|
||||
const text = parole.user || parole.userAdmin ? `${renderAwtis} - ${titre} (Paroles et Traductions) - (texte soumis par ${parole?.user?.data?.attributes?.username || parole.userAdmin?.data?.attributes?.username})` : `${renderAwtis} - ${parole} (Paroles et Traductions)`
|
||||
const text = parole.user || parole.userAdmin ? `${renderAwtis} - ${titre} (Paroles et Traductions) - (texte soumis par ${parole?.user?.data?.attributes?.username || parole.userAdmin?.data?.attributes?.username || parole.userAdmin?.data?.attributes?.firstname})` : `${renderAwtis} - ${parole} (Paroles et Traductions)`
|
||||
|
||||
const handleClose = () => {
|
||||
setOpen(false)
|
||||
|
||||
@@ -161,9 +161,9 @@ export default function Teks({parole, paroleId, commentaires, open, success, err
|
||||
<i>texte soumis par {parole.user.data.attributes.username}</i>
|
||||
</Typography>
|
||||
)}
|
||||
{parole.userAdmin && !parole.user && (
|
||||
{parole?.userAdmin?.data && !parole.user.data && (
|
||||
<Typography style={{marginBottom: '1.5em'}} display='block' variant='caption'>
|
||||
<i>texte soumis par {parole.userAdmin}</i>
|
||||
<i>texte soumis par {parole.userAdmin.data.attributes.username || parole.userAdmin.data.attributes.firstname}</i>
|
||||
</Typography>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user