Skip to content

Commit cb7f609

Browse files
authored
fix(#618): Add ExternalLink icon to GitHub Repo chip (#625)
In this PR: - Add `ExternalLink` icon, sourced from [Hero Icons](https://heroicons.dev/) - Append `ExternalLink` icon to the GitHub repo chip on `routes/package/(_components)/PackageHeader.tsx` to help signify that it's an external link, which should at least partially resolve #618 <img width="1407" alt="Screenshot 2024-07-01 at 12 12 25 PM" src="https://github.com/jsr-io/jsr/assets/35377827/8d189e23-b412-4a45-bec3-395c697f4527"> <img width="612" alt="Screenshot 2024-07-01 at 12 12 21 PM" src="https://github.com/jsr-io/jsr/assets/35377827/acc69b71-12c5-4e25-b1c9-723c74eb2bc1">
1 parent f9c9384 commit cb7f609

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2024 the JSR authors. All rights reserved. MIT license.
2+
export function ExternalLink(props: { class?: string; strokeWidth?: string }) {
3+
return (
4+
<svg
5+
fill="none"
6+
stroke-width={props.strokeWidth ?? "1.5"}
7+
stroke="currentColor"
8+
viewBox="0 0 24 24"
9+
xmlns="http://www.w3.org/2000/svg"
10+
class={`size-4 ${props.class ?? ""}`}
11+
>
12+
<path
13+
stroke-linecap="round"
14+
stroke-linejoin="round"
15+
d="M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"
16+
/>
17+
</svg>
18+
);
19+
}

frontend/routes/package/(_components)/PackageHeader.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright 2024 the JSR authors. All rights reserved. MIT license.
22
import { Package, PackageVersionWithUser } from "../../../utils/api_types.ts";
3+
import { ExternalLink } from "../../../components/icons/ExternalLink.tsx";
34
import { GitHub } from "../../../components/icons/GitHub.tsx";
45
import { RuntimeCompatIndicator } from "../../../components/RuntimeCompatIndicator.tsx";
56
import { getScoreTextColorClass } from "../../../utils/score_ring_color.ts";
@@ -141,6 +142,7 @@ export function PackageHeader(
141142
<span>
142143
{pkg.githubRepository.owner}/{pkg.githubRepository.name}
143144
</span>
145+
<ExternalLink strokeWidth="2.25" />
144146
</a>
145147
)}
146148
</div>

0 commit comments

Comments
 (0)