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.

GrantModeratorButton.js 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* @flow */
  2. import React from 'react';
  3. import { translate } from '../../../base/i18n';
  4. import { IconCrown } from '../../../base/icons';
  5. import { connect } from '../../../base/redux';
  6. import AbstractGrantModeratorButton, {
  7. _mapStateToProps,
  8. type Props
  9. } from '../AbstractGrantModeratorButton';
  10. import VideoMenuButton from './VideoMenuButton';
  11. declare var interfaceConfig: Object;
  12. /**
  13. * Implements a React {@link Component} which displays a button for granting
  14. * moderator to a participant.
  15. */
  16. class GrantModeratorButton extends AbstractGrantModeratorButton {
  17. /**
  18. * Instantiates a new {@code GrantModeratorButton}.
  19. *
  20. * @inheritdoc
  21. */
  22. constructor(props: Props) {
  23. super(props);
  24. this._handleClick = this._handleClick.bind(this);
  25. }
  26. /**
  27. * Implements React's {@link Component#render()}.
  28. *
  29. * @inheritdoc
  30. * @returns {ReactElement}
  31. */
  32. render() {
  33. const { participantID, t, visible } = this.props;
  34. if (!visible) {
  35. return null;
  36. }
  37. return (
  38. <VideoMenuButton
  39. buttonText = { t('videothumbnail.grantModerator') }
  40. displayClass = 'grantmoderatorlink'
  41. icon = { IconCrown }
  42. id = { `grantmoderatorlink_${participantID}` }
  43. // eslint-disable-next-line react/jsx-handler-names
  44. onClick = { this._handleClick } />
  45. );
  46. }
  47. _handleClick: () => void
  48. }
  49. export default translate(connect(_mapStateToProps)(GrantModeratorButton));