From e7fc4739c4a164309966c5593e990dee8ee0cce1 Mon Sep 17 00:00:00 2001 From: Lyubo Marinov Date: Wed, 19 Jul 2017 16:25:06 -0500 Subject: [PATCH] Fixes jsdocs --- .../components/AbstractToolbarButton.js | 12 +++++----- .../components/ToolbarButton.native.js | 12 +++++----- .../toolbox/components/Toolbox.native.js | 3 +-- react/features/toolbox/functions.native.js | 14 +++++++----- .../welcome/components/AbstractWelcomePage.js | 22 +++++++++---------- 5 files changed, 31 insertions(+), 32 deletions(-) diff --git a/react/features/toolbox/components/AbstractToolbarButton.js b/react/features/toolbox/components/AbstractToolbarButton.js index 95ad5ef8d0..d8f37f0fd8 100644 --- a/react/features/toolbox/components/AbstractToolbarButton.js +++ b/react/features/toolbox/components/AbstractToolbarButton.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; /** - * Abstract (base) class for a button in Toolbar. + * Abstract (base) class for a button in {@link Toolbar}. * * @abstract */ @@ -13,12 +13,12 @@ export default class AbstractToolbarButton extends Component { */ static propTypes = { /** - * The name of the Icon of this AbstractToolbarButton. + * The name of the Icon of this {@code AbstractToolbarButton}. */ iconName: React.PropTypes.string, /** - * The style of the Icon of this AbstractToolbarButton. + * The style of the Icon of this {@code AbstractToolbarButton}. */ iconStyle: React.PropTypes.object, @@ -28,7 +28,7 @@ export default class AbstractToolbarButton extends Component { onClick: React.PropTypes.func, /** - * Toolbar button styles. + * {@code AbstractToolbarButton} styles. */ style: React.PropTypes.oneOfType([ @@ -53,12 +53,12 @@ export default class AbstractToolbarButton extends Component { } /** - * Renders the icon of this Toolbar button. + * Renders the icon of this {@code AbstractToolbarButton}. * * @param {string|ReactClass} type - The React Component type of the icon to * be rendered. * @protected - * @returns {ReactElement} The icon of this Toolbar button. + * @returns {ReactElement} The icon of this {@code AbstractToolbarButton}. */ _renderIcon(type) { const props = {}; diff --git a/react/features/toolbox/components/ToolbarButton.native.js b/react/features/toolbox/components/ToolbarButton.native.js index ef95fd5225..5c503deccb 100644 --- a/react/features/toolbox/components/ToolbarButton.native.js +++ b/react/features/toolbox/components/ToolbarButton.native.js @@ -7,13 +7,13 @@ import { Icon } from '../../base/font-icons'; import AbstractToolbarButton from './AbstractToolbarButton'; /** - * Represents a button in Toolbar on React Native. + * Represents a button in {@link Toolbar} on React Native. * * @extends AbstractToolbarButton */ class ToolbarButton extends AbstractToolbarButton { /** - * ToolbarButton component's property types. + * {@code ToolbarButton} component's property types. * * @static */ @@ -21,18 +21,18 @@ class ToolbarButton extends AbstractToolbarButton { ...AbstractToolbarButton.propTypes, /** - * Indicates if this button is disabled or not. + * Indicates whether this {@code ToolbarButton} is disabled. */ disabled: React.PropTypes.bool }; /** - * Renders the button of this Toolbar button. + * Renders the button of this {@code ToolbarButton}. * * @param {Object} children - The children, if any, to be rendered inside - * the button. Presumably, contains the icon of this Toolbar button. + * the button. Presumably, contains the icon of this {@code ToolbarButton}. * @protected - * @returns {ReactElement} The button of this Toolbar button. + * @returns {ReactElement} The button of this {@code ToolbarButton}. */ _renderButton(children) { const props = {}; diff --git a/react/features/toolbox/components/Toolbox.native.js b/react/features/toolbox/components/Toolbox.native.js index 929cf0bfeb..de2e9d4219 100644 --- a/react/features/toolbox/components/Toolbox.native.js +++ b/react/features/toolbox/components/Toolbox.native.js @@ -154,7 +154,6 @@ class Toolbox extends Component { _renderPrimaryToolbar() { const audioButtonStyles = this._getMuteButtonStyles(MEDIA_TYPE.AUDIO); const videoButtonStyles = this._getMuteButtonStyles(MEDIA_TYPE.VIDEO); - const { _audioOnly: audioOnly } = this.props; /* eslint-disable react/jsx-handler-names */ @@ -172,7 +171,7 @@ class Toolbox extends Component { style = { styles.hangup } underlayColor = { ColorPalette.buttonUnderlay } /> ): Object { } /** - * Maps parts of media state to component props. + * Maps parts of the redux state to {@link Toolbox} (React {@code Component}) + * props. * - * @param {Object} state - Redux state. + * @param {Object} state - The redux state of which parts are to be mapped to + * {@code Toolbox} props. * @protected * @returns {{ * _audioMuted: boolean, @@ -80,7 +82,7 @@ export function abstractMapStateToProps(state: Object): Object { return { /** - * Flag showing that audio is muted. + * Flag showing whether audio is muted. * * @protected * @type {boolean} @@ -106,7 +108,7 @@ export function abstractMapStateToProps(state: Object): Object { } /** - * Returns the button object corresponding to the given buttonName. + * Returns the button object corresponding to a specific {@code buttonName}. * * @param {string} buttonName - The name of the button. * @param {Object} state - The current state. diff --git a/react/features/welcome/components/AbstractWelcomePage.js b/react/features/welcome/components/AbstractWelcomePage.js index 79df2ed841..832529c5ad 100644 --- a/react/features/welcome/components/AbstractWelcomePage.js +++ b/react/features/welcome/components/AbstractWelcomePage.js @@ -14,7 +14,7 @@ import { generateRoomWithoutSeparator } from '../roomnameGenerator'; */ export class AbstractWelcomePage extends Component { /** - * AbstractWelcomePage component's property types. + * {@code AbstractWelcomePage} component's property types. * * @static */ @@ -25,10 +25,10 @@ export class AbstractWelcomePage extends Component { }; /** - * Initializes a new AbstractWelcomePage instance, including the initial - * state of the room name input. + * Initializes a new {@code AbstractWelcomePage} instance. * - * @param {Object} props - Component properties. + * @param {Object} props - The React {@code Component} props to initialize + * the new {@code AbstractWelcomePage} instance with. */ constructor(props) { super(props); @@ -37,15 +37,15 @@ export class AbstractWelcomePage extends Component { * Save room name into component's local state. * * @type {Object} - * @property {number|null} animateTimeoutId - Identificator for - * letter animation timeout. + * @property {number|null} animateTimeoutId - Identifier of the letter + * animation timeout. * @property {string} generatedRoomname - Automatically generated * room name. * @property {string} room - Room name. * @property {string} roomPlaceholder - Room placeholder * that's used as a placeholder for input. - * @property {nubmer|null} updateTimeoutId - Identificator for - * updating generated room name. + * @property {nubmer|null} updateTimeoutId - Identifier of the timeout + * updating the generated room name. */ this.state = { animateTimeoutId: null, @@ -55,7 +55,7 @@ export class AbstractWelcomePage extends Component { updateTimeoutId: null }; - // Bind event handlers so they are only bound once for every instance. + // Bind event handlers so they are only bound once per instance. this._animateRoomnameChanging = this._animateRoomnameChanging.bind(this); this._onJoin = this._onJoin.bind(this); @@ -143,9 +143,7 @@ export class AbstractWelcomePage extends Component { _onJoin() { const room = this.state.room || this.state.generatedRoomname; - if (room) { - this.props.dispatch(appNavigate(room)); - } + room && this.props.dispatch(appNavigate(room)); } /**