Skip to content

Commit adf70a4

Browse files
feat(link): add ExternalLink
1 parent 0a613ef commit adf70a4

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { PiArrowSquareOutBold } from 'react-icons/pi';
2+
3+
import { Icon } from '..';
4+
import type { LinkProps } from '.';
5+
import { Link } from '.';
6+
7+
export type ExternalLinkProps = Omit<LinkProps, 'isExternal' | 'children'> & { label: string };
8+
9+
export const ExternalLink = (props: ExternalLinkProps) => {
10+
return (
11+
<Link href={props.href} isExternal>
12+
{props.label}
13+
<Icon display="inline" verticalAlign="middle" marginInlineStart={2} as={PiArrowSquareOutBold} />
14+
</Link>
15+
);
16+
};

lib/components/link/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
export type { ExternalLinkProps } from './external-link';
2+
export { ExternalLink } from './external-link';
13
export type { LinkProps } from './wrapper';
24
export { Link } from './wrapper';

0 commit comments

Comments
 (0)