您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

HangupMenuButton.tsx 986B

123456789101112131415161718192021222324252627282930313233343536
  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. // @ts-ignore
  7. import { IconHangup } from '../../../base/icons';
  8. import IconButton from '../../../base/react/components/native/IconButton';
  9. import { BUTTON_TYPES } from '../../../base/ui/constants';
  10. import HangupMenu from './HangupMenu';
  11. /**
  12. * Button for showing the hangup menu.
  13. *
  14. * @returns {JSX.Element} - The hangup menu button.
  15. */
  16. const HangupMenuButton = () : JSX.Element => {
  17. const dispatch = useDispatch();
  18. const onSelect = useCallback(() => {
  19. dispatch(openSheet(HangupMenu));
  20. }, [ dispatch ]);
  21. return (
  22. <IconButton
  23. accessibilityLabel = 'toolbar.accessibilityLabel.hangup'
  24. onPress = { onSelect }
  25. src = { IconHangup }
  26. type = { BUTTON_TYPES.PRIMARY } />
  27. );
  28. };
  29. export default HangupMenuButton;