fix(avatar): add ZWNJ between initials of letter avatars
This commit is contained in:
parent
ed6759c6cf
commit
6085220bfc
|
@ -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)}`;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue