Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

MuteButton.tsx 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import React from 'react';
  2. import { connect } from 'react-redux';
  3. import { translate } from '../../../base/i18n/functions';
  4. import { IconMicSlash } from '../../../base/icons/svg';
  5. import ContextMenuItem from '../../../base/ui/components/web/ContextMenuItem';
  6. import AbstractMuteButton, { IProps, _mapStateToProps } from '../AbstractMuteButton';
  7. /**
  8. * Implements a React {@link Component} which displays a button for audio muting
  9. * a participant in 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 AbstractMuteButton} 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 MuteButton extends AbstractMuteButton {
  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 { _audioTrackMuted, t } = this.props;
  35. if (_audioTrackMuted) {
  36. return null;
  37. }
  38. return (
  39. <ContextMenuItem
  40. accessibilityLabel = { t('dialog.muteParticipantButton') }
  41. className = 'mutelink'
  42. icon = { IconMicSlash }
  43. // eslint-disable-next-line react/jsx-handler-names
  44. onClick = { this._handleClick }
  45. text = { t('dialog.muteParticipantButton') } />
  46. );
  47. }
  48. _handleClick: () => void;
  49. }
  50. export default translate(connect(_mapStateToProps)(MuteButton));