feat(striker-ui): add atom SimpleLink

main
Tsu-ba-me 4 years ago
parent baace23719
commit 967f54a5c9
  1. 20
      striker-ui/components/atoms/SimpleLink.tsx
  2. 7
      striker-ui/types/SimpleLinkProps.d.ts

@ -0,0 +1,20 @@
import { FunctionComponent } from 'react';
import Link from 'next/link';
import { SimpleLinkProps } from '../../types/SimpleLinkProps';
const SimpleLink: FunctionComponent<SimpleLinkProps> = ({
linkProps,
anchorProps = {},
children,
}) => {
return (
// eslint-disable-next-line react/jsx-props-no-spreading
<Link {...{ passRef: true, ...linkProps }}>
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
<a {...anchorProps}>{children}</a>
</Link>
);
};
export default SimpleLink;

@ -0,0 +1,7 @@
import { AnchorHTMLAttributes } from 'react';
import { LinkProps } from 'next/link';
type SimpleLinkProps = {
linkProps: Omit<LinkProps, 'passRef'>;
anchorProps?: AnchorHTMLAttributes<HTMLAnchorElement>;
};
Loading…
Cancel
Save