2020-11-10 14:49:38 +00:00
|
|
|
import React from 'react';
|
2022-02-03 15:45:02 +00:00
|
|
|
import Dialog from 'react-native-dialog';
|
2021-09-22 14:05:42 +00:00
|
|
|
import { Divider } from 'react-native-paper';
|
2020-11-10 14:49:38 +00:00
|
|
|
|
|
|
|
import { ConfirmDialog } from '../../../base/dialog';
|
|
|
|
import { translate } from '../../../base/i18n';
|
|
|
|
import { connect } from '../../../base/redux';
|
|
|
|
import AbstractMuteEveryoneDialog, {
|
2022-09-27 07:10:28 +00:00
|
|
|
type Props,
|
|
|
|
abstractMapStateToProps as _mapStateToProps } from '../AbstractMuteEveryoneDialog';
|
2020-11-10 14:49:38 +00:00
|
|
|
|
2021-09-22 14:05:42 +00:00
|
|
|
import styles from './styles';
|
|
|
|
|
2020-11-10 14:49:38 +00:00
|
|
|
/**
|
|
|
|
* A React Component with the contents for a dialog that asks for confirmation
|
|
|
|
* from the user before muting all remote participants.
|
|
|
|
*
|
2021-11-04 21:10:43 +00:00
|
|
|
* @augments AbstractMuteEveryoneDialog
|
2020-11-10 14:49:38 +00:00
|
|
|
*/
|
|
|
|
class MuteEveryoneDialog extends AbstractMuteEveryoneDialog<Props> {
|
|
|
|
|
2022-02-03 15:45:02 +00:00
|
|
|
/**
|
|
|
|
* Renders the dialog switch.
|
|
|
|
*
|
|
|
|
* @returns {React$Component}
|
|
|
|
*/
|
|
|
|
_renderSwitch() {
|
|
|
|
return (
|
|
|
|
this.props.exclude.length === 0
|
|
|
|
&& <Dialog.Switch
|
|
|
|
label = { this.props.t('dialog.moderationAudioLabel') }
|
|
|
|
onValueChange = { this._onToggleModeration }
|
|
|
|
value = { !this.state.audioModerationEnabled } />
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-11-10 14:49:38 +00:00
|
|
|
/**
|
|
|
|
* Implements {@code Component#render}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<ConfirmDialog
|
2022-02-03 15:45:02 +00:00
|
|
|
confirmLabel = 'dialog.muteParticipantButton'
|
|
|
|
descriptionKey = { this.state.content }
|
|
|
|
onSubmit = { this._onSubmit }
|
|
|
|
title = { this.props.title } >
|
|
|
|
<Divider style = { styles.dividerDialog } />
|
|
|
|
{ this._renderSwitch() }
|
2020-11-10 14:49:38 +00:00
|
|
|
</ConfirmDialog>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default translate(connect(_mapStateToProps)(MuteEveryoneDialog));
|