選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

AbstractMuteRemoteParticipantDialog.ts 1.4KB

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