您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

SecurityDialog.tsx 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import React from 'react';
  2. import { useSelector } from 'react-redux';
  3. import { IReduxState } from '../../../../app/types';
  4. import { getSecurityUiConfig } from '../../../../base/config/functions.any';
  5. import { isLocalParticipantModerator } from '../../../../base/participants/functions';
  6. import Dialog from '../../../../base/ui/components/web/Dialog';
  7. import E2EESection from '../../../../e2ee/components/E2EESection';
  8. import LobbySection from '../../../../lobby/components/web/LobbySection';
  9. import { isEnablingLobbyAllowed } from '../../../../lobby/functions';
  10. import PasswordSection from './PasswordSection';
  11. export interface INotifyClick {
  12. key: string;
  13. preventExecution: boolean;
  14. }
  15. /**
  16. * Component that renders the security options dialog.
  17. *
  18. * @returns {React$Element<any>}
  19. */
  20. export default function SecurityDialog() {
  21. const e2eeSupported = useSelector((state: IReduxState) => state['features/base/conference'].e2eeSupported);
  22. const disableLobbyPassword = useSelector((state: IReduxState) => getSecurityUiConfig(state)?.disableLobbyPassword);
  23. const _isEnablingLobbyAllowed = useSelector(isEnablingLobbyAllowed);
  24. const isModerator = useSelector(isLocalParticipantModerator);
  25. const showE2ee = Boolean(e2eeSupported) && isModerator;
  26. return (
  27. <Dialog
  28. cancel = {{ hidden: true }}
  29. ok = {{ hidden: true }}
  30. titleKey = 'security.title'>
  31. <div className = 'security-dialog'>
  32. {
  33. _isEnablingLobbyAllowed && <LobbySection />
  34. }
  35. {
  36. !disableLobbyPassword && (
  37. <>
  38. { _isEnablingLobbyAllowed && <div className = 'separator-line' /> }
  39. <PasswordSection />
  40. </>
  41. )
  42. }
  43. {
  44. showE2ee ? <>
  45. { (_isEnablingLobbyAllowed || !disableLobbyPassword) && <div className = 'separator-line' /> }
  46. <E2EESection />
  47. </> : null
  48. }
  49. </div>
  50. </Dialog>
  51. );
  52. }