2024-04-04 14:07:53 -05:00
|
|
|
import React from 'react';
|
|
|
|
|
import { useSelector } from 'react-redux';
|
2020-04-01 10:47:51 +03:00
|
|
|
|
2022-10-20 12:11:27 +03:00
|
|
|
import { IReduxState } from '../../../../app/types';
|
2023-02-09 14:46:25 +02:00
|
|
|
import { getSecurityUiConfig } from '../../../../base/config/functions.any';
|
2022-08-08 11:12:22 +03:00
|
|
|
import { isLocalParticipantModerator } from '../../../../base/participants/functions';
|
2022-10-10 12:12:02 +03:00
|
|
|
import Dialog from '../../../../base/ui/components/web/Dialog';
|
2023-03-30 15:30:15 +03:00
|
|
|
import E2EESection from '../../../../e2ee/components/E2EESection';
|
|
|
|
|
import LobbySection from '../../../../lobby/components/web/LobbySection';
|
2024-02-02 13:47:58 -06:00
|
|
|
import { isEnablingLobbyAllowed } from '../../../../lobby/functions';
|
2020-04-01 10:47:51 +03:00
|
|
|
|
|
|
|
|
import PasswordSection from './PasswordSection';
|
|
|
|
|
|
2022-10-20 12:11:27 +03:00
|
|
|
export interface INotifyClick {
|
2022-08-04 11:26:13 +03:00
|
|
|
key: string;
|
|
|
|
|
preventExecution: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-01 10:47:51 +03:00
|
|
|
/**
|
|
|
|
|
* Component that renders the security options dialog.
|
|
|
|
|
*
|
|
|
|
|
* @returns {React$Element<any>}
|
|
|
|
|
*/
|
2024-04-04 14:07:53 -05:00
|
|
|
export default function SecurityDialog() {
|
|
|
|
|
const e2eeSupported = useSelector((state: IReduxState) => state['features/base/conference'].e2eeSupported);
|
|
|
|
|
const disableLobbyPassword = useSelector((state: IReduxState) => getSecurityUiConfig(state)?.disableLobbyPassword);
|
|
|
|
|
const _isEnablingLobbyAllowed = useSelector(isEnablingLobbyAllowed);
|
|
|
|
|
const isModerator = useSelector(isLocalParticipantModerator);
|
|
|
|
|
const showE2ee = Boolean(e2eeSupported) && isModerator;
|
2020-04-01 10:47:51 +03:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Dialog
|
2022-10-10 12:12:02 +03:00
|
|
|
cancel = {{ hidden: true }}
|
|
|
|
|
ok = {{ hidden: true }}
|
|
|
|
|
titleKey = 'security.title'>
|
2020-04-01 10:47:51 +03:00
|
|
|
<div className = 'security-dialog'>
|
2024-02-02 13:47:58 -06:00
|
|
|
{
|
|
|
|
|
_isEnablingLobbyAllowed && <LobbySection />
|
|
|
|
|
}
|
|
|
|
|
{
|
2024-04-04 14:07:53 -05:00
|
|
|
!disableLobbyPassword && (
|
2024-02-02 13:47:58 -06:00
|
|
|
<>
|
|
|
|
|
{ _isEnablingLobbyAllowed && <div className = 'separator-line' /> }
|
2024-04-04 14:07:53 -05:00
|
|
|
<PasswordSection />
|
2024-02-02 13:47:58 -06:00
|
|
|
</>
|
|
|
|
|
)
|
|
|
|
|
}
|
2020-06-18 12:25:49 -05:00
|
|
|
{
|
2024-04-04 14:07:53 -05:00
|
|
|
showE2ee ? <>
|
|
|
|
|
{ (_isEnablingLobbyAllowed || !disableLobbyPassword) && <div className = 'separator-line' /> }
|
2020-06-18 12:25:49 -05:00
|
|
|
<E2EESection />
|
|
|
|
|
</> : null
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-01 10:47:51 +03:00
|
|
|
</div>
|
|
|
|
|
</Dialog>
|
|
|
|
|
);
|
|
|
|
|
}
|