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.

HangupMenuButton.tsx 975B

1234567891011121314151617181920212223242526272829303132333435
  1. /* eslint-disable lines-around-comment */
  2. import React, { useCallback } from 'react';
  3. import { useDispatch } from 'react-redux';
  4. // @ts-ignore
  5. import { openSheet } from '../../../base/dialog';
  6. import { IconHangup } from '../../../base/icons/svg';
  7. import IconButton from '../../../base/react/components/native/IconButton';
  8. import { BUTTON_TYPES } from '../../../base/ui/constants';
  9. import HangupMenu from './HangupMenu';
  10. /**
  11. * Button for showing the hangup menu.
  12. *
  13. * @returns {JSX.Element} - The hangup menu button.
  14. */
  15. const HangupMenuButton = (): JSX.Element => {
  16. const dispatch = useDispatch();
  17. const onSelect = useCallback(() => {
  18. dispatch(openSheet(HangupMenu));
  19. }, [ dispatch ]);
  20. return (
  21. <IconButton
  22. accessibilityLabel = 'toolbar.accessibilityLabel.hangup'
  23. onPress = { onSelect }
  24. src = { IconHangup }
  25. type = { BUTTON_TYPES.PRIMARY } />
  26. );
  27. };
  28. export default HangupMenuButton;