diff --git a/src/frontend/src/features/settings/components/tabs/AudioTab.tsx b/src/frontend/src/features/settings/components/tabs/AudioTab.tsx index eb369067..e15bb9af 100644 --- a/src/frontend/src/features/settings/components/tabs/AudioTab.tsx +++ b/src/frontend/src/features/settings/components/tabs/AudioTab.tsx @@ -1,4 +1,4 @@ -import { DialogProps, Field, H, Switch, Text } from '@/primitives' +import { DialogProps, Field, Switch, Text } from '@/primitives' import { TabPanel, TabPanelProps } from '@/primitives/Tabs' import { @@ -9,78 +9,11 @@ import { import { isSafari } from '@/utils/livekit' import { useTranslation } from 'react-i18next' import { SoundTester } from '@/components/SoundTester' -import { HStack } from '@/styled-system/jsx' import { ActiveSpeaker } from '@/features/rooms/components/ActiveSpeaker' import { usePersistentUserChoices } from '@/features/rooms/livekit/hooks/usePersistentUserChoices' -import { ReactNode } from 'react' -import { css } from '@/styled-system/css' -import posthog from 'posthog-js' import { useNoiseReductionAvailable } from '@/features/rooms/livekit/hooks/useNoiseReductionAvailable' - -type RowWrapperProps = { - heading: string - children: ReactNode[] - beta?: boolean -} - -const BetaBadge = () => ( - - Beta - -) - -const RowWrapper = ({ heading, children, beta }: RowWrapperProps) => { - return ( - <> - - {heading} - {beta && } - - -
- {children[0]} -
-
- {children[1]} -
-
- - ) -} +import posthog from 'posthog-js' +import { RowWrapper } from './layout/RowWrapper' export type AudioTabProps = Pick & Pick diff --git a/src/frontend/src/features/settings/components/tabs/VideoTab.tsx b/src/frontend/src/features/settings/components/tabs/VideoTab.tsx index b301eef5..4bbcf62d 100644 --- a/src/frontend/src/features/settings/components/tabs/VideoTab.tsx +++ b/src/frontend/src/features/settings/components/tabs/VideoTab.tsx @@ -1,11 +1,10 @@ -import { DialogProps, Field, H } from '@/primitives' +import { DialogProps, Field } from '@/primitives' import { TabPanel, TabPanelProps } from '@/primitives/Tabs' import { useMediaDeviceSelect, useRoomContext } from '@livekit/components-react' import { useTranslation } from 'react-i18next' -import { HStack } from '@/styled-system/jsx' import { usePersistentUserChoices } from '@/features/rooms/livekit/hooks/usePersistentUserChoices' -import { ReactNode, useCallback, useEffect, useState } from 'react' +import { useCallback, useEffect, useState } from 'react' import { css } from '@/styled-system/css' import { createLocalVideoTrack, @@ -16,44 +15,7 @@ import { } from 'livekit-client' import { BackgroundProcessorFactory } from '@/features/rooms/livekit/components/blur' import { VideoResolution } from '@/stores/userChoices' - -type RowWrapperProps = { - heading: string - children: ReactNode[] -} - -const RowWrapper = ({ heading, children }: RowWrapperProps) => { - return ( - <> - {heading} - -
- {children[0]} -
-
- {children[1]} -
-
- - ) -} +import { RowWrapper } from './layout/RowWrapper' export type VideoTabProps = Pick & Pick @@ -212,104 +174,65 @@ export const VideoTab = ({ id }: VideoTabProps) => { )} - {t('resolution.heading')} - -
+ { + await handleVideoResolutionChange(key as VideoResolution) }} - > - { - await handleVideoResolutionChange(key as VideoResolution) - }} - style={{ - width: '100%', - }} - /> -
-
- - -
+ + + { + if (key == undefined) return + const selectedQuality = Number(String(key)) + saveVideoSubscribeQuality(selectedQuality) + updateExistingRemoteVideoQuality(selectedQuality) }} - > - { - if (key == undefined) return - const selectedQuality = Number(String(key)) - saveVideoSubscribeQuality(selectedQuality) - updateExistingRemoteVideoQuality(selectedQuality) - }} - style={{ - width: '100%', - }} - /> -
-
- + <> + ) } diff --git a/src/frontend/src/features/settings/components/tabs/layout/RowWrapper.tsx b/src/frontend/src/features/settings/components/tabs/layout/RowWrapper.tsx new file mode 100644 index 00000000..c668bfdc --- /dev/null +++ b/src/frontend/src/features/settings/components/tabs/layout/RowWrapper.tsx @@ -0,0 +1,71 @@ +import { ReactNode } from 'react' +import { H } from '@/primitives' +import { HStack } from '@/styled-system/jsx' +import { css } from '@/styled-system/css' + +export type RowWrapperProps = { + heading?: string + children: ReactNode[] + beta?: boolean +} + +const BetaBadge = () => ( + + Beta + +) + +export const RowWrapper = ({ heading, children, beta }: RowWrapperProps) => { + return ( + <> + {heading && ( + + {heading} + {beta && } + + )} + +
+ {children[0]} +
+
+ {children[1]} +
+
+ + ) +}