Use only alphabet in generated avatar
This commit is contained in:
parent
9170040acb
commit
d7c6fbe11d
1 changed files with 2 additions and 0 deletions
|
@ -37,6 +37,8 @@ export function UserAvatar({
|
||||||
|
|
||||||
function getInitials(str: string): string {
|
function getInitials(str: string): string {
|
||||||
const tokens = str
|
const tokens = str
|
||||||
|
.toLowerCase()
|
||||||
|
.replace(/[^a-z]/g, '')
|
||||||
.split(' ')
|
.split(' ')
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.map(v => v.trim())
|
.map(v => v.trim())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue