2022-07-20 06:19:59 +00:00
|
|
|
import React, { useCallback } from 'react';
|
|
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
import { useDispatch } from 'react-redux';
|
|
|
|
|
2022-09-07 08:20:05 +00:00
|
|
|
import { createToolbarEvent } from '../../../analytics/AnalyticsEvents';
|
|
|
|
import { sendAnalytics } from '../../../analytics/functions';
|
2022-11-08 10:24:32 +00:00
|
|
|
import { IconAddUser } from '../../../base/icons/svg';
|
2022-07-27 08:40:34 +00:00
|
|
|
import Button from '../../../base/ui/components/web/Button';
|
2022-11-09 12:45:55 +00:00
|
|
|
import { BUTTON_TYPES } from '../../../base/ui/constants.web';
|
2022-10-11 10:47:54 +00:00
|
|
|
// eslint-disable-next-line lines-around-comment
|
2022-07-20 06:19:59 +00:00
|
|
|
// @ts-ignore
|
|
|
|
import { beginAddPeople } from '../../../invite';
|
|
|
|
|
|
|
|
export const InviteButton = () => {
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
const { t } = useTranslation();
|
|
|
|
|
|
|
|
const onInvite = useCallback(() => {
|
|
|
|
sendAnalytics(createToolbarEvent('invite'));
|
|
|
|
dispatch(beginAddPeople());
|
|
|
|
}, [ dispatch ]);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Button
|
|
|
|
accessibilityLabel = { t('participantsPane.actions.invite') }
|
|
|
|
fullWidth = { true }
|
2022-11-08 10:24:32 +00:00
|
|
|
icon = { IconAddUser }
|
2022-08-22 09:40:59 +00:00
|
|
|
labelKey = { 'participantsPane.actions.invite' }
|
2022-07-20 06:19:59 +00:00
|
|
|
onClick = { onInvite }
|
|
|
|
type = { BUTTON_TYPES.PRIMARY } />
|
|
|
|
);
|
|
|
|
};
|