2020-07-15 10:13:28 +00:00
|
|
|
/* @flow */
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { translate } from '../../../base/i18n';
|
|
|
|
import { IconCrown } from '../../../base/icons';
|
|
|
|
import { connect } from '../../../base/redux';
|
|
|
|
import AbstractGrantModeratorButton, {
|
|
|
|
_mapStateToProps,
|
|
|
|
type Props
|
|
|
|
} from '../AbstractGrantModeratorButton';
|
|
|
|
|
2021-01-21 20:46:47 +00:00
|
|
|
import VideoMenuButton from './VideoMenuButton';
|
2020-07-15 10:13:28 +00:00
|
|
|
|
|
|
|
declare var interfaceConfig: Object;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements a React {@link Component} which displays a button for granting
|
|
|
|
* moderator to a participant.
|
|
|
|
*/
|
|
|
|
class GrantModeratorButton extends AbstractGrantModeratorButton {
|
|
|
|
/**
|
|
|
|
* Instantiates a new {@code GrantModeratorButton}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
constructor(props: Props) {
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
this._handleClick = this._handleClick.bind(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
const { participantID, t, visible } = this.props;
|
|
|
|
|
|
|
|
if (!visible) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
2021-01-21 20:46:47 +00:00
|
|
|
<VideoMenuButton
|
2020-07-15 10:13:28 +00:00
|
|
|
buttonText = { t('videothumbnail.grantModerator') }
|
|
|
|
displayClass = 'grantmoderatorlink'
|
|
|
|
icon = { IconCrown }
|
|
|
|
id = { `grantmoderatorlink_${participantID}` }
|
|
|
|
// eslint-disable-next-line react/jsx-handler-names
|
|
|
|
onClick = { this._handleClick } />
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
_handleClick: () => void
|
|
|
|
}
|
|
|
|
|
|
|
|
export default translate(connect(_mapStateToProps)(GrantModeratorButton));
|