Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions app/components/Package/ExternalLinks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ const homepageUrl = computed(() => {
return homepage
})
const fundingUrl = computed(() => {
let funding = displayVersion.value?.funding
if (Array.isArray(funding)) funding = funding[0]
if (!funding) return null
return typeof funding === 'string' ? funding : funding.url
})
const PROVIDER_ICONS: Record<string, IconClass> = {
github: 'i-simple-icons:github',
gitlab: 'i-simple-icons:gitlab',
Expand Down Expand Up @@ -97,10 +88,5 @@ const repoProviderIcon = computed((): IconClass => {
{{ $t('package.links.jsr') }}
</LinkBase>
</li>
<li v-if="fundingUrl">
<LinkBase :to="fundingUrl" classicon="i-lucide:heart">
{{ $t('package.links.fund') }}
</LinkBase>
</li>
</ul>
</template>
18 changes: 18 additions & 0 deletions app/components/Package/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,15 @@ const likeAction = async () => {
isLikeActionPending.value = false
}
}

const fundingUrl = computed(() => {
let funding = props.displayVersion?.funding
if (Array.isArray(funding)) funding = funding[0]

if (!funding) return null

return typeof funding === 'string' ? funding : funding.url
})
</script>

<template>
Expand Down Expand Up @@ -312,6 +321,15 @@ const likeAction = async () => {
</span>
</ButtonBase>
</TooltipApp>

<LinkBase
variant="button-secondary"
v-if="fundingUrl"
:to="fundingUrl"
classicon="i-lucide:handshake text-accent"
>
<span class="max-sm:sr-only">{{ $t('package.links.fund') }}</span>
</LinkBase>
</div>
</div>
</header>
Expand Down
2 changes: 2 additions & 0 deletions app/components/Package/Skeleton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<SkeletonBlock class="w-9 md:w-36 h-9 rounded" />
<!-- Likes button placeholder -->
<SkeletonBlock class="w-14 h-9 rounded" />
<!-- Fund link placeholder -->
<SkeletonBlock class="w-22 h-9 rounded self-baseline" />
</div>
</div>
</header>
Expand Down
Loading