Change komante to commentaire

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-05-20 02:19:10 +04:00
parent 47bc07c5d8
commit e76a7cf8cc
3 changed files with 47 additions and 40 deletions
+9 -8
View File
@@ -45,7 +45,7 @@ const Root = styled('div')((
const KomanteTooltip = Tooltip
export default function VweKomante({komante, teks}) {
export default function VweKomante({commentaires, parole, paroleId}) {
const [esOuve, meteEsOuve] = useState(false)
const [esKoneksyonOuve, meteEsKoneksyonOuve] = useState(false)
const [esKomenteOuve, meteEsKomanteOuve] = useState(false)
@@ -88,7 +88,7 @@ export default function VweKomante({komante, teks}) {
size='large'
onClick={handleClick}
>
<Badge badgeContent={komante.length} color='primary'>
<Badge badgeContent={commentaires.length} color='primary'>
<CommentIcon />
</Badge>
</IconButton>
@@ -109,8 +109,8 @@ export default function VweKomante({komante, teks}) {
tabIndex={-1}
component='div'
>
{komante.length > 0 ? (
<KomanteList komante={komante} />
{commentaires.length > 0 ? (
<KomanteList commentaires={commentaires} />
) : (
<Typography component='div' align='center'>
Aucun commentaire
@@ -140,7 +140,7 @@ export default function VweKomante({komante, teks}) {
)}
{session && session.user && esKomenteOuve && (
<>
<EkriKomante session={session} teks={teks} meteEsKomanteOuve={meteEsKomanteOuve} />
<EkriKomante session={session} parole={parole} paroleId={paroleId} meteEsKomanteOuve={meteEsKomanteOuve} />
<Button fullWidth style={{marginBottom: 10}} color='primary' onClick={() => meteEsKomanteOuve(false)}>
Fermer
</Button>
@@ -152,10 +152,11 @@ export default function VweKomante({komante, teks}) {
}
VweKomante.defaultProps = {
komante: null
commentaires: null
}
VweKomante.propTypes = {
komante: PropTypes.array,
teks: PropTypes.object.isRequired
commentaires: PropTypes.array,
parole: PropTypes.object.isRequired,
paroleId: PropTypes.number.isRequired
}