2018-10-30 05:02:23 +00:00
|
|
|
/* @flow */
|
|
|
|
|
2017-05-31 15:42:50 +00:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
2019-08-30 16:39:06 +00:00
|
|
|
import { Icon } from '../../../base/icons';
|
|
|
|
|
2017-05-31 15:42:50 +00:00
|
|
|
/**
|
2018-10-30 05:02:23 +00:00
|
|
|
* The type of the React {@code Component} props of
|
|
|
|
* {@link RemoteVideoMenuButton}.
|
2017-05-31 15:42:50 +00:00
|
|
|
*/
|
2018-10-30 05:02:23 +00:00
|
|
|
type Props = {
|
|
|
|
|
2017-05-31 15:42:50 +00:00
|
|
|
/**
|
2018-10-30 05:02:23 +00:00
|
|
|
* Text to display within the component that describes the onClick action.
|
2017-05-31 15:42:50 +00:00
|
|
|
*/
|
2018-10-30 05:02:23 +00:00
|
|
|
buttonText: string,
|
2017-05-31 15:42:50 +00:00
|
|
|
|
2018-10-30 05:02:23 +00:00
|
|
|
/**
|
|
|
|
* Additional CSS classes to add to the component.
|
|
|
|
*/
|
|
|
|
displayClass?: string,
|
2017-05-31 15:42:50 +00:00
|
|
|
|
2018-10-30 05:02:23 +00:00
|
|
|
/**
|
2019-08-30 16:39:06 +00:00
|
|
|
* The icon that will display within the component.
|
2018-10-30 05:02:23 +00:00
|
|
|
*/
|
2019-08-30 16:39:06 +00:00
|
|
|
icon: Object,
|
2017-05-31 15:42:50 +00:00
|
|
|
|
2018-10-30 05:02:23 +00:00
|
|
|
/**
|
|
|
|
* The id attribute to be added to the component's DOM for retrieval when
|
|
|
|
* querying the DOM. Not used directly by the component.
|
|
|
|
*/
|
|
|
|
id: string,
|
2017-05-31 15:42:50 +00:00
|
|
|
|
2018-10-30 05:02:23 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when the component is clicked.
|
|
|
|
*/
|
|
|
|
onClick: Function,
|
|
|
|
};
|
2017-05-31 15:42:50 +00:00
|
|
|
|
2018-10-30 05:02:23 +00:00
|
|
|
/**
|
|
|
|
* React {@code Component} for displaying an action in {@code RemoteVideoMenu}.
|
|
|
|
*
|
|
|
|
* @extends {Component}
|
|
|
|
*/
|
|
|
|
export default class RemoteVideoMenuButton extends Component<Props> {
|
2017-05-31 15:42:50 +00:00
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
const {
|
|
|
|
buttonText,
|
|
|
|
displayClass,
|
2019-08-30 16:39:06 +00:00
|
|
|
icon,
|
2017-05-31 15:42:50 +00:00
|
|
|
id,
|
|
|
|
onClick
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
const linkClassName = `popupmenu__link ${displayClass || ''}`;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<li className = 'popupmenu__item'>
|
|
|
|
<a
|
|
|
|
className = { linkClassName }
|
|
|
|
id = { id }
|
|
|
|
onClick = { onClick }>
|
|
|
|
<span className = 'popupmenu__icon'>
|
2019-08-30 16:39:06 +00:00
|
|
|
<Icon src = { icon } />
|
2017-05-31 15:42:50 +00:00
|
|
|
</span>
|
|
|
|
<span className = 'popupmenu__text'>
|
|
|
|
{ buttonText }
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|