mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-28 19:27:50 +00:00
♿️(frontend) add explicit region for call controls
Declare a dedicated ARIA region for call controls to improve accessibility. Extract this region into a reusable component for better consistency and maintainability.
This commit is contained in:
@@ -0,0 +1,44 @@
|
|||||||
|
import { cva, RecipeVariantProps } from '@/styled-system/css'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
|
const controlBarRegion = cva({
|
||||||
|
base: {
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
flex: '1 1 33%',
|
||||||
|
justifyContent: 'center',
|
||||||
|
gap: '0.65rem',
|
||||||
|
},
|
||||||
|
variants: {
|
||||||
|
mobile: {
|
||||||
|
true: {
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
width: '330px',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
defaultVariants: {
|
||||||
|
mobile: false,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
export type ControlBarRegionProps = React.HTMLAttributes<HTMLDivElement> &
|
||||||
|
RecipeVariantProps<typeof controlBarRegion>
|
||||||
|
|
||||||
|
export function ControlBarRegion({
|
||||||
|
children,
|
||||||
|
mobile,
|
||||||
|
...props
|
||||||
|
}: ControlBarRegionProps) {
|
||||||
|
const { t } = useTranslation('rooms')
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
role="region"
|
||||||
|
aria-label={t('controls.region')}
|
||||||
|
className={controlBarRegion({ mobile })}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -15,6 +15,7 @@ import { useFullScreen } from '../../hooks/useFullScreen'
|
|||||||
import { VideoDeviceControl } from '../../components/controls/Device/VideoDeviceControl'
|
import { VideoDeviceControl } from '../../components/controls/Device/VideoDeviceControl'
|
||||||
import { AudioDevicesControl } from '../../components/controls/Device/AudioDevicesControl'
|
import { AudioDevicesControl } from '../../components/controls/Device/AudioDevicesControl'
|
||||||
import { ReactionsToggle } from '@/features/reactions/components/ReactionsToggle'
|
import { ReactionsToggle } from '@/features/reactions/components/ReactionsToggle'
|
||||||
|
import { ControlBarRegion } from '@/features/layout/components/ControlBarRegion'
|
||||||
|
|
||||||
export function DesktopControlBar({
|
export function DesktopControlBar({
|
||||||
onDeviceError,
|
onDeviceError,
|
||||||
@@ -61,15 +62,7 @@ export function DesktopControlBar({
|
|||||||
marginLeft: '0.5rem',
|
marginLeft: '0.5rem',
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
<div
|
<ControlBarRegion>
|
||||||
className={css({
|
|
||||||
flex: '1 1 33%',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
display: 'flex',
|
|
||||||
gap: '0.65rem',
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<AudioDevicesControl
|
<AudioDevicesControl
|
||||||
onDeviceError={(error) =>
|
onDeviceError={(error) =>
|
||||||
onDeviceError?.({ source: Track.Source.Microphone, error })
|
onDeviceError?.({ source: Track.Source.Microphone, error })
|
||||||
@@ -93,7 +86,7 @@ export function DesktopControlBar({
|
|||||||
<OptionsButton />
|
<OptionsButton />
|
||||||
<LeaveButton />
|
<LeaveButton />
|
||||||
<StartMediaButton />
|
<StartMediaButton />
|
||||||
</div>
|
</ControlBarRegion>
|
||||||
<MoreOptions parentElement={desktopControlBarEl} />
|
<MoreOptions parentElement={desktopControlBarEl} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import { useConfig } from '@/api/useConfig'
|
|||||||
import { AudioDevicesControl } from '../../components/controls/Device/AudioDevicesControl'
|
import { AudioDevicesControl } from '../../components/controls/Device/AudioDevicesControl'
|
||||||
import { VideoDeviceControl } from '../../components/controls/Device/VideoDeviceControl'
|
import { VideoDeviceControl } from '../../components/controls/Device/VideoDeviceControl'
|
||||||
import { useSettingsDialog } from '@/features/settings/hook/useSettingsDialog'
|
import { useSettingsDialog } from '@/features/settings/hook/useSettingsDialog'
|
||||||
|
import { ControlBarRegion } from '@/features/layout/components/ControlBarRegion'
|
||||||
|
|
||||||
export function MobileControlBar({
|
export function MobileControlBar({
|
||||||
onDeviceError,
|
onDeviceError,
|
||||||
@@ -47,13 +48,7 @@ export function MobileControlBar({
|
|||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<div
|
<ControlBarRegion mobile>
|
||||||
className={css({
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
width: '330px',
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<LeaveButton />
|
<LeaveButton />
|
||||||
<AudioDevicesControl
|
<AudioDevicesControl
|
||||||
onDeviceError={(error) =>
|
onDeviceError={(error) =>
|
||||||
@@ -78,7 +73,7 @@ export function MobileControlBar({
|
|||||||
>
|
>
|
||||||
<RiMore2Line />
|
<RiMore2Line />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</ControlBarRegion>
|
||||||
</div>
|
</div>
|
||||||
<ResponsiveMenu
|
<ResponsiveMenu
|
||||||
isOpened={isMenuOpened}
|
isOpened={isMenuOpened}
|
||||||
|
|||||||
@@ -166,6 +166,7 @@
|
|||||||
"countdownAnnouncement": "Das Meeting endet in {{duration}}."
|
"countdownAnnouncement": "Das Meeting endet in {{duration}}."
|
||||||
},
|
},
|
||||||
"controls": {
|
"controls": {
|
||||||
|
"region": "Anrufsteuerung",
|
||||||
"microphone": "Mikrofon",
|
"microphone": "Mikrofon",
|
||||||
"camera": "Kamera",
|
"camera": "Kamera",
|
||||||
"chat": {
|
"chat": {
|
||||||
|
|||||||
@@ -166,6 +166,7 @@
|
|||||||
"countdownAnnouncement": "Call ends in {{duration}}."
|
"countdownAnnouncement": "Call ends in {{duration}}."
|
||||||
},
|
},
|
||||||
"controls": {
|
"controls": {
|
||||||
|
"region": "Call controls",
|
||||||
"microphone": "Microphone",
|
"microphone": "Microphone",
|
||||||
"camera": "Camera",
|
"camera": "Camera",
|
||||||
"chat": {
|
"chat": {
|
||||||
|
|||||||
@@ -166,6 +166,7 @@
|
|||||||
"countdownAnnouncement": "L'appel se termine dans {{duration}}."
|
"countdownAnnouncement": "L'appel se termine dans {{duration}}."
|
||||||
},
|
},
|
||||||
"controls": {
|
"controls": {
|
||||||
|
"region": "Commandes pour les appels",
|
||||||
"microphone": "Microphone",
|
"microphone": "Microphone",
|
||||||
"camera": "Camera",
|
"camera": "Camera",
|
||||||
"chat": {
|
"chat": {
|
||||||
|
|||||||
@@ -166,6 +166,7 @@
|
|||||||
"countdownAnnouncement": "Het gesprek eindigt over {{duration}}."
|
"countdownAnnouncement": "Het gesprek eindigt over {{duration}}."
|
||||||
},
|
},
|
||||||
"controls": {
|
"controls": {
|
||||||
|
"region": "Gespreksbesturing",
|
||||||
"microphone": "Microfoon",
|
"microphone": "Microfoon",
|
||||||
"camera": "Camera",
|
"camera": "Camera",
|
||||||
"chat": {
|
"chat": {
|
||||||
|
|||||||
Reference in New Issue
Block a user