diff --git a/react/features/always-on-top/AlwaysOnTop.js b/react/features/always-on-top/AlwaysOnTop.js index cea7db5a3..7e66009fe 100644 --- a/react/features/always-on-top/AlwaysOnTop.js +++ b/react/features/always-on-top/AlwaysOnTop.js @@ -31,7 +31,7 @@ export default class AlwaysOnTop extends Component<*, State> { _hovered: boolean; /** - * Initializes new AlwaysOnTop instance. + * Initializes a new {@code AlwaysOnTop} instance. * * @param {*} props - The read-only properties with which the new instance * is to be initialized. diff --git a/react/features/always-on-top/AudioMuteButton.js b/react/features/always-on-top/AudioMuteButton.js index 337b44e96..35d89bb48 100644 --- a/react/features/always-on-top/AudioMuteButton.js +++ b/react/features/always-on-top/AudioMuteButton.js @@ -112,7 +112,7 @@ export default class AudioMuteButton * Indicates if audio is currently muted ot nor. * * @override - * @private + * @protected * @returns {boolean} */ _isAudioMuted() { @@ -123,7 +123,7 @@ export default class AudioMuteButton * Indicates whether this button is disabled or not. * * @override - * @private + * @protected * @returns {boolean} */ _isDisabled() { @@ -133,8 +133,9 @@ export default class AudioMuteButton /** * Changes the muted state. * + * @override * @param {boolean} audioMuted - Whether audio should be muted or not. - * @private + * @protected * @returns {void} */ _setAudioMuted(audioMuted: boolean) { // eslint-disable-line no-unused-vars diff --git a/react/features/always-on-top/HangupButton.js b/react/features/always-on-top/HangupButton.js index f4a821075..c9e88b020 100644 --- a/react/features/always-on-top/HangupButton.js +++ b/react/features/always-on-top/HangupButton.js @@ -13,7 +13,7 @@ export default class HangupButton extends AbstractHangupButton { * Helper function to perform the actual hangup action. * * @override - * @private + * @protected * @returns {void} */ _doHangup() { diff --git a/react/features/always-on-top/VideoMuteButton.js b/react/features/always-on-top/VideoMuteButton.js index 37e7d3971..bd55779cc 100644 --- a/react/features/always-on-top/VideoMuteButton.js +++ b/react/features/always-on-top/VideoMuteButton.js @@ -88,7 +88,7 @@ export default class VideoMuteButton * Indicates whether this button is disabled or not. * * @override - * @private + * @protected * @returns {boolean} */ _isDisabled() { @@ -99,7 +99,7 @@ export default class VideoMuteButton * Indicates if video is currently muted ot nor. * * @override - * @private + * @protected * @returns {boolean} */ _isVideoMuted() { @@ -109,8 +109,9 @@ export default class VideoMuteButton /** * Changes the muted state. * + * @override * @param {boolean} videoMuted - Whether video should be muted or not. - * @private + * @protected * @returns {void} */ _setVideoMuted(videoMuted: boolean) { // eslint-disable-line no-unused-vars diff --git a/react/features/base/toolbox/components/AbstractAudioMuteButton.js b/react/features/base/toolbox/components/AbstractAudioMuteButton.js index 201b68340..1a354603c 100644 --- a/react/features/base/toolbox/components/AbstractAudioMuteButton.js +++ b/react/features/base/toolbox/components/AbstractAudioMuteButton.js @@ -18,7 +18,7 @@ export default class AbstractAudioMuteButton * accordingly. * * @override - * @private + * @protected * @returns {void} */ _handleClick() { @@ -29,8 +29,7 @@ export default class AbstractAudioMuteButton * Helper function to be implemented by subclasses, which must return a * boolean value indicating if audio is muted or not. * - * @abstract - * @private + * @protected * @returns {boolean} */ _isAudioMuted() { @@ -41,7 +40,7 @@ export default class AbstractAudioMuteButton * Indicates whether this button is in toggled state or not. * * @override - * @private + * @protected * @returns {boolean} */ _isToggled() { @@ -53,7 +52,7 @@ export default class AbstractAudioMuteButton * action. * * @param {boolean} audioMuted - Whether video should be muted or not. - * @private + * @protected * @returns {void} */ _setAudioMuted(audioMuted: boolean) { // eslint-disable-line no-unused-vars diff --git a/react/features/base/toolbox/components/AbstractButton.js b/react/features/base/toolbox/components/AbstractButton.js index ceaa09c50..908f05c59 100644 --- a/react/features/base/toolbox/components/AbstractButton.js +++ b/react/features/base/toolbox/components/AbstractButton.js @@ -23,8 +23,7 @@ export type Props = { toggledStyles: ?Styles, /** - * From which direction the tooltip should appear, relative to the - * button. + * From which direction the tooltip should appear, relative to the button. */ tooltipPosition: string, @@ -87,11 +86,12 @@ export default class AbstractButton extends Component { * Initializes a new {@code AbstractButton} instance. * * @param {Props} props - The React {@code Component} props to initialize - * the new {@code AbstractAudioMuteButton} instance with. + * the new {@code AbstractButton} instance with. */ constructor(props: P) { super(props); + // Bind event handlers so they are only bound once per instance. this._onClick = this._onClick.bind(this); } @@ -99,8 +99,7 @@ export default class AbstractButton extends Component { * Helper function to be implemented by subclasses, which should be used * to handle the button being clicked / pressed. * - * @abstract - * @private + * @protected * @returns {void} */ _handleClick() { @@ -138,7 +137,7 @@ export default class AbstractButton extends Component { * Helper function to be implemented by subclasses, which must return a * boolean value indicating if this button is disabled or not. * - * @private + * @protected * @returns {boolean} */ _isDisabled() { @@ -147,9 +146,9 @@ export default class AbstractButton extends Component { /** * Helper function to be implemented by subclasses, which must return a - * boolean value indicating if this button is toggled or not. + * {@code boolean} value indicating if this button is toggled or not. * - * @private + * @protected * @returns {boolean} */ _isToggled() { diff --git a/react/features/base/toolbox/components/AbstractHangupButton.js b/react/features/base/toolbox/components/AbstractHangupButton.js index 181ad07a0..8523496af 100644 --- a/react/features/base/toolbox/components/AbstractHangupButton.js +++ b/react/features/base/toolbox/components/AbstractHangupButton.js @@ -15,7 +15,7 @@ export default class AbstractHangupButton

/** * Handles clicking / pressing the button, and disconnects the conference. * - * @private + * @protected * @returns {void} */ _handleClick() { @@ -25,8 +25,7 @@ export default class AbstractHangupButton

/** * Helper function to perform the actual hangup action. * - * @abstract - * @private + * @protected * @returns {void} */ _doHangup() { diff --git a/react/features/base/toolbox/components/AbstractToolboxItem.js b/react/features/base/toolbox/components/AbstractToolboxItem.js index 373688fbc..08cca5f2c 100644 --- a/react/features/base/toolbox/components/AbstractToolboxItem.js +++ b/react/features/base/toolbox/components/AbstractToolboxItem.js @@ -150,11 +150,7 @@ export default class AbstractToolboxItem

extends Component

{ _maybeTranslateAttribute(text) { const { t } = this.props; - if (typeof t === 'function') { - return t(text); - } - - return text; + return typeof t === 'function' ? t(text) : text; } _onClick: (*) => void; @@ -169,7 +165,7 @@ export default class AbstractToolboxItem

extends Component

{ _onClick(...args) { const { disabled, onClick } = this.props; - !disabled && onClick && onClick(...args); + disabled || (onClick && onClick(...args)); } /** @@ -189,10 +185,6 @@ export default class AbstractToolboxItem

extends Component

{ * @returns {ReactElement} */ render() { - if (!this.props.visible) { - return null; - } - - return this._renderItem(); + return this.props.visible ? this._renderItem() : null; } } diff --git a/react/features/base/toolbox/components/AbstractVideoMuteButton.js b/react/features/base/toolbox/components/AbstractVideoMuteButton.js index 7fe979851..a31f0b24e 100644 --- a/react/features/base/toolbox/components/AbstractVideoMuteButton.js +++ b/react/features/base/toolbox/components/AbstractVideoMuteButton.js @@ -17,7 +17,7 @@ export default class AbstractVideoMuteButton

* Handles clicking / pressing the button, and toggles the video mute state * accordingly. * - * @private + * @protected * @returns {void} */ _handleClick() { @@ -28,7 +28,7 @@ export default class AbstractVideoMuteButton

* Indicates whether this button is in toggled state or not. * * @override - * @private + * @protected * @returns {boolean} */ _isToggled() { @@ -37,10 +37,9 @@ export default class AbstractVideoMuteButton

/** * Helper function to be implemented by subclasses, which must return a - * boolean value indicating if video is muted or not. + * {@code boolean} value indicating if video is muted or not. * - * @abstract - * @private + * @protected * @returns {boolean} */ _isVideoMuted() { @@ -52,7 +51,7 @@ export default class AbstractVideoMuteButton

* action. * * @param {boolean} videoMuted - Whether video should be muted or not. - * @private + * @protected * @returns {void} */ _setVideoMuted(videoMuted: boolean) { // eslint-disable-line no-unused-vars diff --git a/react/features/base/toolbox/components/index.js b/react/features/base/toolbox/components/index.js index 59444b1fd..945aeadcd 100644 --- a/react/features/base/toolbox/components/index.js +++ b/react/features/base/toolbox/components/index.js @@ -1,7 +1,7 @@ // @flow +export { default as AbstractAudioMuteButton } from './AbstractAudioMuteButton'; export { default as AbstractButton } from './AbstractButton'; export type { Props as AbstractButtonProps } from './AbstractButton'; -export { default as AbstractAudioMuteButton } from './AbstractAudioMuteButton'; export { default as AbstractHangupButton } from './AbstractHangupButton'; export { default as AbstractVideoMuteButton } from './AbstractVideoMuteButton'; diff --git a/react/features/mobile/audio-mode/components/AudioRouteButton.js b/react/features/mobile/audio-mode/components/AudioRouteButton.js index b34f7333e..cfa5aab4d 100644 --- a/react/features/mobile/audio-mode/components/AudioRouteButton.js +++ b/react/features/mobile/audio-mode/components/AudioRouteButton.js @@ -104,12 +104,10 @@ class AudioRouteButton extends AbstractButton { * Implements React's {@link Component#render()}. * * @inheritdoc - * @returns {?ReactElement} + * @returns {React$Node} */ render() { if (!MPVolumeView && !AudioRoutePickerDialog) { - - // $FlowFixMe return null; } diff --git a/react/features/mobile/picture-in-picture/components/PictureInPictureButton.js b/react/features/mobile/picture-in-picture/components/PictureInPictureButton.js index e1f48ebc7..537074c16 100644 --- a/react/features/mobile/picture-in-picture/components/PictureInPictureButton.js +++ b/react/features/mobile/picture-in-picture/components/PictureInPictureButton.js @@ -33,7 +33,7 @@ class PictureInPictureButton extends AbstractButton { /** * Handles clicking / pressing the button. * - * @private + * @protected * @returns {void} */ _handleClick() { @@ -44,16 +44,10 @@ class PictureInPictureButton extends AbstractButton { * Implements React's {@link Component#render()}. * * @inheritdoc - * @returns {?ReactElement} + * @returns {React$Node} */ render() { - if (!this.props._enabled) { - - // $FlowFixMe - return null; - } - - return super.render(); + return this.props._enabled ? super.render() : null; } } diff --git a/react/features/room-lock/components/RoomLockButton.js b/react/features/room-lock/components/RoomLockButton.js index b2b5ef1a6..3b6aad9f8 100644 --- a/react/features/room-lock/components/RoomLockButton.js +++ b/react/features/room-lock/components/RoomLockButton.js @@ -38,7 +38,8 @@ class RoomLockButton extends AbstractButton { /** * Handles clicking / pressing the button. * - * @private + * @override + * @protected * @returns {void} */ _handleClick() { @@ -49,7 +50,7 @@ class RoomLockButton extends AbstractButton { * Indicates whether this button is disabled or not. * * @override - * @private + * @protected * @returns {boolean} */ _isDisabled() { @@ -60,7 +61,7 @@ class RoomLockButton extends AbstractButton { * Indicates whether this button is in toggled state or not. * * @override - * @private + * @protected * @returns {boolean} */ _isToggled() { diff --git a/react/features/settings/components/web/SettingsButton.js b/react/features/settings/components/web/SettingsButton.js index c7b330d18..d4c7e98cc 100644 --- a/react/features/settings/components/web/SettingsButton.js +++ b/react/features/settings/components/web/SettingsButton.js @@ -11,6 +11,9 @@ import { toggleSettings } from '../../../side-panel'; declare var interfaceConfig: Object; +/** + * The type of the React {@code Component} props of {@link SettingsButton}. + */ type Props = AbstractButtonProps & { /** @@ -41,7 +44,7 @@ class SettingsButton extends AbstractButton { /** * Handles clicking / pressing the button, and opens the appropriate dialog. * - * @private + * @protected * @returns {void} */ _handleClick() { diff --git a/react/features/toolbox/components/AudioMuteButton.js b/react/features/toolbox/components/AudioMuteButton.js index ba564b37a..5228543ca 100644 --- a/react/features/toolbox/components/AudioMuteButton.js +++ b/react/features/toolbox/components/AudioMuteButton.js @@ -13,6 +13,9 @@ import { AbstractAudioMuteButton } from '../../base/toolbox'; import type { AbstractButtonProps } from '../../base/toolbox'; import { isLocalTrackMuted } from '../../base/tracks'; +/** + * The type of the React {@code Component} props of {@link AudioMuteButton}. + */ type Props = AbstractButtonProps & { /** @@ -39,7 +42,7 @@ class AudioMuteButton extends AbstractAudioMuteButton { * Indicates if audio is currently muted ot nor. * * @override - * @private + * @protected * @returns {boolean} */ _isAudioMuted() { @@ -50,7 +53,7 @@ class AudioMuteButton extends AbstractAudioMuteButton { * Changes the muted state. * * @param {boolean} audioMuted - Whether audio should be muted or not. - * @private + * @protected * @returns {void} */ _setAudioMuted(audioMuted: boolean) { diff --git a/react/features/toolbox/components/HangupButton.js b/react/features/toolbox/components/HangupButton.js index 0b33a4813..e1986d640 100644 --- a/react/features/toolbox/components/HangupButton.js +++ b/react/features/toolbox/components/HangupButton.js @@ -4,19 +4,21 @@ import { connect } from 'react-redux'; import { createToolbarEvent, sendAnalytics } from '../../analytics'; import { appNavigate } from '../../app'; - import { disconnect } from '../../base/connection'; import { translate } from '../../base/i18n'; import { AbstractHangupButton } from '../../base/toolbox'; import type { AbstractButtonProps } from '../../base/toolbox'; +/** + * The type of the React {@code Component} props of {@link HangupButton}. + */ type Props = AbstractButtonProps & { /** * The redux {@code dispatch} function. */ dispatch: Function -} +}; /** * Component that renders a toolbar button for leaving the current conference. @@ -31,7 +33,7 @@ class HangupButton extends AbstractHangupButton { * Helper function to perform the actual hangup action. * * @override - * @private + * @protected * @returns {void} */ _doHangup() { diff --git a/react/features/toolbox/components/VideoMuteButton.js b/react/features/toolbox/components/VideoMuteButton.js index ef9782637..f8bb06217 100644 --- a/react/features/toolbox/components/VideoMuteButton.js +++ b/react/features/toolbox/components/VideoMuteButton.js @@ -17,6 +17,9 @@ import { AbstractVideoMuteButton } from '../../base/toolbox'; import type { AbstractButtonProps } from '../../base/toolbox'; import { isLocalTrackMuted } from '../../base/tracks'; +/** + * The type of the React {@code Component} props of {@link VideoMuteButton}. + */ type Props = AbstractButtonProps & { /** @@ -48,7 +51,7 @@ class VideoMuteButton extends AbstractVideoMuteButton { * Indicates if this button should be disabled or not. * * @override - * @private + * @protected * @returns {boolean} */ _isDisabled() { @@ -59,7 +62,7 @@ class VideoMuteButton extends AbstractVideoMuteButton { * Indicates if video is currently muted ot nor. * * @override - * @private + * @protected * @returns {boolean} */ _isVideoMuted() { @@ -69,8 +72,9 @@ class VideoMuteButton extends AbstractVideoMuteButton { /** * Changes the muted state. * + * @override * @param {boolean} videoMuted - Whether video should be muted or not. - * @private + * @protected * @returns {void} */ _setVideoMuted(videoMuted: boolean) { diff --git a/react/features/toolbox/components/native/AudioOnlyButton.js b/react/features/toolbox/components/native/AudioOnlyButton.js index 5d2207faa..a98bb3286 100644 --- a/react/features/toolbox/components/native/AudioOnlyButton.js +++ b/react/features/toolbox/components/native/AudioOnlyButton.js @@ -7,6 +7,9 @@ import { translate } from '../../../base/i18n'; import { AbstractButton } from '../../../base/toolbox'; import type { AbstractButtonProps } from '../../../base/toolbox'; +/** + * The type of the React {@code Component} props of {@link AudioOnlyButton}. + */ type Props = AbstractButtonProps & { /** @@ -32,7 +35,8 @@ class AudioOnlyButton extends AbstractButton { /** * Handles clicking / pressing the button. * - * @private + * @override + * @protected * @returns {void} */ _handleClick() { @@ -43,7 +47,7 @@ class AudioOnlyButton extends AbstractButton { * Indicates whether this button is in toggled state or not. * * @override - * @private + * @protected * @returns {boolean} */ _isToggled() { diff --git a/react/features/toolbox/components/native/ToggleCameraButton.js b/react/features/toolbox/components/native/ToggleCameraButton.js index 369859b32..de078d759 100644 --- a/react/features/toolbox/components/native/ToggleCameraButton.js +++ b/react/features/toolbox/components/native/ToggleCameraButton.js @@ -8,6 +8,9 @@ import { AbstractButton } from '../../../base/toolbox'; import type { AbstractButtonProps } from '../../../base/toolbox'; import { isLocalTrackMuted } from '../../../base/tracks'; +/** + * The type of the React {@code Component} props of {@link ToggleCameraButton}. + */ type Props = AbstractButtonProps & { /** @@ -37,7 +40,8 @@ class ToggleCameraButton extends AbstractButton { /** * Handles clicking / pressing the button. * - * @private + * @override + * @protected * @returns {void} */ _handleClick() { @@ -48,7 +52,7 @@ class ToggleCameraButton extends AbstractButton { * Indicates whether this button is disabled or not. * * @override - * @private + * @protected * @returns {boolean} */ _isDisabled() { diff --git a/react/features/toolbox/components/native/Toolbox.js b/react/features/toolbox/components/native/Toolbox.js index f37104a66..a6709dd4b 100644 --- a/react/features/toolbox/components/native/Toolbox.js +++ b/react/features/toolbox/components/native/Toolbox.js @@ -169,7 +169,7 @@ class Toolbox extends Component { * * @param {Object} state - The redux state of which parts are to be mapped to * {@code Toolbox} props. - * @protected + * @private * @returns {{ * _enabled: boolean, * _visible: boolean diff --git a/react/features/toolbox/components/web/Toolbox.js b/react/features/toolbox/components/web/Toolbox.js index e68274c85..fb3b9bfcb 100644 --- a/react/features/toolbox/components/web/Toolbox.js +++ b/react/features/toolbox/components/web/Toolbox.js @@ -50,6 +50,9 @@ import OverflowMenuProfileItem from './OverflowMenuProfileItem'; import ToolbarButton from './ToolbarButton'; import VideoMuteButton from '../VideoMuteButton'; +/** + * The type of the React {@code Component} props of {@link Toolbox}. + */ type Props = { /** @@ -169,7 +172,7 @@ type Props = { * Invoked to obtain translated strings. */ t: Function -} +}; declare var APP: Object; declare var interfaceConfig: Object;