feat(participants-pane) implement participants pane

This commit is contained in:
Gabriel Imre
2021-04-21 16:48:05 +03:00
committed by GitHub
parent 6efa94541e
commit d014a52ab3
49 changed files with 1549 additions and 81 deletions

View File

@@ -19,7 +19,7 @@ import {
IconExitFullScreen,
IconFeedback,
IconFullScreen,
IconInviteMore,
IconParticipants,
IconPresentation,
IconRaisedHand,
IconRec,
@@ -37,13 +37,16 @@ import { OverflowMenuItem } from '../../../base/toolbox/components';
import { getLocalVideoTrack, toggleScreensharing } from '../../../base/tracks';
import { isVpaasMeeting } from '../../../billing-counter/functions';
import { ChatCounter, toggleChat } from '../../../chat';
import { InviteMore } from '../../../conference';
import { EmbedMeetingDialog } from '../../../embed-meeting';
import { SharedDocumentButton } from '../../../etherpad';
import { openFeedbackDialog } from '../../../feedback';
import { beginAddPeople } from '../../../invite';
import { openKeyboardShortcutsDialog } from '../../../keyboard-shortcuts';
import { LocalRecordingInfoDialog } from '../../../local-recording';
import {
close as closeParticipantsPane,
open as openParticipantsPane
} from '../../../participants-pane/actions';
import { getParticipantsPaneOpen } from '../../../participants-pane/functions';
import {
LiveStreamButton,
RecordButton
@@ -179,6 +182,11 @@ type Props = {
*/
_overflowMenuVisible: boolean,
/**
* Whether or not the participants pane is open.
*/
_participantsPaneOpen: boolean,
/**
* Whether or not the local participant's hand is raised.
*/
@@ -240,11 +248,12 @@ class Toolbox extends Component<Props> {
this._onShortcutToggleChat = this._onShortcutToggleChat.bind(this);
this._onShortcutToggleFullScreen = this._onShortcutToggleFullScreen.bind(this);
this._onShortcutToggleParticipantsPane = this._onShortcutToggleParticipantsPane.bind(this);
this._onShortcutToggleRaiseHand = this._onShortcutToggleRaiseHand.bind(this);
this._onShortcutToggleScreenshare = this._onShortcutToggleScreenshare.bind(this);
this._onShortcutToggleVideoQuality = this._onShortcutToggleVideoQuality.bind(this);
this._onToolbarOpenFeedback = this._onToolbarOpenFeedback.bind(this);
this._onToolbarOpenInvite = this._onToolbarOpenInvite.bind(this);
this._onToolbarToggleParticipantsPane = this._onToolbarToggleParticipantsPane.bind(this);
this._onToolbarOpenKeyboardShortcuts = this._onToolbarOpenKeyboardShortcuts.bind(this);
this._onToolbarOpenSpeakerStats = this._onToolbarOpenSpeakerStats.bind(this);
this._onToolbarOpenEmbedMeeting = this._onToolbarOpenEmbedMeeting.bind(this);
@@ -282,6 +291,11 @@ class Toolbox extends Component<Props> {
exec: this._onShortcutToggleScreenshare,
helpDescription: 'keyboardShortcuts.toggleScreensharing'
},
this._shouldShowButton('participants-pane') && {
character: 'P',
exec: this._onShortcutToggleParticipantsPane,
helpDescription: 'keyboardShortcuts.toggleParticipantsPane'
},
this._shouldShowButton('raisehand') && {
character: 'R',
exec: this._onShortcutToggleRaiseHand,
@@ -577,6 +591,25 @@ class Toolbox extends Component<Props> {
this._doToggleChat();
}
_onShortcutToggleParticipantsPane: () => void;
/**
* Creates an analytics keyboard shortcut event and dispatches an action for
* toggling the display of the participants pane.
*
* @private
* @returns {void}
*/
_onShortcutToggleParticipantsPane() {
sendAnalytics(createShortcutEvent(
'toggle.participants-pane',
{
enable: !this.props._participantsPaneOpen
}));
this._onToolbarToggleParticipantsPane();
}
_onShortcutToggleVideoQuality: () => void;
/**
@@ -694,18 +727,22 @@ class Toolbox extends Component<Props> {
this._doOpenFeedback();
}
_onToolbarOpenInvite: () => void;
_onToolbarToggleParticipantsPane: () => void;
/**
* Creates an analytics toolbar event and dispatches an action for opening
* the modal for inviting people directly into the conference.
* Dispatches an action for toggling the participants pane.
*
* @private
* @returns {void}
*/
_onToolbarOpenInvite() {
sendAnalytics(createToolbarEvent('invite'));
this.props.dispatch(beginAddPeople());
_onToolbarToggleParticipantsPane() {
const { dispatch, _participantsPaneOpen } = this.props;
if (_participantsPaneOpen) {
dispatch(closeParticipantsPane());
} else {
dispatch(openParticipantsPane());
}
}
_onToolbarOpenKeyboardShortcuts: () => void;
@@ -1163,6 +1200,25 @@ class Toolbox extends Component<Props> {
text = { t(`toolbar.${_raisedHand ? 'lowerYourHand' : 'raiseYourHand'}`) } />);
}
if (this._shouldShowButton('participants-pane') || this._shouldShowButton('invite')) {
buttons.has('participants-pane')
? mainMenuAdditionalButtons.push(
<ToolbarButton
accessibilityLabel = { t('toolbar.accessibilityLabel.participants') }
icon = { IconParticipants }
onClick = { this._onToolbarToggleParticipantsPane }
toggled = { this.props._participantsPaneOpen }
tooltip = { t('toolbar.participants') } />)
: overflowMenuAdditionalButtons.push(
<OverflowMenuItem
accessibilityLabel = { t('toolbar.accessibilityLabel.participants') }
icon = { IconParticipants }
key = 'participants-pane'
onClick = { this._onToolbarToggleParticipantsPane }
text = { t('toolbar.participants') } />
);
}
if (this._shouldShowButton('tileview')) {
buttons.has('tileview')
? mainMenuAdditionalButtons.push(
@@ -1175,25 +1231,6 @@ class Toolbox extends Component<Props> {
showLabel = { true } />);
}
if (this._shouldShowButton('invite')) {
buttons.has('invite')
? mainMenuAdditionalButtons.push(
<ToolbarButton
accessibilityLabel = { t('toolbar.accessibilityLabel.invite') }
icon = { IconInviteMore }
key = 'invite'
onClick = { this._onToolbarOpenInvite }
tooltip = { t('toolbar.invite') } />)
: overflowMenuAdditionalButtons.push(
<OverflowMenuItem
accessibilityLabel = { t('toolbar.accessibilityLabel.invite') }
icon = { IconInviteMore }
key = 'invite'
onClick = { this._onToolbarOpenInvite }
text = { t('toolbar.invite') } />
);
}
return {
mainMenuAdditionalButtons,
overflowMenuAdditionalButtons
@@ -1254,7 +1291,6 @@ class Toolbox extends Component<Props> {
return (
<div className = { containerClassName }>
<div className = 'toolbox-content-wrapper'>
<InviteMore />
<div className = 'toolbox-content-items'>
{ this._renderAudioButton() }
{ this._renderVideoButton() }
@@ -1344,6 +1380,7 @@ function _mapStateToProps(state) {
_localRecState: localRecordingStates,
_locked: locked,
_overflowMenuVisible: overflowMenuVisible,
_participantsPaneOpen: getParticipantsPaneOpen(state),
_raisedHand: localParticipant.raisedHand,
_screensharing: (localVideo && localVideo.videoType === 'desktop') || isScreenAudioShared(state),
_visible: isToolboxVisible(state),