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.

EmbedMeetingButton.js 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // @flow
  2. import { createToolbarEvent, sendAnalytics } from '../../analytics';
  3. import { openDialog } from '../../base/dialog';
  4. import { translate } from '../../base/i18n';
  5. import { IconCodeBlock } from '../../base/icons';
  6. import { connect } from '../../base/redux';
  7. import { AbstractButton, type AbstractButtonProps } from '../../base/toolbox/components';
  8. import EmbedMeetingDialog from './EmbedMeetingDialog';
  9. /**
  10. * The type of the React {@code Component} props of {@link EmbedMeetingButton}.
  11. */
  12. type Props = AbstractButtonProps & {
  13. /**
  14. * The redux {@code dispatch} function.
  15. */
  16. dispatch: Function
  17. };
  18. /**
  19. * Implementation of a button for opening embed meeting dialog.
  20. */
  21. class EmbedMeetingButton extends AbstractButton<Props, *> {
  22. accessibilityLabel = 'toolbar.accessibilityLabel.embedMeeting';
  23. icon = IconCodeBlock;
  24. label = 'toolbar.embedMeeting';
  25. tooltip = 'toolbar.embedMeeting';
  26. /**
  27. * Handles clicking / pressing the button, and opens the appropriate dialog.
  28. *
  29. * @protected
  30. * @returns {void}
  31. */
  32. _handleClick() {
  33. const { dispatch } = this.props;
  34. sendAnalytics(createToolbarEvent('embed.meeting'));
  35. dispatch(openDialog(EmbedMeetingDialog));
  36. }
  37. }
  38. export default translate(connect()(EmbedMeetingButton));