Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

AbstractMuteRemoteParticipantDialog.ts 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { Component } from 'react';
  2. import { WithTranslation } from 'react-i18next';
  3. import { IStore } from '../../app/types';
  4. import { MEDIA_TYPE } from '../../base/media/constants';
  5. import { muteRemote } from '../actions';
  6. /**
  7. * The type of the React {@code Component} props of
  8. * {@link AbstractMuteRemoteParticipantDialog}.
  9. */
  10. export interface IProps extends WithTranslation {
  11. /**
  12. * The Redux dispatch function.
  13. */
  14. dispatch: IStore['dispatch'];
  15. /**
  16. * The ID of the remote participant to be muted.
  17. */
  18. participantID: string;
  19. }
  20. /**
  21. * Abstract dialog to confirm a remote participant mute action.
  22. *
  23. * @augments Component
  24. */
  25. export default class AbstractMuteRemoteParticipantDialog<P extends IProps = IProps, State=void>
  26. extends Component<P, State> {
  27. /**
  28. * Initializes a new {@code AbstractMuteRemoteParticipantDialog} instance.
  29. *
  30. * @param {Object} props - The read-only properties with which the new
  31. * instance is to be initialized.
  32. */
  33. constructor(props: P) {
  34. super(props);
  35. // Bind event handlers so they are only bound once per instance.
  36. this._onSubmit = this._onSubmit.bind(this);
  37. }
  38. /**
  39. * Handles the submit button action.
  40. *
  41. * @private
  42. * @returns {boolean} - True (to note that the modal should be closed).
  43. */
  44. _onSubmit() {
  45. const { dispatch, participantID } = this.props;
  46. dispatch(muteRemote(participantID, MEDIA_TYPE.AUDIO));
  47. return true;
  48. }
  49. }