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.

EndMeetingButton.tsx 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import React, { useCallback } from 'react';
  2. import { useDispatch } from 'react-redux';
  3. import { createToolbarEvent } from '../../../../analytics/AnalyticsEvents';
  4. import { sendAnalytics } from '../../../../analytics/functions';
  5. import { appNavigate } from '../../../../app/actions.native';
  6. import Button from '../../../../base/ui/components/native/Button';
  7. import { BUTTON_TYPES } from '../../../../base/ui/constants.native';
  8. import EndMeetingIcon from './EndMeetingIcon';
  9. // eslint-disable-next-line lines-around-comment
  10. // @ts-ignore
  11. import styles from './styles';
  12. /**
  13. * Button for ending meeting from carmode.
  14. *
  15. * @returns {JSX.Element} - The end meeting button.
  16. */
  17. const EndMeetingButton = (): JSX.Element => {
  18. const dispatch = useDispatch();
  19. const onSelect = useCallback(() => {
  20. sendAnalytics(createToolbarEvent('hangup'));
  21. dispatch(appNavigate(undefined));
  22. }, [ dispatch ]);
  23. return (
  24. <Button
  25. accessibilityLabel = 'toolbar.accessibilityLabel.leaveConference'
  26. icon = { EndMeetingIcon }
  27. labelKey = 'toolbar.leaveConference'
  28. onClick = { onSelect }
  29. style = { styles.endMeetingButton }
  30. type = { BUTTON_TYPES.DESTRUCTIVE } />
  31. );
  32. };
  33. export default EndMeetingButton;