Skip to content

Commit 0785e85

Browse files
feat(ui): move fund to the package header
1 parent 9ae5629 commit 0785e85

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

app/components/Package/ExternalLinks.vue

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,6 @@ const homepageUrl = computed(() => {
2323
return homepage
2424
})
2525
26-
const fundingUrl = computed(() => {
27-
let funding = displayVersion.value?.funding
28-
if (Array.isArray(funding)) funding = funding[0]
29-
30-
if (!funding) return null
31-
32-
return typeof funding === 'string' ? funding : funding.url
33-
})
34-
3526
const PROVIDER_ICONS: Record<string, IconClass> = {
3627
github: 'i-simple-icons:github',
3728
gitlab: 'i-simple-icons:gitlab',
@@ -97,10 +88,5 @@ const repoProviderIcon = computed((): IconClass => {
9788
{{ $t('package.links.jsr') }}
9889
</LinkBase>
9990
</li>
100-
<li v-if="fundingUrl">
101-
<LinkBase :to="fundingUrl" classicon="i-lucide:heart">
102-
{{ $t('package.links.fund') }}
103-
</LinkBase>
104-
</li>
10591
</ul>
10692
</template>

app/components/Package/Header.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,15 @@ const likeAction = async () => {
241241
isLikeActionPending.value = false
242242
}
243243
}
244+
245+
const fundingUrl = computed(() => {
246+
let funding = props.displayVersion?.funding
247+
if (Array.isArray(funding)) funding = funding[0]
248+
249+
if (!funding) return null
250+
251+
return typeof funding === 'string' ? funding : funding.url
252+
})
244253
</script>
245254

246255
<template>
@@ -312,6 +321,15 @@ const likeAction = async () => {
312321
</span>
313322
</ButtonBase>
314323
</TooltipApp>
324+
325+
<LinkBase
326+
variant="button-secondary"
327+
v-if="fundingUrl"
328+
:to="fundingUrl"
329+
classicon="i-lucide:handshake text-accent"
330+
>
331+
<span class="max-sm:sr-only">{{ $t('package.links.fund') }}</span>
332+
</LinkBase>
315333
</div>
316334
</div>
317335
</header>

0 commit comments

Comments
 (0)