mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-12-20 23:12:27 +03:00
22 lines
507 B
JavaScript
22 lines
507 B
JavaScript
import { FocusableItem } from '@szhsin/react-menu';
|
|
|
|
import Link from './link';
|
|
|
|
function MenuLink(props) {
|
|
const { className, disabled, ...restProps } = props;
|
|
return (
|
|
<FocusableItem className={className} disabled={disabled}>
|
|
{({ ref, closeMenu }) => (
|
|
<Link
|
|
{...restProps}
|
|
ref={ref}
|
|
onClick={({ detail }) =>
|
|
closeMenu(detail === 0 ? 'Enter' : undefined)
|
|
}
|
|
/>
|
|
)}
|
|
</FocusableItem>
|
|
);
|
|
}
|
|
|
|
export default MenuLink;
|