mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-12-26 04:08:15 +03:00
22 lines
406 B
React
22 lines
406 B
React
|
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;
|