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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. displayClass = 'kicklink'
  41. iconClass = 'icon-kick'
  42. id = { `ejectlink_${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()(KickButton));