Files
upstream-jitsi-meet/react/features/base/util/getUnsafeRoomText.native.ts
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

33 lines
1.1 KiB
TypeScript

import React from 'react';
import { Text } from 'react-native';
import { IReduxState } from '../../app/types';
import Link from '../react/components/native/Link';
import BaseTheme from '../ui/components/BaseTheme.native';
import { SECURITY_URL } from './contants';
/**
* Gets the unsafe room text for the given context.
*
* @param {IReduxState} state - The redux state.
* @param {Function} t - The translation function.
* @param {'meeting'|'prejoin'|'welcome'} context - The given context of the warning.
* @returns {Text}
*/
export default function getUnsafeRoomText(state: IReduxState, t: Function, context: 'meeting' | 'prejoin' | 'welcome') {
const securityUrl = state['features/base/config'].legalUrls?.security ?? SECURITY_URL;
const link = React.createElement(Link, {
url: securityUrl,
children: 'here',
key: 'support-link',
style: { color: BaseTheme.palette.action01 } });
const options = {
recommendAction: t(`security.unsafeRoomActions.${context}`)
};
return React.createElement(Text, { children: [ t('security.insecureRoomNameWarningNative', options), link, '.' ] });
}