Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jitsi-meet/react/features/toolbox/components/ToolbarButton.web.js

80 lines
2.0 KiB

import Tooltip from '@atlaskit/tooltip';
import PropTypes from 'prop-types';
import React from 'react';
9 years ago
import AbstractToolbarButton from './AbstractToolbarButton';
9 years ago
/**
* Represents a button in the toolbar.
9 years ago
*
* @extends AbstractToolbarButton
*/
class ToolbarButton extends AbstractToolbarButton {
/**
* Default values for {@code ToolbarButton} component's properties.
*
* @static
*/
static defaultProps = {
tooltipPosition: 'top'
};
9 years ago
/**
* {@code ToolbarButton} component's property types.
9 years ago
*
* @static
*/
static propTypes = {
...AbstractToolbarButton.propTypes,
9 years ago
/**
* The text to display in the tooltip.
9 years ago
*/
tooltip: PropTypes.string,
9 years ago
/**
* From which direction the tooltip should appear, relative to the
* button.
9 years ago
*/
tooltipPosition: PropTypes.string
9 years ago
}
/**
* Renders the button of this {@code ToolbarButton}.
9 years ago
*
* @param {Object} children - The children, if any, to be rendered inside
* the button. Presumably, contains the icon of this {@code ToolbarButton}.
* @protected
* @returns {ReactElement} The button of this {@code ToolbarButton}.
9 years ago
*/
_renderButton(children) {
return (
<div
aria-label = { this.props.accessibilityLabel }
className = 'toolbox-button'
onClick = { this.props.onClick }>
<Tooltip
description = { this.props.tooltip }
position = { this.props.tooltipPosition }>
{ children }
</Tooltip>
</div>
);
9 years ago
}
/**
* Renders the icon of this {@code ToolbarButton}.
9 years ago
*
* @inheritdoc
*/
_renderIcon() {
return (
<div className = 'toolbox-icon'>
<i className = { this.props.iconName } />
</div>
);
9 years ago
}
}
export default ToolbarButton;