Fixes jsdocs

This commit is contained in:
Lyubo Marinov 2017-07-19 16:25:06 -05:00
parent f72932d125
commit e7fc4739c4
5 changed files with 31 additions and 32 deletions

View File

@ -1,7 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
/** /**
* Abstract (base) class for a button in Toolbar. * Abstract (base) class for a button in {@link Toolbar}.
* *
* @abstract * @abstract
*/ */
@ -13,12 +13,12 @@ export default class AbstractToolbarButton extends Component {
*/ */
static propTypes = { static propTypes = {
/** /**
* The name of the Icon of this AbstractToolbarButton. * The name of the Icon of this {@code AbstractToolbarButton}.
*/ */
iconName: React.PropTypes.string, 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, iconStyle: React.PropTypes.object,
@ -28,7 +28,7 @@ export default class AbstractToolbarButton extends Component {
onClick: React.PropTypes.func, onClick: React.PropTypes.func,
/** /**
* Toolbar button styles. * {@code AbstractToolbarButton} styles.
*/ */
style: style:
React.PropTypes.oneOfType([ 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 * @param {string|ReactClass} type - The React Component type of the icon to
* be rendered. * be rendered.
* @protected * @protected
* @returns {ReactElement} The icon of this Toolbar button. * @returns {ReactElement} The icon of this {@code AbstractToolbarButton}.
*/ */
_renderIcon(type) { _renderIcon(type) {
const props = {}; const props = {};

View File

@ -7,13 +7,13 @@ import { Icon } from '../../base/font-icons';
import AbstractToolbarButton from './AbstractToolbarButton'; import AbstractToolbarButton from './AbstractToolbarButton';
/** /**
* Represents a button in Toolbar on React Native. * Represents a button in {@link Toolbar} on React Native.
* *
* @extends AbstractToolbarButton * @extends AbstractToolbarButton
*/ */
class ToolbarButton extends AbstractToolbarButton { class ToolbarButton extends AbstractToolbarButton {
/** /**
* ToolbarButton component's property types. * {@code ToolbarButton} component's property types.
* *
* @static * @static
*/ */
@ -21,18 +21,18 @@ class ToolbarButton extends AbstractToolbarButton {
...AbstractToolbarButton.propTypes, ...AbstractToolbarButton.propTypes,
/** /**
* Indicates if this button is disabled or not. * Indicates whether this {@code ToolbarButton} is disabled.
*/ */
disabled: React.PropTypes.bool 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 * @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 * @protected
* @returns {ReactElement} The button of this Toolbar button. * @returns {ReactElement} The button of this {@code ToolbarButton}.
*/ */
_renderButton(children) { _renderButton(children) {
const props = {}; const props = {};

View File

@ -154,7 +154,6 @@ class Toolbox extends Component {
_renderPrimaryToolbar() { _renderPrimaryToolbar() {
const audioButtonStyles = this._getMuteButtonStyles(MEDIA_TYPE.AUDIO); const audioButtonStyles = this._getMuteButtonStyles(MEDIA_TYPE.AUDIO);
const videoButtonStyles = this._getMuteButtonStyles(MEDIA_TYPE.VIDEO); const videoButtonStyles = this._getMuteButtonStyles(MEDIA_TYPE.VIDEO);
const { _audioOnly: audioOnly } = this.props;
/* eslint-disable react/jsx-handler-names */ /* eslint-disable react/jsx-handler-names */
@ -172,7 +171,7 @@ class Toolbox extends Component {
style = { styles.hangup } style = { styles.hangup }
underlayColor = { ColorPalette.buttonUnderlay } /> underlayColor = { ColorPalette.buttonUnderlay } />
<ToolbarButton <ToolbarButton
disabled = { audioOnly } disabled = { this.props._audioOnly }
iconName = { videoButtonStyles.iconName } iconName = { videoButtonStyles.iconName }
iconStyle = { videoButtonStyles.iconStyle } iconStyle = { videoButtonStyles.iconStyle }
onClick = { this.props._onToggleVideo } onClick = { this.props._onToggleVideo }

View File

@ -7,9 +7,9 @@ import { toggleAudioMuted, toggleVideoMuted } from '../base/media';
import { getLocalAudioTrack, getLocalVideoTrack } from '../base/tracks'; import { getLocalAudioTrack, getLocalVideoTrack } from '../base/tracks';
/** /**
* Maps (redux) actions to React component props. * Maps redux actions to {@link Toolbox} (React {@code Component}) props.
* *
* @param {Function} dispatch - Redux action dispatcher. * @param {Function} dispatch - The redux {@code dispatch} function.
* @returns {{ * @returns {{
* _onHangup: Function, * _onHangup: Function,
* _onToggleAudio: Function, * _onToggleAudio: Function,
@ -61,9 +61,11 @@ export function abstractMapDispatchToProps(dispatch: Dispatch<*>): 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 * @protected
* @returns {{ * @returns {{
* _audioMuted: boolean, * _audioMuted: boolean,
@ -80,7 +82,7 @@ export function abstractMapStateToProps(state: Object): Object {
return { return {
/** /**
* Flag showing that audio is muted. * Flag showing whether audio is muted.
* *
* @protected * @protected
* @type {boolean} * @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 {string} buttonName - The name of the button.
* @param {Object} state - The current state. * @param {Object} state - The current state.

View File

@ -14,7 +14,7 @@ import { generateRoomWithoutSeparator } from '../roomnameGenerator';
*/ */
export class AbstractWelcomePage extends Component { export class AbstractWelcomePage extends Component {
/** /**
* AbstractWelcomePage component's property types. * {@code AbstractWelcomePage} component's property types.
* *
* @static * @static
*/ */
@ -25,10 +25,10 @@ export class AbstractWelcomePage extends Component {
}; };
/** /**
* Initializes a new AbstractWelcomePage instance, including the initial * Initializes a new {@code AbstractWelcomePage} instance.
* state of the room name input.
* *
* @param {Object} props - Component properties. * @param {Object} props - The React {@code Component} props to initialize
* the new {@code AbstractWelcomePage} instance with.
*/ */
constructor(props) { constructor(props) {
super(props); super(props);
@ -37,15 +37,15 @@ export class AbstractWelcomePage extends Component {
* Save room name into component's local state. * Save room name into component's local state.
* *
* @type {Object} * @type {Object}
* @property {number|null} animateTimeoutId - Identificator for * @property {number|null} animateTimeoutId - Identifier of the letter
* letter animation timeout. * animation timeout.
* @property {string} generatedRoomname - Automatically generated * @property {string} generatedRoomname - Automatically generated
* room name. * room name.
* @property {string} room - Room name. * @property {string} room - Room name.
* @property {string} roomPlaceholder - Room placeholder * @property {string} roomPlaceholder - Room placeholder
* that's used as a placeholder for input. * that's used as a placeholder for input.
* @property {nubmer|null} updateTimeoutId - Identificator for * @property {nubmer|null} updateTimeoutId - Identifier of the timeout
* updating generated room name. * updating the generated room name.
*/ */
this.state = { this.state = {
animateTimeoutId: null, animateTimeoutId: null,
@ -55,7 +55,7 @@ export class AbstractWelcomePage extends Component {
updateTimeoutId: null 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
= this._animateRoomnameChanging.bind(this); = this._animateRoomnameChanging.bind(this);
this._onJoin = this._onJoin.bind(this); this._onJoin = this._onJoin.bind(this);
@ -143,9 +143,7 @@ export class AbstractWelcomePage extends Component {
_onJoin() { _onJoin() {
const room = this.state.room || this.state.generatedRoomname; const room = this.state.room || this.state.generatedRoomname;
if (room) { room && this.props.dispatch(appNavigate(room));
this.props.dispatch(appNavigate(room));
}
} }
/** /**