Skip to content

Commit

Permalink
feat: add credits to creators in link previews using fediverse:creator
Browse files Browse the repository at this point in the history
resolve #2995
  • Loading branch information
shuuji3 committed Oct 21, 2024
1 parent 9076577 commit 7f26cf0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
19 changes: 19 additions & 0 deletions components/status/StatusPreviewCardMoreFromAuthor.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
defineProps<{
account: mastodon.v1.Account
}>()
</script>

<template>
<div
max-h-2xl
flex gap-2
my-auto
bg-gray-300
>
<span z-0>More from</span>
<AccountInlineInfo :account="account" hover:bg-gray-300 />
</div>
</template>
5 changes: 5 additions & 0 deletions components/status/StatusPreviewCardNormal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ function loadAttachment() {
<div :class="cardTypeIconMap[card.type]" w="30%" h="30%" text-secondary />
</div>
<StatusPreviewCardInfo :p="isSquare ? 'x-4' : '4'" :root="root" :card="card" :provider="providerName" />
<StatusPreviewCardMoreFromAuthor
v-if="card?.authors?.[0].account"

Check failure on line 108 in components/status/StatusPreviewCardNormal.vue

View workflow job for this annotation

GitHub Actions / ci

Property 'authors' does not exist on type 'PreviewCard'.
:account="card.authors[0].account"

Check failure on line 109 in components/status/StatusPreviewCardNormal.vue

View workflow job for this annotation

GitHub Actions / ci

Property 'authors' does not exist on type 'PreviewCard'.
p-4 py-2
/>
</NuxtLink>
</template>

Expand Down

0 comments on commit 7f26cf0

Please sign in to comment.