fix(avatar): add ZWNJ between initials of letter avatars

This commit is contained in:
Shahab 2022-04-09 14:12:32 +04:30 committed by Saúl Ibarra Corretgé
parent ed6759c6cf
commit 6085220bfc
1 changed files with 3 additions and 1 deletions

View File

@ -68,7 +68,9 @@ export function getInitials(s: ?string) {
const initialsBasis = _.split(s, '@')[0]; const initialsBasis = _.split(s, '@')[0];
const [ firstWord, secondWord ] = initialsBasis.split(wordSplitRegex).filter(Boolean); const [ firstWord, secondWord ] = initialsBasis.split(wordSplitRegex).filter(Boolean);
return getFirstGraphemeUpper(firstWord) + getFirstGraphemeUpper(secondWord); // Add ZWNJ to separate the initials in languages like Arabic or Persian.
return `${getFirstGraphemeUpper(firstWord)}\u200c${getFirstGraphemeUpper(secondWord)}`;
} }
/** /**