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.2KB

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