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

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