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.tsx 1.7KB

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