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.tsx 1.1KB

1234567891011121314151617181920212223242526272829303132
  1. import React, { useCallback } from 'react';
  2. import { useTranslation } from 'react-i18next';
  3. import { useDispatch } from 'react-redux';
  4. import { createToolbarEvent } from '../../../analytics/AnalyticsEvents';
  5. import { sendAnalytics } from '../../../analytics/functions';
  6. import { IconAddUser } from '../../../base/icons/svg';
  7. import Button from '../../../base/ui/components/web/Button';
  8. import { BUTTON_TYPES } from '../../../base/ui/constants.web';
  9. // eslint-disable-next-line lines-around-comment
  10. // @ts-ignore
  11. import { beginAddPeople } from '../../../invite';
  12. export const InviteButton = () => {
  13. const dispatch = useDispatch();
  14. const { t } = useTranslation();
  15. const onInvite = useCallback(() => {
  16. sendAnalytics(createToolbarEvent('invite'));
  17. dispatch(beginAddPeople());
  18. }, [ dispatch ]);
  19. return (
  20. <Button
  21. accessibilityLabel = { t('participantsPane.actions.invite') }
  22. fullWidth = { true }
  23. icon = { IconAddUser }
  24. labelKey = { 'participantsPane.actions.invite' }
  25. onClick = { onInvite }
  26. type = { BUTTON_TYPES.PRIMARY } />
  27. );
  28. };