2020-02-24 12:47:37 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
2022-08-03 11:24:44 +00:00
|
|
|
import { translate } from '../../../base/i18n/functions';
|
|
|
|
import { connect } from '../../../base/redux/functions';
|
2022-10-10 09:12:02 +00:00
|
|
|
import Dialog from '../../../base/ui/components/web/Dialog';
|
2022-08-03 11:24:44 +00:00
|
|
|
import Switch from '../../../base/ui/components/web/Switch';
|
2022-09-27 07:10:28 +00:00
|
|
|
import AbstractMuteEveryoneDialog, { type Props, abstractMapStateToProps }
|
2021-09-10 11:05:16 +00:00
|
|
|
from '../AbstractMuteEveryoneDialog';
|
2020-02-24 12:47:37 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A React Component with the contents for a dialog that asks for confirmation
|
2020-11-10 14:49:38 +00:00
|
|
|
* from the user before muting all remote participants.
|
2020-02-24 12:47:37 +00:00
|
|
|
*
|
2021-11-04 21:10:43 +00:00
|
|
|
* @augments AbstractMuteEveryoneDialog
|
2020-02-24 12:47:37 +00:00
|
|
|
*/
|
2020-11-10 14:49:38 +00:00
|
|
|
class MuteEveryoneDialog extends AbstractMuteEveryoneDialog<Props> {
|
2021-09-10 11:05:16 +00:00
|
|
|
|
2020-02-24 12:47:37 +00:00
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<Dialog
|
2022-10-10 09:12:02 +00:00
|
|
|
ok = {{ translationKey: 'dialog.muteParticipantButton' }}
|
2020-02-24 12:47:37 +00:00
|
|
|
onSubmit = { this._onSubmit }
|
2022-10-10 09:12:02 +00:00
|
|
|
title = { this.props.title }>
|
2021-09-10 11:05:16 +00:00
|
|
|
<div className = 'mute-dialog'>
|
|
|
|
{ this.state.content }
|
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'>
|
|
|
|
{this.props.t('dialog.moderationAudioLabel')}
|
|
|
|
</label>
|
|
|
|
<Switch
|
2022-08-03 11:24:44 +00:00
|
|
|
checked = { !this.state.audioModerationEnabled }
|
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>
|
|
|
|
</>
|
|
|
|
)}
|
2020-02-24 12:47:37 +00:00
|
|
|
</div>
|
|
|
|
</Dialog>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-10 14:49:38 +00:00
|
|
|
export default translate(connect(abstractMapStateToProps)(MuteEveryoneDialog));
|