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

FeedbackButton.web.js 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // @flow
  2. import { connect } from 'react-redux';
  3. import { createToolbarEvent, sendAnalytics } from '../../analytics';
  4. import { translate } from '../../base/i18n';
  5. import { IconFeedback } from '../../base/icons';
  6. import { AbstractButton, type AbstractButtonProps } from '../../base/toolbox/components';
  7. import { openFeedbackDialog } from '../actions';
  8. /**
  9. * The type of the React {@code Component} props of {@link FeedbackButton}.
  10. */
  11. type Props = AbstractButtonProps & {
  12. /**
  13. * The {@code JitsiConference} for the current conference.
  14. */
  15. _conference: Object,
  16. /**
  17. * The redux {@code dispatch} function.
  18. */
  19. dispatch: Function
  20. };
  21. /**
  22. * Implementation of a button for opening feedback dialog.
  23. */
  24. class FeedbackButton extends AbstractButton<Props, *> {
  25. accessibilityLabel = 'toolbar.accessibilityLabel.feedback';
  26. icon = IconFeedback;
  27. label = 'toolbar.feedback';
  28. tooltip = 'toolbar.feedback';
  29. /**
  30. * Handles clicking / pressing the button, and opens the appropriate dialog.
  31. *
  32. * @protected
  33. * @returns {void}
  34. */
  35. _handleClick() {
  36. const { _conference, dispatch } = this.props;
  37. sendAnalytics(createToolbarEvent('feedback'));
  38. dispatch(openFeedbackDialog(_conference));
  39. }
  40. }
  41. const mapStateToProps = state => {
  42. return {
  43. _conference: state['features/base/conference'].conference
  44. };
  45. };
  46. export default translate(connect(mapStateToProps)(FeedbackButton));