Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

getUnsafeRoomText.native.ts 1.1KB

1234567891011121314151617181920212223242526272829303132
  1. import React from 'react';
  2. import { Text } from 'react-native';
  3. import { IReduxState } from '../../app/types';
  4. import Link from '../react/components/native/Link';
  5. import BaseTheme from '../ui/components/BaseTheme.native';
  6. import { SECURITY_URL } from './contants';
  7. /**
  8. * Gets the unsafe room text for the given context.
  9. *
  10. * @param {IReduxState} state - The redux state.
  11. * @param {Function} t - The translation function.
  12. * @param {'meeting'|'prejoin'|'welcome'} context - The given context of the warning.
  13. * @returns {Text}
  14. */
  15. export default function getUnsafeRoomText(state: IReduxState, t: Function, context: 'meeting' | 'prejoin' | 'welcome') {
  16. const securityUrl = state['features/base/config'].legalUrls?.security ?? SECURITY_URL;
  17. const link = React.createElement(Link, {
  18. url: securityUrl,
  19. children: 'here',
  20. key: 'support-link',
  21. style: { color: BaseTheme.palette.action01 } });
  22. const options = {
  23. recommendAction: t(`security.unsafeRoomActions.${context}`)
  24. };
  25. return React.createElement(Text, { children: [ t('security.insecureRoomNameWarningNative', options), link, '.' ] });
  26. }