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.

AbstractKickRemoteParticipantDialog.js 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // @flow
  2. import { Component } from 'react';
  3. import {
  4. createRemoteVideoMenuButtonEvent,
  5. sendAnalytics
  6. } from '../../analytics';
  7. import { kickParticipant } from '../../base/participants';
  8. type Props = {
  9. /**
  10. * The Redux dispatch function.
  11. */
  12. dispatch: Function,
  13. /**
  14. * The ID of the remote participant to be kicked.
  15. */
  16. participantID: string,
  17. /**
  18. * Function to translate i18n labels.
  19. */
  20. t: Function
  21. };
  22. /**
  23. * Abstract dialog to confirm a remote participant kick action.
  24. */
  25. export default class AbstractKickRemoteParticipantDialog
  26. extends Component<Props> {
  27. /**
  28. * Initializes a new {@code AbstractKickRemoteParticipantDialog} instance.
  29. *
  30. * @inheritdoc
  31. */
  32. constructor(props: Props) {
  33. super(props);
  34. this._onSubmit = this._onSubmit.bind(this);
  35. }
  36. _onSubmit: () => boolean;
  37. /**
  38. * Callback for the confirm button.
  39. *
  40. * @private
  41. * @returns {boolean} - True (to note that the modal should be closed).
  42. */
  43. _onSubmit() {
  44. const { dispatch, participantID } = this.props;
  45. sendAnalytics(createRemoteVideoMenuButtonEvent(
  46. 'kick.button',
  47. {
  48. 'participant_id': participantID
  49. }));
  50. dispatch(kickParticipant(participantID));
  51. return true;
  52. }
  53. }