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

123456789101112131415161718192021222324252627282930
  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. import { beginAddPeople } from '../../../invite/actions';
  10. export const InviteButton = () => {
  11. const dispatch = useDispatch();
  12. const { t } = useTranslation();
  13. const onInvite = useCallback(() => {
  14. sendAnalytics(createToolbarEvent('invite'));
  15. dispatch(beginAddPeople());
  16. }, [ dispatch ]);
  17. return (
  18. <Button
  19. accessibilityLabel = { t('participantsPane.actions.invite') }
  20. fullWidth = { true }
  21. icon = { IconAddUser }
  22. labelKey = { 'participantsPane.actions.invite' }
  23. onClick = { onInvite }
  24. type = { BUTTON_TYPES.PRIMARY } />
  25. );
  26. };