phanpy/src/components/MenuLink.jsx

22 lines
406 B
React
Raw Normal View History

2023-02-16 12:51:54 +03:00
import { FocusableItem } from '@szhsin/react-menu';
import Link from './link';
function MenuLink(props) {
return (
<FocusableItem>
{({ ref, closeMenu }) => (
<Link
{...props}
ref={ref}
onClick={({ detail }) =>
closeMenu(detail === 0 ? 'Enter' : undefined)
}
/>
)}
</FocusableItem>
);
}
export default MenuLink;