@ -1,6 +1,7 @@
// @flow
import React , { Component } from 'react' ;
import { batch } from 'react-redux' ;
import ConnectionIndicatorContent from
'../../../../features/connection-indicator/components/web/ConnectionIndicatorContent' ;
@ -10,9 +11,9 @@ import { Icon, IconMenuThumb } from '../../../base/icons';
import { getLocalParticipant , getParticipantById , PARTICIPANT _ROLE } from '../../../base/participants' ;
import { Popover } from '../../../base/popover' ;
import { connect } from '../../../base/redux' ;
import { setParticipantContextMenuOpen } from '../../../base/responsive-ui/actions' ;
import { requestRemoteControl , stopController } from '../../../remote-control' ;
import { setToolboxEnabled , disableToolboxOnTileView } from '../../../toolbox/actions' ;
import { isToolboxEnabled } from '../../../toolbox/functions' ;
import { hideToolboxOnTileView } from '../../../toolbox/actions' ;
import { getCurrentLayout , LAYOUTS } from '../../../video-layout' ;
import { renderConnectionStatus } from '../../actions.web' ;
@ -78,11 +79,6 @@ type Props = {
* /
_remoteControlState : number ,
/ * *
* Whether the toolbox is enabled or not .
* /
_toolboxEnabled : boolean ,
/ * *
* The redux dispatch function .
* /
@ -133,11 +129,6 @@ type Props = {
* @ extends { Component }
* /
class RemoteVideoMenuTriggerButton extends Component < Props > {
/ * *
* Preserve the intial toolbox state .
* /
initialToolboxEnabled : boolean ;
/ * *
* Reference to the Popover instance .
* /
@ -153,7 +144,6 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
super ( props ) ;
this . popoverRef = React . createRef ( ) ;
this . initialToolboxEnabled = true ;
this . _onPopoverClose = this . _onPopoverClose . bind ( this ) ;
this . _onPopoverOpen = this . _onPopoverOpen . bind ( this ) ;
}
@ -179,8 +169,6 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
if ( this . props . getRef ) {
this . props . getRef ( this ) ;
}
this . initialToolboxEnabled = this . props . _toolboxEnabled ;
}
/ * *
@ -202,7 +190,7 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
* @ returns { ReactElement }
* /
render ( ) {
const { _showConnectionInfo , _participantDisplayName , participantID } = this . props ;
const { _overflowDrawer , _ showConnectionInfo , _participantDisplayName , participantID } = this . props ;
const content = _showConnectionInfo
? < ConnectionIndicatorContent participantId = { participantID } / >
: this . _renderRemoteVideoMenu ( ) ;
@ -218,18 +206,19 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
content = { content }
onPopoverClose = { this . _onPopoverClose }
onPopoverOpen = { this . _onPopoverOpen }
overflowDrawer = { this . props . _overflowDrawer }
overflowDrawer = { _overflowDrawer }
position = { this . props . _menuPosition }
ref = { this . popoverRef } >
{ ! isMobileBrowser ( ) && (
{ ! _overflowDrawer && (
< span className = 'popover-trigger remote-video-menu-trigger' >
< Icon
{ ! isMobileBrowser ( ) && < Icon
ariaLabel = { this . props . t ( 'dialog.remoteUserControls' , { username } ) }
role = 'button'
size = '1.4em'
src = { IconMenuThumb }
tabIndex = { 0 }
title = { this . props . t ( 'dialog.remoteUserControls' , { username } ) } / >
}
< / s p a n >
) }
< / P o p o v e r >
@ -244,7 +233,8 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
* @ returns { void }
* /
_onPopoverOpen ( ) {
this . props . dispatch ( disableToolboxOnTileView ( ) ) ;
this . props . dispatch ( setParticipantContextMenuOpen ( true ) ) ;
this . props . dispatch ( hideToolboxOnTileView ( ) ) ;
}
_onPopoverClose : ( ) => void ;
@ -255,8 +245,12 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
* @ returns { void }
* /
_onPopoverClose ( ) {
this . props . dispatch ( setToolboxEnabled ( this . initialToolboxEnabled ) ) ;
this . props . dispatch ( renderConnectionStatus ( false ) ) ;
const { dispatch } = this . props ;
batch ( ( ) => {
dispatch ( setParticipantContextMenuOpen ( false ) ) ;
dispatch ( renderConnectionStatus ( false ) ) ;
} ) ;
}
/ * *
@ -349,6 +343,7 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
if ( isMobileBrowser ( ) ) {
buttons . push (
< ConnectionStatusButton
key = 'conn-status'
participantId = { participantID } / >
) ;
}
@ -435,8 +430,7 @@ function _mapStateToProps(state, ownProps) {
_overflowDrawer : overflowDrawer ,
_participantDisplayName ,
_disableGrantModerator : Boolean ( disableGrantModerator ) ,
_showConnectionInfo : showConnectionInfo ,
_toolboxEnabled : isToolboxEnabled ( state )
_showConnectionInfo : showConnectionInfo
} ;
}