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.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 ContextMenuItem from '../../../base/ui/components/web/ContextMenuItem';
  7. import AbstractGrantModeratorButton, {
  8. type Props,
  9. _mapStateToProps
  10. } from '../AbstractGrantModeratorButton';
  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 { t, visible } = this.props;
  34. if (!visible) {
  35. return null;
  36. }
  37. return (
  38. <ContextMenuItem
  39. accessibilityLabel = { t('toolbar.accessibilityLabel.grantModerator') }
  40. className = 'grantmoderatorlink'
  41. icon = { IconCrown }
  42. // eslint-disable-next-line react/jsx-handler-names
  43. onClick = { this._handleClick }
  44. text = { t('videothumbnail.grantModerator') } />
  45. );
  46. }
  47. _handleClick: () => void;
  48. }
  49. export default translate(connect(_mapStateToProps)(GrantModeratorButton));