Files
upstream-jitsi-meet/react/features/subtitles/components/native/LanguageSelectorDialog.tsx
upstream-mirror 1d2bfcac0c
Some checks failed
Prosody Plugin Tests / test (push) Failing after 10m11s
Close stale issues and PRs / stale (push) Failing after 1s
snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
2026-09-15 15:56:32 +05:00

44 lines
1.5 KiB
TypeScript

import React, { useCallback } from 'react';
import JitsiScreen from '../../../base/modal/components/JitsiScreen';
import { goBack, navigate }
from '../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
import { screen } from '../../../mobile/navigation/routes';
import AbstractLanguageSelectorDialog, {
IAbstractLanguageSelectorDialogProps
} from '../AbstractLanguageSelectorDialog';
import LanguageList from './LanguageList';
import styles from './styles';
const LanguageSelectorDialog = (props: IAbstractLanguageSelectorDialogProps) => {
const { language, listItems, onLanguageSelected, startWithRecordingDialog, subtitles } = props;
const onSelected = useCallback((e: string) => {
if (startWithRecordingDialog) {
navigate(screen.conference.recording, { recordAudioAndVideo: false });
} else {
onLanguageSelected(e);
goBack();
}
}, [ startWithRecordingDialog, language ]);
return (
<JitsiScreen
disableForcedKeyboardDismiss = { true }
style = { styles.subtitlesContainer }>
<LanguageList
items = { listItems }
onLanguageSelected = { onSelected }
selectedLanguage = { subtitles } />
</JitsiScreen>
);
};
/*
* We apply AbstractLanguageSelector to fill in the AbstractProps common
* to both the web and native implementations.
*/
// eslint-disable-next-line new-cap
export default AbstractLanguageSelectorDialog(LanguageSelectorDialog);