diff --git a/src/frontend/src/features/participantTile/components/ParticipantPlaceholder.tsx b/src/frontend/src/features/participantTile/components/ParticipantPlaceholder.tsx index 8338aa9a..a6612514 100644 --- a/src/frontend/src/features/participantTile/components/ParticipantPlaceholder.tsx +++ b/src/frontend/src/features/participantTile/components/ParticipantPlaceholder.tsx @@ -4,8 +4,7 @@ import { Avatar } from '@/components/Avatar' import { useIsSpeaking } from '@livekit/components-react' import { getParticipantBackgroundGradient } from '@/features/rooms/utils/getParticipantBackgroundGradient' import { getParticipantColor } from '@/features/rooms/utils/getParticipantColor' -import { useSize } from '@/features/rooms/livekit/hooks/useResizeObserver' -import { useMemo, useRef } from 'react' +import { useMemo } from 'react' const StyledParticipantPlaceHolder = styled('div', { base: { @@ -14,6 +13,16 @@ const StyledParticipantPlaceHolder = styled('div', { display: 'flex', justifyContent: 'center', alignItems: 'center', + containerType: 'size', + }, +}) + +const StyledAvatarWrapper = styled('div', { + base: { + borderRadius: '50%', + aspectRatio: '1 / 1', + width: 'min(90cqmin, 160px)', + fontSize: 'min(27cqmin, 48px)', }, }) @@ -31,43 +40,22 @@ export const ParticipantPlaceholder = ({ [participantColor] ) - const placeholderEl = useRef(null) - const { width, height } = useSize(placeholderEl) - - const minDimension = Math.min(width, height) - const avatarSize = useMemo( - () => Math.min(Math.round(minDimension * 0.9), 160), - [minDimension] - ) - - const initialSize = useMemo(() => Math.round(avatarSize * 0.3), [avatarSize]) - return ( -
- {/*fixme - participant doesn't update on ParticipantNameChanged event */} -
+
) } diff --git a/src/frontend/src/features/rooms/utils/getParticipantBackgroundGradient.ts b/src/frontend/src/features/rooms/utils/getParticipantBackgroundGradient.ts index b2cfe7ef..ea77b607 100644 --- a/src/frontend/src/features/rooms/utils/getParticipantBackgroundGradient.ts +++ b/src/frontend/src/features/rooms/utils/getParticipantBackgroundGradient.ts @@ -4,7 +4,7 @@ * Mixed in oklch so the color stays vivid as it darkens instead of greying out. */ export const getParticipantBackgroundGradient = (color: string): string => - `radial-gradient(circle at 50% 45%, + `radial-gradient(circle at 50% 50%, color-mix(in oklch, ${color} 82%, white) 0%, color-mix(in oklch, ${color} 90%, white) 8%, ${color} 35%,