Skip to content

Commit

Permalink
move target="_blank" rel="noopener noreferrer" into ExternalLink
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Dec 4, 2024
1 parent e2d4385 commit 10ac491
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/application/components/ExternalLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ export const ExternalLink = forwardRef<
HTMLAnchorElement,
ComponentProps<"a"> & { href: string }
>((props, ref) => {
return <a {...props} ref={ref} />;
return <a target="_blank" rel="noopener noreferrer" {...props} ref={ref} />;
});
2 changes: 0 additions & 2 deletions src/application/components/GitHubIssueLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ export const GitHubIssueLink = forwardRef<
{...props}
ref={ref}
className={className}
rel="noreferrer noopener"
target="_blank"
href={`https://github.com/apollographql/${repository}/issues/new?${params}`}
>
{children}
Expand Down
2 changes: 0 additions & 2 deletions src/application/components/GitHubReleaseHoverCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ function SnapshotCardContents({ version }: { version: SnapshotVersion }) {
<ExternalLink
className="flex gap-1 items-center mt-2"
href={`https://github.com/apollographql/apollo-client/pull/${release.prNumber}`}
target="_blank"
rel="noreferrer"
>
View pull request in GitHub <IconOutlink className="size-3" />
</ExternalLink>
Expand Down
24 changes: 4 additions & 20 deletions src/application/components/Modals/ClientNotFoundModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ interface ClientNotFoundModalProps {

function ConnectToDevToolsOptionLink() {
return (
<ExternalLink
rel="noreferrer noopener"
target="_blank"
href="https://www.apollographql.com/docs/react/api/core/ApolloClient#apolloclientoptions-connecttodevtools"
>
<ExternalLink href="https://www.apollographql.com/docs/react/api/core/ApolloClient#apolloclientoptions-connecttodevtools">
<code>connectToDevTools</code> option
</ExternalLink>
);
Expand Down Expand Up @@ -73,11 +69,7 @@ ${SECTIONS.devtoolsVersion}
<p className="mt-4">
You may need to tweak your bundler settings to set{" "}
<code>globalThis.__DEV__</code> correctly. See the{" "}
<ExternalLink
rel="noreferrer noopener"
target="_blank"
href="https://www.apollographql.com/docs/react/development-testing/reducing-bundle-size/"
>
<ExternalLink href="https://www.apollographql.com/docs/react/development-testing/reducing-bundle-size/">
&quot;Reducing bundle size&quot;
</ExternalLink>{" "}
article for examples on configuring your bundler.
Expand Down Expand Up @@ -108,11 +100,7 @@ ${SECTIONS.devtoolsVersion}
<Disclosure.Panel>
Apollo Client Devtools does not currently support clients created
in iframes. Please follow{" "}
<ExternalLink
rel="noreferrer noopener"
target="_blank"
href="https://github.com/apollographql/apollo-client-devtools/discussions/380"
>
<ExternalLink href="https://github.com/apollographql/apollo-client-devtools/discussions/380">
this discussion
</ExternalLink>{" "}
for updates on this feature.
Expand All @@ -129,11 +117,7 @@ ${SECTIONS.devtoolsVersion}
<code>window.__APOLLO_CLIENT__</code> variable for up to 10
seconds after a page load before giving up. When using
Apollo&apos;s{" "}
<ExternalLink
rel="noreferrer noopener"
target="_blank"
href="https://github.com/apollographql/apollo-client-nextjs"
>
<ExternalLink href="https://github.com/apollographql/apollo-client-nextjs">
Next.js RSC integration
</ExternalLink>
, it is possible that Apollo Client Devtools will be unable to
Expand Down

0 comments on commit 10ac491

Please sign in to comment.