2022-08-26 18:25:04 +00:00
|
|
|
import React, { useCallback } from 'react';
|
|
|
|
import { useDispatch } from 'react-redux';
|
|
|
|
|
2022-10-11 10:47:54 +00:00
|
|
|
import { openSheet } from '../../../base/dialog/actions';
|
2022-09-06 17:32:20 +00:00
|
|
|
import { IconHangup } from '../../../base/icons/svg';
|
2022-10-31 14:34:26 +00:00
|
|
|
import IconButton from '../../../base/ui/components/native/IconButton';
|
2022-11-09 12:45:55 +00:00
|
|
|
import { BUTTON_TYPES } from '../../../base/ui/constants.native';
|
2022-08-26 18:25:04 +00:00
|
|
|
|
|
|
|
import HangupMenu from './HangupMenu';
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Button for showing the hangup menu.
|
|
|
|
*
|
|
|
|
* @returns {JSX.Element} - The hangup menu button.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
const HangupMenuButton = (): JSX.Element => {
|
2022-08-26 18:25:04 +00:00
|
|
|
const dispatch = useDispatch();
|
|
|
|
|
|
|
|
const onSelect = useCallback(() => {
|
|
|
|
dispatch(openSheet(HangupMenu));
|
|
|
|
}, [ dispatch ]);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<IconButton
|
|
|
|
accessibilityLabel = 'toolbar.accessibilityLabel.hangup'
|
|
|
|
onPress = { onSelect }
|
|
|
|
src = { IconHangup }
|
|
|
|
type = { BUTTON_TYPES.PRIMARY } />
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default HangupMenuButton;
|