Replace join by Intl object

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-02-05 14:21:56 +04:00
parent 3f487c5aa4
commit a7a9b15b59
6 changed files with 13 additions and 6 deletions
+2 -1
View File
@@ -37,7 +37,8 @@ export default function Pataje({teks, setError, setSuccess}) {
const [open, setOpen] = useState(false)
const patajeUrl = `${SITE_URL}/teks/${slug}#${slug}`
const renderAwtis = awtis.map(a => a.alias).join(', ')
const alias = awtis.map(({alias}) => alias)
const renderAwtis = new Intl.ListFormat('fr').format(alias)
const text = teks.user ? `${renderAwtis} - ${tit} (Pawòl) - (texte soumis par ${teks.user.username})` : `${renderAwtis} - ${tit} (Pawòl)`
const twitterUrl = 'https://twitter.com/intent/tweet'