phanpy/src/components/menu-link.jsx
2023-03-28 15:59:20 +08:00

22 lines
406 B
JavaScript

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;