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.

KickButton.js 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* @flow */
  2. import React from 'react';
  3. import { translate } from '../../../base/i18n';
  4. import { IconKick } from '../../../base/icons';
  5. import { connect } from '../../../base/redux';
  6. import AbstractKickButton, {
  7. type Props
  8. } from '../AbstractKickButton';
  9. import VideoMenuButton from './VideoMenuButton';
  10. /**
  11. * Implements a React {@link Component} which displays a button for kicking out
  12. * a participant from the conference.
  13. *
  14. * NOTE: At the time of writing this is a button that doesn't use the
  15. * {@code AbstractButton} base component, but is inherited from the same
  16. * super class ({@code AbstractKickButton} that extends {@code AbstractButton})
  17. * for the sake of code sharing between web and mobile. Once web uses the
  18. * {@code AbstractButton} base component, this can be fully removed.
  19. */
  20. class KickButton extends AbstractKickButton {
  21. /**
  22. * Instantiates a new {@code Component}.
  23. *
  24. * @inheritdoc
  25. */
  26. constructor(props: Props) {
  27. super(props);
  28. this._handleClick = this._handleClick.bind(this);
  29. }
  30. /**
  31. * Implements React's {@link Component#render()}.
  32. *
  33. * @inheritdoc
  34. * @returns {ReactElement}
  35. */
  36. render() {
  37. const { participantID, t } = this.props;
  38. return (
  39. <VideoMenuButton
  40. buttonText = { t('videothumbnail.kick') }
  41. displayClass = 'kicklink'
  42. icon = { IconKick }
  43. id = { `ejectlink_${participantID}` }
  44. // eslint-disable-next-line react/jsx-handler-names
  45. onClick = { this._handleClick } />
  46. );
  47. }
  48. _handleClick: () => void
  49. }
  50. export default translate(connect()(KickButton));