feat(remote-participant-menu) Enhance remote participant menu:

- option to hide the context menu
- option to hide private chat button
This commit is contained in:
Horatiu Muresan
2022-03-14 16:46:19 +02:00
committed by GitHub
parent 3d5f838870
commit 506f72d43e
5 changed files with 46 additions and 17 deletions

View File

@@ -86,6 +86,11 @@ type Props = {
*/
participantID: string,
/**
* Whether the remote video context menu is disabled.
*/
_disabled: Boolean,
/**
* The ID for the participant on which the remote video menu will act.
*/
@@ -151,6 +156,7 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
*/
render() {
const {
_disabled,
_overflowDrawer,
_showConnectionInfo,
_participantDisplayName,
@@ -159,9 +165,13 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
participantID,
popoverVisible
} = this.props;
const content = _showConnectionInfo
? <ConnectionIndicatorContent participantId = { participantID } />
: this._renderRemoteVideoMenu();
let content;
if (_showConnectionInfo) {
content = <ConnectionIndicatorContent participantId = { participantID } />;
} else if (!_disabled) {
content = this._renderRemoteVideoMenu();
}
if (!content) {
return null;
@@ -177,7 +187,7 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
onPopoverOpen = { this._onPopoverOpen }
position = { this.props._menuPosition }
visible = { popoverVisible }>
{!_overflowDrawer && buttonVisible && (
{!_overflowDrawer && buttonVisible && !_disabled && (
<span
className = { classes.triggerButton }
role = 'button'>
@@ -266,6 +276,7 @@ function _mapStateToProps(state, ownProps) {
const activeParticipant = requestedParticipant || controlled;
const { overflowDrawer } = state['features/toolbox'];
const { showConnectionInfo } = state['features/base/connection'];
const { remoteVideoMenu } = state['features/base/config'];
if (_supportsRemoteControl
&& ((!active && !_isRemoteControlSessionActive) || activeParticipant === participantID)) {
@@ -296,6 +307,7 @@ function _mapStateToProps(state, ownProps) {
}
return {
_disabled: remoteVideoMenu?.disabled,
_menuPosition,
_overflowDrawer: overflowDrawer,
_participant: participant,