2022-08-03 11:24:44 +00:00
|
|
|
/* eslint-disable lines-around-comment */
|
2021-02-24 21:45:07 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
2022-08-03 11:24:44 +00:00
|
|
|
// @ts-ignore
|
2021-02-24 21:45:07 +00:00
|
|
|
import { Dialog } from '../../../base/dialog';
|
2022-08-03 11:24:44 +00:00
|
|
|
import { translate } from '../../../base/i18n/functions';
|
|
|
|
import { connect } from '../../../base/redux/functions';
|
|
|
|
import Switch from '../../../base/ui/components/web/Switch';
|
2021-02-24 21:45:07 +00:00
|
|
|
import AbstractMuteEveryonesVideoDialog, { abstractMapStateToProps, type Props }
|
2022-08-03 11:24:44 +00:00
|
|
|
// @ts-ignore
|
2021-02-24 21:45:07 +00:00
|
|
|
from '../AbstractMuteEveryonesVideoDialog';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A React Component with the contents for a dialog that asks for confirmation
|
|
|
|
* from the user before disabling all remote participants cameras.
|
|
|
|
*
|
2021-11-04 21:10:43 +00:00
|
|
|
* @augments AbstractMuteEveryonesVideoDialog
|
2021-02-24 21:45:07 +00:00
|
|
|
*/
|
|
|
|
class MuteEveryonesVideoDialog extends AbstractMuteEveryonesVideoDialog<Props> {
|
2021-09-10 11:05:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Toggles advanced moderation switch.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onToggleModeration() {
|
2022-08-03 11:24:44 +00:00
|
|
|
// @ts-ignore
|
2021-09-10 11:05:16 +00:00
|
|
|
this.setState(state => {
|
|
|
|
return {
|
|
|
|
moderationEnabled: !state.moderationEnabled,
|
2022-08-03 11:24:44 +00:00
|
|
|
// @ts-ignore
|
2021-09-10 11:05:16 +00:00
|
|
|
content: this.props.t(state.moderationEnabled
|
|
|
|
? 'dialog.muteEveryonesVideoDialog' : 'dialog.muteEveryonesVideoDialogModerationOn'
|
|
|
|
)
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-02-24 21:45:07 +00:00
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<Dialog
|
|
|
|
okKey = 'dialog.muteParticipantsVideoButton'
|
|
|
|
onSubmit = { this._onSubmit }
|
2022-08-03 11:24:44 +00:00
|
|
|
// @ts-ignore
|
2021-02-24 21:45:07 +00:00
|
|
|
titleString = { this.props.title }
|
|
|
|
width = 'small'>
|
2021-09-10 11:05:16 +00:00
|
|
|
<div className = 'mute-dialog'>
|
2022-08-03 11:24:44 +00:00
|
|
|
{/* @ts-ignore */}
|
2021-09-10 11:05:16 +00:00
|
|
|
{this.state.content}
|
2022-08-03 11:24:44 +00:00
|
|
|
{/* @ts-ignore */}
|
2021-10-01 13:47:13 +00:00
|
|
|
{ this.props.isModerationSupported && this.props.exclude.length === 0 && (
|
2021-09-10 11:05:16 +00:00
|
|
|
<>
|
|
|
|
<div className = 'separator-line' />
|
|
|
|
<div className = 'control-row'>
|
|
|
|
<label htmlFor = 'moderation-switch'>
|
2022-08-03 11:24:44 +00:00
|
|
|
{/* @ts-ignore */}
|
2021-09-10 11:05:16 +00:00
|
|
|
{this.props.t('dialog.moderationVideoLabel')}
|
|
|
|
</label>
|
|
|
|
<Switch
|
2022-08-03 11:24:44 +00:00
|
|
|
// @ts-ignore
|
|
|
|
checked = { !this.state.moderationEnabled }
|
2021-09-10 11:05:16 +00:00
|
|
|
id = 'moderation-switch'
|
2022-08-03 11:24:44 +00:00
|
|
|
onChange = { this._onToggleModeration } />
|
2021-09-10 11:05:16 +00:00
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
)}
|
2021-02-24 21:45:07 +00:00
|
|
|
</div>
|
|
|
|
</Dialog>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
_onSubmit: () => boolean;
|
|
|
|
}
|
|
|
|
|
2022-08-03 11:24:44 +00:00
|
|
|
// @ts-ignore
|
2021-02-24 21:45:07 +00:00
|
|
|
export default translate(connect(abstractMapStateToProps)(MuteEveryonesVideoDialog));
|