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.

FeedbackButton.web.js 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // @flow
  2. import { createToolbarEvent, sendAnalytics } from '../../analytics';
  3. import { translate } from '../../base/i18n';
  4. import { IconFeedback } from '../../base/icons';
  5. import { connect } from '../../base/redux';
  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));