Skip to content

Commit 8a1483f

Browse files
aoi-dev-0411claude
andcommitted
feat: make repository titles clickable links to GitHub (closes #60)
Wrap repository name text in anchor tags pointing to https://github.com/{username}/{reponame} with target=_blank and rel=noopener noreferrer for security. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a6b0119 commit 8a1483f

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

components/top-list.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type Props = {
2727
export function TopList({ userResults }: Props) {
2828
const cardDetails = (data: {
2929
title: string;
30+
titleHref?: string;
3031
subtitle?: string;
3132
score?: number;
3233
badges: { tooltip?: string; label?: any; icon: any }[];
@@ -37,7 +38,20 @@ export function TopList({ userResults }: Props) {
3738
key={data.key}
3839
>
3940
<div>
40-
<div className="font-medium text-slate-900">{data.title}</div>
41+
<div className="font-medium text-slate-900">
42+
{data.titleHref ? (
43+
<a
44+
href={data.titleHref}
45+
target="_blank"
46+
rel="noopener noreferrer"
47+
className="hover:underline"
48+
>
49+
{data.title}
50+
</a>
51+
) : (
52+
data.title
53+
)}
54+
</div>
4155
<div className="text-xs text-muted-foreground mt-1">
4256
{data.subtitle}
4357
</div>
@@ -88,6 +102,9 @@ export function TopList({ userResults }: Props) {
88102
cardDetails({
89103
key: `repo-${i}`,
90104
title: repo.name || "Unknown Repository",
105+
titleHref: repo.name
106+
? `https://github.com/${user.username}/${repo.name}`
107+
: undefined,
91108
score: repo.score,
92109
badges: [
93110
{

0 commit comments

Comments
 (0)