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.

InviteButton.ts 1.1KB

123456789101112131415161718192021222324252627282930313233
  1. import { connect } from 'react-redux';
  2. import { createToolbarEvent } from '../../../../analytics/AnalyticsEvents';
  3. import { sendAnalytics } from '../../../../analytics/functions';
  4. import { translate } from '../../../../base/i18n/functions';
  5. import { IconAddUser } from '../../../../base/icons/svg';
  6. import AbstractButton, { IProps as AbstractButtonProps } from '../../../../base/toolbox/components/AbstractButton';
  7. import { beginAddPeople } from '../../../actions.any';
  8. /**
  9. * Implementation of a button for opening invite people dialog.
  10. */
  11. class InviteButton extends AbstractButton<AbstractButtonProps> {
  12. accessibilityLabel = 'toolbar.accessibilityLabel.invite';
  13. icon = IconAddUser;
  14. label = 'toolbar.invite';
  15. tooltip = 'toolbar.invite';
  16. /**
  17. * Handles clicking / pressing the button, and opens the appropriate dialog.
  18. *
  19. * @protected
  20. * @returns {void}
  21. */
  22. _handleClick() {
  23. const { dispatch } = this.props;
  24. sendAnalytics(createToolbarEvent('invite'));
  25. dispatch(beginAddPeople());
  26. }
  27. }
  28. export default translate(connect()(InviteButton));