Merge pull request #13406 from overleaf/ae-unicode-char

Use a Unicode-aware method to get the first character of the user name

GitOrigin-RevId: 04beccb906f40a452f03795b0cd9046bd95c32ec
This commit is contained in:
Alf Eaton 2023-06-15 10:30:25 +01:00 committed by Copybot
parent d5dbca09df
commit 374e525cde

View file

@ -72,11 +72,13 @@ function UserIcon({ user, showName, onClick }) {
onClick(user)
}
const [character] = [...user.name]
return (
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
<span onClick={handleOnClick}>
<span className="online-user" style={{ backgroundColor }}>
{user.name.slice(0, 1)}
{character}
</span>
{showName && user.name}
</span>