feat(popover): create a wrapper around InlineDialog
This commit is contained in:
parent
c54879d605
commit
85f0ad2791
|
@ -0,0 +1,33 @@
|
||||||
|
/**
|
||||||
|
* Mousemove padding styles are used to add invisible elements to the popover
|
||||||
|
* to allow mouse movement from the popover trigger to the popover itself
|
||||||
|
* without triggering a mouseleave event.
|
||||||
|
*/
|
||||||
|
.popover-mousemove-padding-bottom {
|
||||||
|
bottom: -15px;
|
||||||
|
height: 20px;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.popover-mousemove-padding-right {
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
right: -20;
|
||||||
|
top: 0;
|
||||||
|
width: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An invisible element is added to the top of the popover to ensure the mouse
|
||||||
|
* stays over the popover when the popover's height is shrunk, which would then
|
||||||
|
* normally leave the mouse outside of the popover itself and cause a mouseleave
|
||||||
|
* event.
|
||||||
|
*/
|
||||||
|
.popover-mouse-padding-top {
|
||||||
|
height: 30px;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: -25px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
|
@ -378,28 +378,6 @@
|
||||||
.remote-video-menu-trigger {
|
.remote-video-menu-trigger {
|
||||||
margin-top: 7px;
|
margin-top: 7px;
|
||||||
}
|
}
|
||||||
.popover-mousemove-padding-bottom {
|
|
||||||
bottom: -15px;
|
|
||||||
height: 20px;
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.popover-mousemove-padding-right {
|
|
||||||
height: 100%;
|
|
||||||
position: absolute;
|
|
||||||
right: -20;
|
|
||||||
top: 0;
|
|
||||||
width: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.popover-mouse-top-padding {
|
|
||||||
height: 30px;
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top: -25px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Audio indicator on video thumbnails.
|
* Audio indicator on video thumbnails.
|
||||||
|
|
|
@ -69,6 +69,7 @@
|
||||||
@import 'aui-components/dropdown';
|
@import 'aui-components/dropdown';
|
||||||
@import '404';
|
@import '404';
|
||||||
@import 'policy';
|
@import 'policy';
|
||||||
|
@import 'popover';
|
||||||
@import 'filmstrip';
|
@import 'filmstrip';
|
||||||
@import 'unsupported-browser/main';
|
@import 'unsupported-browser/main';
|
||||||
@import 'modals/invite/add-people';
|
@import 'modals/invite/add-people';
|
||||||
|
|
|
@ -0,0 +1,179 @@
|
||||||
|
import InlineDialog from '@atlaskit/inline-dialog';
|
||||||
|
import React, { Component } from 'react';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A map of dialog positions, relative to trigger, to css classes used to
|
||||||
|
* manipulate elements for handling mouse events.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @type {object}
|
||||||
|
*/
|
||||||
|
const DIALOG_TO_PADDING_POSITION = {
|
||||||
|
'left': 'popover-mousemove-padding-right',
|
||||||
|
'top': 'popover-mousemove-padding-bottom'
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Takes the position expected by {@code InlineDialog} and maps it to a CSS
|
||||||
|
* class that can be used styling the elements used for preventing mouseleave
|
||||||
|
* events when moving from the trigger to the dialog.
|
||||||
|
*
|
||||||
|
* @param {string} position - From which position the dialog will display.
|
||||||
|
* @private
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
function _mapPositionToPaddingClass(position = 'left') {
|
||||||
|
return DIALOG_TO_PADDING_POSITION[position.split(' ')[0]];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implements a React {@code Component} for showing an {@code InlineDialog} on
|
||||||
|
* mouseenter of the trigger and contents, and hiding the dialog on mouseleave.
|
||||||
|
*
|
||||||
|
* @extends Component
|
||||||
|
*/
|
||||||
|
class Popover extends Component {
|
||||||
|
/**
|
||||||
|
* Default values for {@code Popover} component's properties.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
static defaultProps = {
|
||||||
|
className: '',
|
||||||
|
id: ''
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@code Popover} component's property types.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
static propTypes = {
|
||||||
|
/**
|
||||||
|
* A child React Element to use as the trigger for showing the dialog.
|
||||||
|
*/
|
||||||
|
children: React.PropTypes.object,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Additional CSS classnames to apply to the root of the {@code Popover}
|
||||||
|
* component.
|
||||||
|
*/
|
||||||
|
className: React.PropTypes.string,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The ReactElement to display within the dialog.
|
||||||
|
*/
|
||||||
|
content: React.PropTypes.object,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An id attribute to apply to the root of the {@code Popover}
|
||||||
|
* component.
|
||||||
|
*/
|
||||||
|
id: React.PropTypes.string,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback to invoke when the popover has opened.
|
||||||
|
*/
|
||||||
|
onPopoverOpen: React.PropTypes.func,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* From which side of the dialog trigger the dialog should display. The
|
||||||
|
* value will be passed to {@code InlineDialog}.
|
||||||
|
*/
|
||||||
|
position: React.PropTypes.string
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes a new {@code Popover} instance.
|
||||||
|
*
|
||||||
|
* @param {Object} props - The read-only properties with which the new
|
||||||
|
* instance is to be initialized.
|
||||||
|
*/
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
|
||||||
|
this.state = {
|
||||||
|
/**
|
||||||
|
* Whether or not the {@code InlineDialog} should be displayed.
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
showDialog: false
|
||||||
|
};
|
||||||
|
|
||||||
|
// Bind event handlers so they are only bound once for every instance.
|
||||||
|
this._onHideDialog = this._onHideDialog.bind(this);
|
||||||
|
this._onShowDialog = this._onShowDialog.bind(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implements React's {@link Component#render()}.
|
||||||
|
*
|
||||||
|
* @inheritdoc
|
||||||
|
* @returns {ReactElement}
|
||||||
|
*/
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className = { this.props.className }
|
||||||
|
id = { this.props.id }
|
||||||
|
onMouseEnter = { this._onShowDialog }
|
||||||
|
onMouseLeave = { this._onHideDialog }>
|
||||||
|
<InlineDialog
|
||||||
|
content = { this._renderContent() }
|
||||||
|
isOpen = { this.state.showDialog }
|
||||||
|
position = { this.props.position }>
|
||||||
|
{ this.props.children }
|
||||||
|
</InlineDialog>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stops displaying the {@code InlineDialog}.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @returns {void}
|
||||||
|
*/
|
||||||
|
_onHideDialog() {
|
||||||
|
this.setState({ showDialog: false });
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Displays the {@code InlineDialog} and calls any registered onPopoverOpen
|
||||||
|
* callbacks.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @returns {void}
|
||||||
|
*/
|
||||||
|
_onShowDialog() {
|
||||||
|
this.setState({ showDialog: true });
|
||||||
|
|
||||||
|
if (this.props.onPopoverOpen) {
|
||||||
|
this.props.onPopoverOpen();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the React Element to be displayed in the {@code InlineDialog}.
|
||||||
|
* Also adds padding to support moving the mouse from the trigger to the
|
||||||
|
* dialog to prevent mouseleave events.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @returns {ReactElement}
|
||||||
|
*/
|
||||||
|
_renderContent() {
|
||||||
|
const { content, position } = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className = 'popover'>
|
||||||
|
{ content }
|
||||||
|
<div className = 'popover-mouse-padding-top' />
|
||||||
|
<div className = { _mapPositionToPaddingClass(position) } />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Popover;
|
|
@ -0,0 +1 @@
|
||||||
|
export { default as Popover } from './Popover';
|
|
@ -0,0 +1 @@
|
||||||
|
export * from './components';
|
|
@ -1,7 +1,7 @@
|
||||||
import { default as Popover } from '@atlaskit/inline-dialog';
|
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
|
||||||
import { JitsiParticipantConnectionStatus } from '../../base/lib-jitsi-meet';
|
import { JitsiParticipantConnectionStatus } from '../../base/lib-jitsi-meet';
|
||||||
|
import { Popover } from '../../base/popover';
|
||||||
import { ConnectionStatsTable } from '../../connection-stats';
|
import { ConnectionStatsTable } from '../../connection-stats';
|
||||||
|
|
||||||
import statsEmitter from '../statsEmitter';
|
import statsEmitter from '../statsEmitter';
|
||||||
|
@ -123,8 +123,6 @@ class ConnectionIndicator extends Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Bind event handlers so they are only bound once for every instance.
|
// Bind event handlers so they are only bound once for every instance.
|
||||||
this._onHideStats = this._onHideStats.bind(this);
|
|
||||||
this._onShowStats = this._onShowStats.bind(this);
|
|
||||||
this._onStatsUpdated = this._onStatsUpdated.bind(this);
|
this._onStatsUpdated = this._onStatsUpdated.bind(this);
|
||||||
this._onToggleShowMore = this._onToggleShowMore.bind(this);
|
this._onToggleShowMore = this._onToggleShowMore.bind(this);
|
||||||
}
|
}
|
||||||
|
@ -174,13 +172,9 @@ class ConnectionIndicator extends Component {
|
||||||
*/
|
*/
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div
|
|
||||||
className = 'indicator-container'
|
|
||||||
onMouseEnter = { this._onShowStats }
|
|
||||||
onMouseLeave = { this._onHideStats }>
|
|
||||||
<Popover
|
<Popover
|
||||||
|
className = 'indicator-container'
|
||||||
content = { this._renderStatisticsTable() }
|
content = { this._renderStatisticsTable() }
|
||||||
isOpen = { this.state.showStats }
|
|
||||||
position = { this.props.statsPopoverPosition }>
|
position = { this.props.statsPopoverPosition }>
|
||||||
<div className = 'popover-trigger'>
|
<div className = 'popover-trigger'>
|
||||||
<div className = 'connection-indicator indicator'>
|
<div className = 'connection-indicator indicator'>
|
||||||
|
@ -190,32 +184,9 @@ class ConnectionIndicator extends Component {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Popover>
|
</Popover>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the state not to show the Statistics Table popover.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @returns {void}
|
|
||||||
*/
|
|
||||||
_onHideStats() {
|
|
||||||
this.setState({ showStats: false });
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the state to show the Statistics Table popover.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @returns {void}
|
|
||||||
*/
|
|
||||||
_onShowStats() {
|
|
||||||
if (this.props.enableStatsDisplay) {
|
|
||||||
this.setState({ showStats: true });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback invoked when new connection stats associated with the passed in
|
* Callback invoked when new connection stats associated with the passed in
|
||||||
* user ID are available. Will update the component's display of current
|
* user ID are available. Will update the component's display of current
|
||||||
|
@ -295,9 +266,7 @@ class ConnectionIndicator extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a {@code ConnectionStatisticsTable} instance and an empty div
|
* Creates a {@code ConnectionStatisticsTable} instance.
|
||||||
* for preventing mouseleave events when moving from the icon to the
|
|
||||||
* popover.
|
|
||||||
*
|
*
|
||||||
* @returns {ReactElement}
|
* @returns {ReactElement}
|
||||||
*/
|
*/
|
||||||
|
@ -312,7 +281,6 @@ class ConnectionIndicator extends Component {
|
||||||
} = this.state.stats;
|
} = this.state.stats;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
|
||||||
<ConnectionStatsTable
|
<ConnectionStatsTable
|
||||||
bandwidth = { bandwidth }
|
bandwidth = { bandwidth }
|
||||||
bitrate = { bitrate }
|
bitrate = { bitrate }
|
||||||
|
@ -323,12 +291,6 @@ class ConnectionIndicator extends Component {
|
||||||
resolution = { resolution }
|
resolution = { resolution }
|
||||||
shouldShowMore = { this.state.showMoreStats }
|
shouldShowMore = { this.state.showMoreStats }
|
||||||
transport = { transport } />
|
transport = { transport } />
|
||||||
<div className = 'popover-mouse-top-padding' />
|
|
||||||
<div
|
|
||||||
className = { interfaceConfig.VERTICAL_FILMSTRIP
|
|
||||||
? 'popover-mousemove-padding-right'
|
|
||||||
: 'popover-mousemove-padding-bottom' } />
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import { default as Popover } from '@atlaskit/inline-dialog';
|
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -9,6 +8,8 @@ import {
|
||||||
VolumeSlider
|
VolumeSlider
|
||||||
} from './';
|
} from './';
|
||||||
|
|
||||||
|
import { Popover } from '../../base/popover';
|
||||||
|
|
||||||
declare var $: Object;
|
declare var $: Object;
|
||||||
declare var interfaceConfig: Object;
|
declare var interfaceConfig: Object;
|
||||||
|
|
||||||
|
@ -73,10 +74,6 @@ class RemoteVideoMenuTriggerButton extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.state = {
|
|
||||||
showRemoteMenu: false
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The internal reference to topmost DOM/HTML element backing the React
|
* The internal reference to topmost DOM/HTML element backing the React
|
||||||
* {@code Component}. Accessed directly for associating an element as
|
* {@code Component}. Accessed directly for associating an element as
|
||||||
|
@ -87,8 +84,7 @@ class RemoteVideoMenuTriggerButton extends Component {
|
||||||
*/
|
*/
|
||||||
this._rootElement = null;
|
this._rootElement = null;
|
||||||
|
|
||||||
// Bind event handlers so they are only bound once for every instance.
|
// Bind event handler so it is only bound once for every instance.
|
||||||
this._onHideRemoteMenu = this._onHideRemoteMenu.bind(this);
|
|
||||||
this._onShowRemoteMenu = this._onShowRemoteMenu.bind(this);
|
this._onShowRemoteMenu = this._onShowRemoteMenu.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,12 +102,9 @@ class RemoteVideoMenuTriggerButton extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
|
||||||
onMouseEnter = { this._onShowRemoteMenu }
|
|
||||||
onMouseLeave = { this._onHideRemoteMenu }>
|
|
||||||
<Popover
|
<Popover
|
||||||
content = { content }
|
content = { content }
|
||||||
isOpen = { this.state.showRemoteMenu }
|
onPopoverOpen = { this._onShowRemoteMenu }
|
||||||
position = { interfaceConfig.VERTICAL_FILMSTRIP
|
position = { interfaceConfig.VERTICAL_FILMSTRIP
|
||||||
? 'left middle' : 'top center' }>
|
? 'left middle' : 'top center' }>
|
||||||
<span
|
<span
|
||||||
|
@ -121,20 +114,9 @@ class RemoteVideoMenuTriggerButton extends Component {
|
||||||
title = 'Remote user controls' />
|
title = 'Remote user controls' />
|
||||||
</span>
|
</span>
|
||||||
</Popover>
|
</Popover>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Closes the {@code RemoteVideoMenu}.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @returns {void}
|
|
||||||
*/
|
|
||||||
_onHideRemoteMenu() {
|
|
||||||
this.setState({ showRemoteMenu: false });
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens the {@code RemoteVideoMenu}.
|
* Opens the {@code RemoteVideoMenu}.
|
||||||
*
|
*
|
||||||
|
@ -143,8 +125,6 @@ class RemoteVideoMenuTriggerButton extends Component {
|
||||||
*/
|
*/
|
||||||
_onShowRemoteMenu() {
|
_onShowRemoteMenu() {
|
||||||
this.props.onMenuDisplay();
|
this.props.onMenuDisplay();
|
||||||
|
|
||||||
this.setState({ showRemoteMenu: true });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -172,13 +152,11 @@ class RemoteVideoMenuTriggerButton extends Component {
|
||||||
<MuteButton
|
<MuteButton
|
||||||
isAudioMuted = { isAudioMuted }
|
isAudioMuted = { isAudioMuted }
|
||||||
key = 'mute'
|
key = 'mute'
|
||||||
onClick = { this._onHideRemoteMenu }
|
|
||||||
participantID = { participantID } />
|
participantID = { participantID } />
|
||||||
);
|
);
|
||||||
buttons.push(
|
buttons.push(
|
||||||
<KickButton
|
<KickButton
|
||||||
key = 'kick'
|
key = 'kick'
|
||||||
onClick = { this._onHideRemoteMenu }
|
|
||||||
participantID = { participantID } />
|
participantID = { participantID } />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -204,15 +182,9 @@ class RemoteVideoMenuTriggerButton extends Component {
|
||||||
|
|
||||||
if (buttons.length > 0) {
|
if (buttons.length > 0) {
|
||||||
return (
|
return (
|
||||||
<div>
|
|
||||||
<RemoteVideoMenu id = { participantID }>
|
<RemoteVideoMenu id = { participantID }>
|
||||||
{ buttons }
|
{ buttons }
|
||||||
</RemoteVideoMenu>
|
</RemoteVideoMenu>
|
||||||
<div
|
|
||||||
className = { interfaceConfig.VERTICAL_FILMSTRIP
|
|
||||||
? 'popover-mousemove-padding-right'
|
|
||||||
: 'popover-mousemove-padding-bottom' } />
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import { default as Popover } from '@atlaskit/inline-dialog';
|
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { translate } from '../../base/i18n';
|
import { translate } from '../../base/i18n';
|
||||||
|
import { Popover } from '../../base/popover';
|
||||||
import { VideoQualityDialog } from './';
|
import { VideoQualityDialog } from './';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -89,13 +88,6 @@ export class VideoQualityLabel extends Component {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
/**
|
|
||||||
* Whether or not the {@code VideoQualityDialog} is displayed.
|
|
||||||
*
|
|
||||||
* @type {boolean}
|
|
||||||
*/
|
|
||||||
showVideoQualityDialog: false,
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether or not the filmstrip is transitioning from not visible
|
* Whether or not the filmstrip is transitioning from not visible
|
||||||
* to visible. Used to set a transition class for animation.
|
* to visible. Used to set a transition class for animation.
|
||||||
|
@ -104,10 +96,6 @@ export class VideoQualityLabel extends Component {
|
||||||
*/
|
*/
|
||||||
togglingToVisible: false
|
togglingToVisible: false
|
||||||
};
|
};
|
||||||
|
|
||||||
// Bind event handlers so they are only bound once for every instance.
|
|
||||||
this._onHideQualityDialog = this._onHideQualityDialog.bind(this);
|
|
||||||
this._onShowQualityDialog = this._onShowQualityDialog.bind(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -161,14 +149,10 @@ export class VideoQualityLabel extends Component {
|
||||||
= `${baseClasses} ${filmstrip} ${remoteVideosVisible} ${opening}`;
|
= `${baseClasses} ${filmstrip} ${remoteVideosVisible} ${opening}`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
|
||||||
className = { classNames }
|
|
||||||
id = 'videoResolutionLabel'
|
|
||||||
onMouseEnter = { this._onShowQualityDialog }
|
|
||||||
onMouseLeave = { this._onHideQualityDialog }>
|
|
||||||
<Popover
|
<Popover
|
||||||
content = { this._renderQualityDialog() }
|
className = { classNames }
|
||||||
isOpen = { this.state.showVideoQualityDialog }
|
content = { <VideoQualityDialog /> }
|
||||||
|
id = 'videoResolutionLabel'
|
||||||
position = { 'left top' }>
|
position = { 'left top' }>
|
||||||
<div
|
<div
|
||||||
className = 'video-quality-label-status'>
|
className = 'video-quality-label-status'>
|
||||||
|
@ -177,7 +161,6 @@ export class VideoQualityLabel extends Component {
|
||||||
: this._mapResolutionToTranslation(_resolution) }
|
: this._mapResolutionToTranslation(_resolution) }
|
||||||
</div>
|
</div>
|
||||||
</Popover>
|
</Popover>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,41 +192,6 @@ export class VideoQualityLabel extends Component {
|
||||||
return this.props.t(
|
return this.props.t(
|
||||||
RESOLUTION_TO_TRANSLATION_KEY[highestMatchingResolution]);
|
RESOLUTION_TO_TRANSLATION_KEY[highestMatchingResolution]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Shows the {@code VideoQualityDialog}.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @returns {void}
|
|
||||||
*/
|
|
||||||
_onShowQualityDialog() {
|
|
||||||
this.setState({ showVideoQualityDialog: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Hides the {@code VideoQualityDialog}.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @returns {void}
|
|
||||||
*/
|
|
||||||
_onHideQualityDialog() {
|
|
||||||
this.setState({ showVideoQualityDialog: false });
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a React Element for choosing a maximum receive video quality.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @returns {ReactElement}
|
|
||||||
*/
|
|
||||||
_renderQualityDialog() {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<VideoQualityDialog />
|
|
||||||
<div className = 'popover-mousemove-padding-right' />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue