Use only alphabet in generated avatar
parent
9170040acb
commit
d7c6fbe11d
|
@ -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…
Reference in New Issue