Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

EndMeetingButton.tsx 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. import styles from './styles';
  10. /**
  11. * Button for ending meeting from carmode.
  12. *
  13. * @returns {JSX.Element} - The end meeting button.
  14. */
  15. const EndMeetingButton = (): JSX.Element => {
  16. const dispatch = useDispatch();
  17. const onSelect = useCallback(() => {
  18. sendAnalytics(createToolbarEvent('hangup'));
  19. dispatch(appNavigate(undefined));
  20. }, [ dispatch ]);
  21. return (
  22. <Button
  23. accessibilityLabel = 'toolbar.accessibilityLabel.leaveConference'
  24. icon = { EndMeetingIcon }
  25. labelKey = 'toolbar.leaveConference'
  26. onClick = { onSelect }
  27. style = { styles.endMeetingButton }
  28. type = { BUTTON_TYPES.DESTRUCTIVE } />
  29. );
  30. };
  31. export default EndMeetingButton;