Open source video conferencing app powered by LiveKit. Built with Django and React.
πΈ(frontend) show two initials in the Avatar when possible
lebaudantoinee400d05a7cac
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex f3d6816a..68c4e68e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -35,6 +35,7 @@ and this project adheres to- π(backend) preserve recording metadata when updating room access- π(backend) allow any string as sub in the API serializer- π(frontend) fall back to user.full_name on request-entry+- πΈ(frontend) show two initials in the Avatar when possible## [1.24.0] - 2026-07-21diff --git a/src/frontend/src/components/Avatar.tsx b/src/frontend/src/components/Avatar.tsxindex ed5d558b..81289d9b 100644--- a/src/frontend/src/components/Avatar.tsx+++ b/src/frontend/src/components/Avatar.tsx@@ -28,6 +28,15 @@ const avatar = cva({},})+const getInitials = (name?: string): string => {+ if (!name) return ''+ const words = name.trim().split(/\s+/).filter(Boolean)+ if (words.length === 0) return ''+ const first = words[0].charAt(0)+ const second = words.length > 1 ? words[1].charAt(0) : ''+ return (first + second).toUpperCase()+}+export type AvatarProps = React.HTMLAttributes<HTMLDivElement> & {name?: stringbgColor?: string@@ -35,7 +44,7 @@ export type AvatarProps = React.HTMLAttributes<HTMLDivElement> & {export const Avatar = React.memo(({ name, bgColor, context, notification, style, ...props }: AvatarProps) => {- const initial = name?.trim()?.charAt(0) ?? ''+ const initials = getInitials(name)return (<divstyle={{ backgroundColor: bgColor, ...style }}@@ -52,11 +61,11 @@ export const Avatar = React.memo(y="50"textAnchor="middle"dominantBaseline="central"- fontSize="52"+ fontSize={initials.length > 1 ? 48 : 52}fontWeight="500"fill="currentColor">- {initial.toUpperCase()}+ {initials.toUpperCase()}</text></svg></div>