Keep wordboundary when getting the icon text

Signed-off-by: Marcus Eide <eide@spotify.com>
This commit is contained in:
Marcus Eide
2021-04-21 13:54:41 +02:00
parent 325d8da164
commit 55dce86153
+1 -1
View File
@@ -36,7 +36,7 @@ const getIconText = (title: string) =>
title[0].toUpperCase() + title[1].toLowerCase()
: // If there's more than one word, take the first character of the first two words
title
.replace(/\W+/g, ' ')
.replace(/\B\W/g, '')
.split(' ')
.map(s => s[0])
.join('')