2022-08-02 10:51:42 +00:00
|
|
|
/* eslint-disable lines-around-comment */
|
2021-11-10 11:19:40 +00:00
|
|
|
import React from 'react';
|
2022-08-08 09:36:06 +00:00
|
|
|
import { WithTranslation } from 'react-i18next';
|
2021-11-10 11:19:40 +00:00
|
|
|
|
2022-08-02 10:51:42 +00:00
|
|
|
// @ts-ignore
|
2021-11-10 11:19:40 +00:00
|
|
|
import { AbstractDialogTab } from '../../../base/dialog';
|
2022-08-02 10:51:42 +00:00
|
|
|
// @ts-ignore
|
2021-11-10 11:19:40 +00:00
|
|
|
import type { Props as AbstractDialogTabProps } from '../../../base/dialog';
|
2022-08-08 09:36:06 +00:00
|
|
|
import { translate } from '../../../base/i18n/functions';
|
2022-08-02 10:51:42 +00:00
|
|
|
import Checkbox from '../../../base/ui/components/web/Checkbox';
|
2021-11-10 11:19:40 +00:00
|
|
|
|
|
|
|
/**
|
2022-09-15 12:20:11 +00:00
|
|
|
* The type of the React {@code Component} props of {@link ModeratorTab}.
|
2021-11-10 11:19:40 +00:00
|
|
|
*/
|
2022-08-08 09:36:06 +00:00
|
|
|
export type Props = AbstractDialogTabProps & WithTranslation & {
|
2021-11-10 11:19:40 +00:00
|
|
|
|
2021-12-13 19:46:05 +00:00
|
|
|
/**
|
2021-12-14 14:24:35 +00:00
|
|
|
* If set hides the reactions moderation setting.
|
2021-12-13 19:46:05 +00:00
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
disableReactionsModeration: boolean;
|
2021-12-13 19:46:05 +00:00
|
|
|
|
2021-11-10 11:19:40 +00:00
|
|
|
/**
|
|
|
|
* Whether or not follow me is currently active (enabled by some other participant).
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
followMeActive: boolean;
|
2021-11-10 11:19:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not the user has selected the Follow Me feature to be enabled.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
followMeEnabled: boolean;
|
2021-11-10 11:19:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not the user has selected the Start Audio Muted feature to be
|
|
|
|
* enabled.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
startAudioMuted: boolean;
|
2021-11-10 11:19:40 +00:00
|
|
|
|
|
|
|
/**
|
2022-08-02 10:51:42 +00:00
|
|
|
* Whether or not the user has selected the Start Reactions Muted feature to be
|
2021-11-10 11:19:40 +00:00
|
|
|
* enabled.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
startReactionsMuted: boolean;
|
2021-11-10 11:19:40 +00:00
|
|
|
|
|
|
|
/**
|
2022-08-02 10:51:42 +00:00
|
|
|
* Whether or not the user has selected the Start Video Muted feature to be
|
2021-11-10 11:19:40 +00:00
|
|
|
* enabled.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
startVideoMuted: boolean;
|
2021-11-10 11:19:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Invoked to obtain translated strings.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
t: Function;
|
2021-11-10 11:19:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* React {@code Component} for modifying language and moderator settings.
|
|
|
|
*
|
|
|
|
* @augments Component
|
|
|
|
*/
|
|
|
|
class ModeratorTab extends AbstractDialogTab<Props> {
|
|
|
|
/**
|
2022-09-15 12:20:11 +00:00
|
|
|
* Initializes a new {@code ModeratorTab} instance.
|
2021-11-10 11:19:40 +00:00
|
|
|
*
|
|
|
|
* @param {Object} props - The read-only properties with which the new
|
|
|
|
* instance is to be initialized.
|
|
|
|
*/
|
|
|
|
constructor(props: Props) {
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
// Bind event handler so it is only bound once for every instance.
|
|
|
|
this._onStartAudioMutedChanged = this._onStartAudioMutedChanged.bind(this);
|
|
|
|
this._onStartVideoMutedChanged = this._onStartVideoMutedChanged.bind(this);
|
|
|
|
this._onStartReactionsMutedChanged = this._onStartReactionsMutedChanged.bind(this);
|
|
|
|
this._onFollowMeEnabledChanged = this._onFollowMeEnabledChanged.bind(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
return <div className = 'moderator-tab box'>{ this._renderModeratorSettings() }</div>;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback invoked to select if conferences should start
|
|
|
|
* with audio muted.
|
|
|
|
*
|
|
|
|
* @param {Object} e - The key event to handle.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
2022-08-02 10:51:42 +00:00
|
|
|
_onStartAudioMutedChanged({ target: { checked } }: React.ChangeEvent<HTMLInputElement>) {
|
2021-11-10 11:19:40 +00:00
|
|
|
super._onChange({ startAudioMuted: checked });
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback invoked to select if conferences should start
|
|
|
|
* with video disabled.
|
|
|
|
*
|
|
|
|
* @param {Object} e - The key event to handle.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
2022-08-02 10:51:42 +00:00
|
|
|
_onStartVideoMutedChanged({ target: { checked } }: React.ChangeEvent<HTMLInputElement>) {
|
2021-11-10 11:19:40 +00:00
|
|
|
super._onChange({ startVideoMuted: checked });
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback invoked to select if conferences should start
|
|
|
|
* with reactions muted.
|
|
|
|
*
|
|
|
|
* @param {Object} e - The key event to handle.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
2022-08-02 10:51:42 +00:00
|
|
|
_onStartReactionsMutedChanged({ target: { checked } }: React.ChangeEvent<HTMLInputElement>) {
|
2021-11-10 11:19:40 +00:00
|
|
|
super._onChange({ startReactionsMuted: checked });
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback invoked to select if follow-me mode
|
|
|
|
* should be activated.
|
|
|
|
*
|
|
|
|
* @param {Object} e - The key event to handle.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
2022-08-02 10:51:42 +00:00
|
|
|
_onFollowMeEnabledChanged({ target: { checked } }: React.ChangeEvent<HTMLInputElement>) {
|
2021-11-10 11:19:40 +00:00
|
|
|
super._onChange({ followMeEnabled: checked });
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the React Element for modifying conference-wide settings.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
_renderModeratorSettings() {
|
|
|
|
const {
|
2021-12-13 19:46:05 +00:00
|
|
|
disableReactionsModeration,
|
2021-11-10 11:19:40 +00:00
|
|
|
followMeActive,
|
|
|
|
followMeEnabled,
|
|
|
|
startAudioMuted,
|
|
|
|
startVideoMuted,
|
|
|
|
startReactionsMuted,
|
2022-08-02 10:51:42 +00:00
|
|
|
t // @ts-ignore
|
2021-11-10 11:19:40 +00:00
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
className = 'settings-sub-pane-element'
|
|
|
|
key = 'moderator'>
|
|
|
|
<div className = 'moderator-settings-wrapper'>
|
|
|
|
<Checkbox
|
2022-08-02 10:51:42 +00:00
|
|
|
checked = { startAudioMuted }
|
|
|
|
className = 'settings-checkbox'
|
2021-11-10 11:19:40 +00:00
|
|
|
label = { t('settings.startAudioMuted') }
|
|
|
|
name = 'start-audio-muted'
|
|
|
|
onChange = { this._onStartAudioMutedChanged } />
|
|
|
|
<Checkbox
|
2022-08-02 10:51:42 +00:00
|
|
|
checked = { startVideoMuted }
|
|
|
|
className = 'settings-checkbox'
|
2021-11-10 11:19:40 +00:00
|
|
|
label = { t('settings.startVideoMuted') }
|
|
|
|
name = 'start-video-muted'
|
|
|
|
onChange = { this._onStartVideoMutedChanged } />
|
|
|
|
<Checkbox
|
2022-08-02 10:51:42 +00:00
|
|
|
checked = { followMeEnabled && !followMeActive }
|
|
|
|
className = 'settings-checkbox'
|
|
|
|
disabled = { followMeActive }
|
2021-11-10 11:19:40 +00:00
|
|
|
label = { t('settings.followMe') }
|
|
|
|
name = 'follow-me'
|
|
|
|
onChange = { this._onFollowMeEnabledChanged } />
|
2021-12-13 19:46:05 +00:00
|
|
|
{ !disableReactionsModeration
|
|
|
|
&& <Checkbox
|
2022-08-02 10:51:42 +00:00
|
|
|
checked = { startReactionsMuted }
|
|
|
|
className = 'settings-checkbox'
|
2021-12-13 19:46:05 +00:00
|
|
|
label = { t('settings.startReactionsMuted') }
|
|
|
|
name = 'start-reactions-muted'
|
|
|
|
onChange = { this._onStartReactionsMutedChanged } /> }
|
2021-11-10 11:19:40 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-08-08 09:36:06 +00:00
|
|
|
// @ts-ignore
|
2021-11-10 11:19:40 +00:00
|
|
|
export default translate(ModeratorTab);
|