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. /* eslint-disable lines-around-comment */
  2. import React, { useCallback } from 'react';
  3. import { useTranslation } from 'react-i18next';
  4. import { useDispatch } from 'react-redux';
  5. // @ts-ignore
  6. import { createToolbarEvent, sendAnalytics } from '../../../analytics';
  7. import { IconInviteMore } from '../../../base/icons/svg/index';
  8. import Button from '../../../base/ui/components/web/Button';
  9. import { BUTTON_TYPES } from '../../../base/ui/constants';
  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 = { IconInviteMore }
  24. labelKey = { 'participantsPane.actions.invite' }
  25. onClick = { onInvite }
  26. type = { BUTTON_TYPES.PRIMARY } />
  27. );
  28. };