Compare commits

..

1 Commits

Author SHA1 Message Date
lebaudantoine 8cbcad7645 💄(frontend) adjust centering of Avatar initials
Fine-tune the vertical alignment of the initials in the Avatar so
they sit properly centered inside the circle.
2026-07-30 15:16:29 +02:00
3 changed files with 2 additions and 45 deletions
+2 -1
View File
@@ -59,9 +59,10 @@ export const Avatar = React.memo(
<text
x="50"
y="50"
dy="-0.08em"
textAnchor="middle"
dominantBaseline="central"
fontSize={initials.length > 1 ? 48 : 52}
fontSize="52"
fontWeight="500"
fill="currentColor"
>
@@ -1,42 +0,0 @@
import { useLocalParticipant } from '@livekit/components-react'
import { useEffect } from 'react'
export const MEDIA_STATE_ELEMENT_ID = 'media-state'
export const MEDIA_STATE_CHANGED_EVENT = 'media-state-changed'
export type MediaStateChangedDetail = {
microphoneEnabled: boolean
cameraEnabled: boolean
}
/**
* Exposes the local participant's media state in the DOM so external tools
* (e.g. bots automating the frontend) can reliably read the microphone and
* camera state, and watch for changes with a MutationObserver:
*
* const el = document.getElementById('media-state')
* new MutationObserver(...).observe(el, { attributes: true })
*/
export const MediaStateObserver = () => {
const { isMicrophoneEnabled, isCameraEnabled } = useLocalParticipant()
useEffect(() => {
window.dispatchEvent(
new CustomEvent<MediaStateChangedDetail>(MEDIA_STATE_CHANGED_EVENT, {
detail: {
microphoneEnabled: isMicrophoneEnabled,
cameraEnabled: isCameraEnabled,
},
})
)
}, [isMicrophoneEnabled, isCameraEnabled])
return (
<div
id={MEDIA_STATE_ELEMENT_ID}
style={{ display: 'none' }}
data-microphone-enabled={isMicrophoneEnabled ? 'true' : 'false'}
data-camera-enabled={isCameraEnabled ? 'true' : 'false'}
/>
)
}
@@ -11,7 +11,6 @@ import { SidePanel } from '../components/SidePanel'
import { RecordingProvider } from '@/features/recording'
import { ScreenShareErrorModal } from '../components/ScreenShareErrorModal'
import { ConnectionObserver } from '../components/ConnectionObserver'
import { MediaStateObserver } from '../components/MediaStateObserver'
import { RoomMetadataSynchronizer } from '../components/RoomMetadataSynchronizer'
import { useRoomPageTitle } from '../hooks/useRoomPageTitle'
import { useNoiseReduction } from '../hooks/useNoiseReduction'
@@ -64,7 +63,6 @@ export function VideoConference({ ...props }: VideoConferenceProps) {
<>
<RoomMetadataSynchronizer />
<ConnectionObserver />
<MediaStateObserver />
<ChatProvider />
<VideoResolutionSubscription />
<div