snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
32
react/features/base/util/getUnsafeRoomText.native.ts
Normal file
32
react/features/base/util/getUnsafeRoomText.native.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
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, '.' ] });
|
||||
}
|
||||
Reference in New Issue
Block a user