mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-26 08:55:56 +01:00
24 lines
655 B
JavaScript
24 lines
655 B
JavaScript
import React, { useRef, forwardRef, useEffect } from 'react';
|
|
import ToolTip from 'react-native-tooltip';
|
|
import PropTypes from 'prop-types';
|
|
import { View } from 'react-native';
|
|
|
|
const ToolTipMenu = (props, ref) => {
|
|
const toolTip = useRef(null);
|
|
|
|
const showMenu = () => {
|
|
console.log('Showing ToolTip');
|
|
toolTip.current?.showMenu();
|
|
};
|
|
|
|
useEffect(() => {
|
|
ref.current.showMenu = showMenu;
|
|
}, [ref]);
|
|
|
|
return <View ref={ref}>{ref.current && <ToolTip ref={toolTip} actions={props.actions} />}</View>;
|
|
};
|
|
|
|
export default forwardRef(ToolTipMenu);
|
|
ToolTipMenu.propTypes = {
|
|
actions: PropTypes.arrayOf(PropTypes.shape).isRequired,
|
|
};
|