Skip to content

Commit

Permalink
fix: OutgoingLinks isExternal defaults to true
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 committed May 27, 2020
1 parent 7ce4555 commit e32ae5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/components/links.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ describe('Links', () => {
const element = getByTestId('link')
expect(element.tagName).toEqual('A')
expect(element).toHaveAttribute('href', '/foo')
expect(element).toHaveAttribute('target', '_blank')
expect(element).toHaveAttribute('rel', 'noopener noreferrer')
})

test('ButtonRouteLink', () => {
Expand Down
3 changes: 2 additions & 1 deletion src/components/links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ export interface OutgoingLinkProps extends ChakraLinkProps {

export const OutgoingLink: React.FC<OutgoingLinkProps> = ({
children,
isExternal = true,
showExternalIcon = false,
...props
}) => {
return (
<ChakraLink {...props}>
<ChakraLink isExternal={isExternal} {...props}>
{children}
{showExternalIcon && (
<Icon
Expand Down

0 comments on commit e32ae5b

Please sign in to comment.