diff --git a/react/features/base/ui/components/web/Button.tsx b/react/features/base/ui/components/web/Button.tsx index 0173df276..692379139 100644 --- a/react/features/base/ui/components/web/Button.tsx +++ b/react/features/base/ui/components/web/Button.tsx @@ -203,6 +203,7 @@ const Button = ({ disabled = { disabled } { ...(id ? { id } : {}) } onClick = { onClick } + title = { accessibilityLabel } type = { isSubmit ? 'submit' : 'button' }> {icon && { +const styles = () => { return { triggerButton: { - backgroundColor: theme.palette.action01, - padding: '3px', - display: 'inline-block', + padding: '3px !important', borderRadius: '4px' }, @@ -215,26 +234,18 @@ class LocalVideoMenuTriggerButton extends Component { overflowDrawer = { _overflowDrawer } position = { _menuPosition } visible = { popoverVisible }> - {!_overflowDrawer && buttonVisible && ( - - {!isMobileBrowser() && - } - + icon = { IconHorizontalPoints } + size = 'small' /> )} : null ); } - _onPopoverOpen: () => void; - /** * Disable and hide toolbox while context menu is open. * @@ -247,8 +258,6 @@ class LocalVideoMenuTriggerButton extends Component { dispatch(setParticipantContextMenuOpen(true)); } - _onPopoverClose: () => void; - /** * Render normal context menu next time popover dialog opens. * @@ -273,7 +282,7 @@ class LocalVideoMenuTriggerButton extends Component { * @private * @returns {Props} */ -function _mapStateToProps(state, ownProps) { +function _mapStateToProps(state: any, ownProps: Partial) { const { thumbnailType } = ownProps; const localParticipant = getLocalParticipant(state); const { disableLocalVideoFlip, disableSelfViewSettings } = state['features/base/config']; @@ -309,4 +318,5 @@ function _mapStateToProps(state, ownProps) { }; } +// @ts-ignore export default translate(connect(_mapStateToProps)(withStyles(styles)(LocalVideoMenuTriggerButton))); diff --git a/react/features/video-menu/components/web/RemoteVideoMenuTriggerButton.js b/react/features/video-menu/components/web/RemoteVideoMenuTriggerButton.tsx similarity index 87% rename from react/features/video-menu/components/web/RemoteVideoMenuTriggerButton.js rename to react/features/video-menu/components/web/RemoteVideoMenuTriggerButton.tsx index 2c00128aa..8e215f828 100644 --- a/react/features/video-menu/components/web/RemoteVideoMenuTriggerButton.js +++ b/react/features/video-menu/components/web/RemoteVideoMenuTriggerButton.tsx @@ -1,26 +1,34 @@ -// @flow - -/* eslint-disable react/jsx-handler-names */ +/* eslint-disable lines-around-comment */ import { withStyles } from '@material-ui/styles'; import React, { Component } from 'react'; -import { batch } from 'react-redux'; +import { batch, connect } from 'react-redux'; -import ConnectionIndicatorContent from - '../../../../features/connection-indicator/components/web/ConnectionIndicatorContent'; import { isMobileBrowser } from '../../../base/environment/utils'; +// @ts-ignore import { translate } from '../../../base/i18n'; -import { Icon, IconHorizontalPoints } from '../../../base/icons'; +import { IconHorizontalPoints } from '../../../base/icons/svg/index'; +// @ts-ignore import { getParticipantById } from '../../../base/participants'; +// @ts-ignore import { Popover } from '../../../base/popover'; -import { connect } from '../../../base/redux'; +// @ts-ignore import { setParticipantContextMenuOpen } from '../../../base/responsive-ui/actions'; +import Button from '../../../base/ui/components/web/Button'; +import ConnectionIndicatorContent from +// @ts-ignore + '../../../connection-indicator/components/web/ConnectionIndicatorContent'; +// @ts-ignore import { THUMBNAIL_TYPE } from '../../../filmstrip'; +// @ts-ignore import { renderConnectionStatus } from '../../actions.web'; +// @ts-ignore import ParticipantContextMenu from './ParticipantContextMenu'; +// @ts-ignore import { REMOTE_CONTROL_MENU_STATES } from './RemoteControlButton'; +// eslint-disable-next-line no-var, @typescript-eslint/no-unused-vars declare var $: Object; /** @@ -30,19 +38,9 @@ declare var $: Object; type Props = { /** - * Hides popover. + * Whether the remote video context menu is disabled. */ - hidePopover: Function, - - /** - * Whether the popover is visible or not. - */ - popoverVisible: boolean, - - /** - * Shows popover. - */ - showPopover: Function, + _disabled: Boolean, /** * The position relative to the trigger the remote menu should display @@ -61,11 +59,21 @@ type Props = { */ _participant: Object, + /** + * The ID for the participant on which the remote video menu will act. + */ + _participantDisplayName: string, + /** * The current state of the participant's remote control session. */ _remoteControlState: number, + /** + * Whether the popover should render the Connection Info stats. + */ + _showConnectionInfo: Boolean, + /** * Whether or not the button should be visible. */ @@ -74,45 +82,48 @@ type Props = { /** * An object containing the CSS classes. */ - classes: Object, + classes: any, /** * The redux dispatch function. */ dispatch: Function, + /** + * Hides popover. + */ + hidePopover: Function, + /** * The ID for the participant on which the remote video menu will act. */ participantID: string, /** - * Whether the remote video context menu is disabled. + * Whether the popover is visible or not. */ - _disabled: Boolean, + popoverVisible: boolean, /** - * The ID for the participant on which the remote video menu will act. + * Shows popover. */ - _participantDisplayName: string, - - /** - * Whether the popover should render the Connection Info stats. - */ - _showConnectionInfo: Boolean, + showPopover: Function, /** * Invoked to obtain translated strings. */ - t: Function + t: Function, + + /** + * The type of the thumbnail. + */ + thumbnailType: string }; -const styles = theme => { +const styles = () => { return { triggerButton: { - backgroundColor: theme.palette.action01, - padding: '3px', - display: 'inline-block', + padding: '3px !important', borderRadius: '4px' }, @@ -188,24 +199,16 @@ class RemoteVideoMenuTriggerButton extends Component { position = { this.props._menuPosition } visible = { popoverVisible }> {!_overflowDrawer && buttonVisible && !_disabled && ( - - {!isMobileBrowser() && - } - + icon = { IconHorizontalPoints } + size = 'small' /> )} ); } - _onPopoverOpen: () => void; - /** * Disable and hide toolbox while context menu is open. * @@ -218,8 +221,6 @@ class RemoteVideoMenuTriggerButton extends Component { dispatch(setParticipantContextMenuOpen(true)); } - _onPopoverClose: () => void; - /** * Render normal context menu next time popover dialog opens. * @@ -264,7 +265,7 @@ class RemoteVideoMenuTriggerButton extends Component { * @private * @returns {Props} */ -function _mapStateToProps(state, ownProps) { +function _mapStateToProps(state: any, ownProps: Partial) { const { participantID, thumbnailType } = ownProps; let _remoteControlState = null; const participant = getParticipantById(state, participantID); @@ -317,4 +318,5 @@ function _mapStateToProps(state, ownProps) { } export default translate(connect(_mapStateToProps)( + // @ts-ignore withStyles(styles)(RemoteVideoMenuTriggerButton)));