Skip to content

Commit 689a815

Browse files
committed
add internal link
1 parent ea960bd commit 689a815

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

app/pages/[[owner]]/[[repo]]/index.vue

+23-5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ onMounted(async () => {
2222
}
2323
})
2424
25+
function navigateToRepo(event: Event) {
26+
const [owner, repo] = (event.target as HTMLSelectElement).value.split('/')
27+
return navigateTo({
28+
name: 'owner-repo',
29+
params: { owner, repo },
30+
})
31+
}
32+
2533
function labelColors(color: string) {
2634
const value = hexRgb(color)
2735
const [hue, saturation, lightness] = rgbToHSL(value.red, value.green, value.blue)
@@ -67,7 +75,7 @@ const openState = reactive<Record<string, boolean>>({})
6775
<select
6876
:value="selectedRepo"
6977
class="pl-8 bg-transparent pr-2 py-2 color-white border-0 w-full"
70-
@change="(event: Event) => { navigateTo(`/${(event.target as HTMLSelectElement).value}`) }"
78+
@change="navigateToRepo"
7179
>
7280
<option
7381
v-for="repo in allowedRepos"
@@ -155,12 +163,22 @@ const openState = reactive<Record<string, boolean>>({})
155163
>
156164
{{ issue.title }}
157165
</NuxtLink>
158-
<span
166+
<div
159167
class="text-xs relative md:absolute md:mt-6 text-gray-400 mb-1"
160168
>
161-
<span v-if="issue.repository">
169+
<NuxtLink
170+
v-if="issue.repository"
171+
class="no-underline hover:underline color-current"
172+
:to="{
173+
name: 'owner-repo',
174+
params: {
175+
owner: issue.repository.split('/')[0],
176+
repo: issue.repository.split('/')[1],
177+
},
178+
}"
179+
>
162180
{{ issue.repository }}
163-
</span>
181+
</NuxtLink>
164182
&middot;
165183
updated
166184
<NuxtTime
@@ -169,7 +187,7 @@ const openState = reactive<Record<string, boolean>>({})
169187
/>
170188
&middot;
171189
{{ Math.floor(issue.avgSimilarity * 100) }}% similar
172-
</span>
190+
</div>
173191
<div class="flex flex-row gap-1 items-baseline flex-wrap md:flex-nowrap">
174192
<span
175193
v-for="(label, j) of issue.labels"

0 commit comments

Comments
 (0)