mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-19 10:47:46 +00:00
Import jitsi/jitsi-meet-react#2f23d98
As an intermediate step on the path to merging jitsi-meet and
jitsi-meet-react, import the whole source code of jitsi-meet-react as it
stands at
2f23d98424
i.e. the lastest master at the time of this import. No modifications are
applied to the imported source code in order to preserve a complete
snapshot of it in the repository of jitsi-meet and, thus, facilitate
comparison later on. Consequently, the source code of jitsi-meet and/or
jitsi-meet-react may not work. For example, jitsi-meet's jshint may be
unable to parse jitsi-meet-react's source code.
This commit is contained in:
61
react/features/toolbar/components/AbstractToolbarButton.js
Normal file
61
react/features/toolbar/components/AbstractToolbarButton.js
Normal file
@@ -0,0 +1,61 @@
|
||||
import React, { Component } from 'react';
|
||||
|
||||
/**
|
||||
* Abstract (base) class for a button in Toolbar.
|
||||
*
|
||||
* @abstract
|
||||
*/
|
||||
export default class AbstractToolbarButton extends Component {
|
||||
|
||||
/**
|
||||
* Implements React's {@link Component#render()}.
|
||||
*
|
||||
* @inheritdoc
|
||||
* @returns {ReactElement}
|
||||
*/
|
||||
render() {
|
||||
return this._renderButton(this._renderIcon());
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the icon of this Toolbar button.
|
||||
*
|
||||
* @param {string|ReactClass} type - The React Component type of the icon to
|
||||
* be rendered.
|
||||
* @protected
|
||||
* @returns {ReactElement} The icon of this Toolbar button.
|
||||
*/
|
||||
_renderIcon(type) {
|
||||
const props = {};
|
||||
|
||||
'iconName' in this.props && (props.name = this.props.iconName);
|
||||
'iconStyle' in this.props && (props.style = this.props.iconStyle);
|
||||
|
||||
return React.createElement(type, props);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* AbstractToolbarButton component's property types.
|
||||
*
|
||||
* @static
|
||||
*/
|
||||
AbstractToolbarButton.propTypes = {
|
||||
|
||||
/**
|
||||
* The name of the Icon of this AbstractToolbarButton.
|
||||
*/
|
||||
iconName: React.PropTypes.string,
|
||||
|
||||
/**
|
||||
* The style of the Icon of this AbstractToolbarButton.
|
||||
*/
|
||||
iconStyle: React.PropTypes.object,
|
||||
onClick: React.PropTypes.func,
|
||||
style:
|
||||
React.PropTypes.oneOfType([
|
||||
React.PropTypes.array,
|
||||
React.PropTypes.object
|
||||
]),
|
||||
underlayColor: React.PropTypes.any
|
||||
};
|
||||
Reference in New Issue
Block a user