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.js 986B

1234567891011121314151617181920212223242526272829303132
  1. // @flow
  2. import React, { useCallback } from 'react';
  3. import { useTranslation } from 'react-i18next';
  4. import { useDispatch } from 'react-redux';
  5. import { createToolbarEvent, sendAnalytics } from '../../analytics';
  6. import { Icon, IconInviteMore } from '../../base/icons';
  7. import { beginAddPeople } from '../../invite';
  8. import { ParticipantInviteButton } from './styled';
  9. export const InviteButton = () => {
  10. const dispatch = useDispatch();
  11. const { t } = useTranslation();
  12. const onInvite = useCallback(() => {
  13. sendAnalytics(createToolbarEvent('invite'));
  14. dispatch(beginAddPeople());
  15. }, [ dispatch ]);
  16. return (
  17. <ParticipantInviteButton
  18. aria-label = { t('toolbar.accessibilityLabel.invite') }
  19. onClick = { onInvite }>
  20. <Icon
  21. size = { 20 }
  22. src = { IconInviteMore } />
  23. <span>{t('participantsPane.actions.invite')}</span>
  24. </ParticipantInviteButton>
  25. );
  26. };