Skip to content

Commit

Permalink
[app:components:ExternalLink] Do not automatically open external links
Browse files Browse the repository at this point in the history
in new tab
  • Loading branch information
chichiwang committed Jul 6, 2024
1 parent 7b9f2bc commit 24c29fe
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 222 deletions.
1 change: 0 additions & 1 deletion app/Layout/__tests__/Nav.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ describe('Layout/Nav Component', () => {
render(<RouterWrappedNav />);

expect(screen.getByRole('link', { name: 'Github logo' })).toHaveAttribute('href', 'https://github.com/chichiwang/tamsui');
expect(screen.getByRole('link', { name: 'Github logo' })).toHaveAttribute('target', '_blank');
});
});
});
2 changes: 0 additions & 2 deletions app/Layout/__tests__/__snapshots__/Nav.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ exports[`Layout/Nav Component matches snapshot 1`] = `
>
<a
href="https://github.com/chichiwang/tamsui"
rel="noreferrer"
target="_blank"
>
<img
alt="Github logo"
Expand Down
4 changes: 0 additions & 4 deletions app/Layout/__tests__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ exports[`Layout Component - default matches no-child snapshot 1`] = `
>
<a
href="https://github.com/chichiwang/tamsui"
rel="noreferrer"
target="_blank"
>
<img
alt="Github logo"
Expand Down Expand Up @@ -181,8 +179,6 @@ exports[`Layout Component - default matches no-child snapshot 1`] = `
Created by
<a
href="https://github.com/chichiwang"
rel="noreferrer"
target="_blank"
>
Chi-chi Wang
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ exports[`ExternalLink Component className snapshot 1`] = `
<a
className="color-orange dotted-underline"
href="https://developer.mozilla.org/"
rel="noreferrer"
target="_blank"
>
<b>
Developer Documentation
Expand All @@ -16,8 +14,6 @@ exports[`ExternalLink Component className snapshot 1`] = `
exports[`ExternalLink Component matches snapshot 1`] = `
<a
href="https://www.github.com"
rel="noreferrer"
target="_blank"
>
Repository
</a>
Expand Down
2 changes: 1 addition & 1 deletion app/components/ExternalLink/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function ExternalLink({
href,
}: ExternalLinkProps) {
return (
<a className={className} href={href} rel="noreferrer" target="_blank">
<a className={className} href={href}>
{children}
</a>
);
Expand Down
Loading

0 comments on commit 24c29fe

Please sign in to comment.