diff --git a/src/frontend/src/features/rooms/components/Join.tsx b/src/frontend/src/features/rooms/components/Join.tsx index e537f6aa..64e890bc 100644 --- a/src/frontend/src/features/rooms/components/Join.tsx +++ b/src/frontend/src/features/rooms/components/Join.tsx @@ -13,12 +13,77 @@ import { Button, Dialog } from '@/primitives' import { LocalUserChoices } from '../routes/Room' import { Heading } from 'react-aria-components' import { RiImageCircleAiFill } from '@remixicon/react' -import { EffectsConfiguration } from '../livekit/components/effects/EffectsConfiguration' +import { + EffectsConfiguration, + EffectsConfigurationProps, +} from '../livekit/components/effects/EffectsConfiguration' import { usePersistentUserChoices } from '../livekit/hooks/usePersistentUserChoices' import { BackgroundBlurFactory } from '../livekit/components/blur' const onError = (e: Error) => console.error('ERROR', e) +const Effects = ({ + videoTrack, + onSubmit, +}: Pick) => { + const { t } = useTranslation('rooms', { keyPrefix: 'join.effects' }) + const [isDialogOpen, setIsDialogOpen] = useState(false) + const openDialog = () => setIsDialogOpen(true) + + return ( + <> + + + {t('title')} + + + +
+ +
+
+ + ) +} + export const Join = ({ onSubmit, }: { @@ -123,12 +188,6 @@ export const Join = ({ }) } - const [isEffectsOpen, setEffectsOpen] = useState(false) - - const openEffects = () => { - setEffectsOpen(true) - } - // This hook is used to setup the persisted user choice processor on initialization. // So it's on purpose that processor is not included in the deps. // We just want to wait for the videoTrack to be loaded to apply the default processor. @@ -141,30 +200,6 @@ export const Join = ({ return ( - - - {t('effects.title')} - - { - setProcessor(processor) - }} - /> -
)} -
-
- -
+
void + layout?: 'vertical' | 'horizontal' +} + export const EffectsConfiguration = ({ videoTrack, onSubmit, layout = 'horizontal', -}: { - videoTrack: LocalVideoTrack - onSubmit?: (processor?: BackgroundBlurProcessorInterface) => void - layout?: 'vertical' | 'horizontal' -}) => { +}: EffectsConfigurationProps) => { const videoRef = useRef(null) const { t } = useTranslation('rooms', { keyPrefix: 'effects' }) const [processorPending, setProcessorPending] = useState(false)