feat: show followed tag badge

This commit is contained in:
Ayo Ayco 2025-04-25 22:11:15 +02:00
parent c3b3f0fc4f
commit c096e03fe1

View file

@ -61,6 +61,10 @@ const collapseRebloggedBy = computed(() => rebloggedBy.value?.id === status.valu
const isDM = computed(() => status.value.visibility === 'direct') const isDM = computed(() => status.value.visibility === 'direct')
const isPinned = computed(() => status.value.pinned) const isPinned = computed(() => status.value.pinned)
// limit 0 should get all w/o pagination, but might need checking
const followedTags = (await useMasto().client.value.v1.followedTags.list({ limit: 0 })).map(tag => tag.name)
const statusTagsFollowed = computed(() => status.value.tags.filter(tag => followedTags.includes(tag.name)).map(tag => tag.name))
const showUpperBorder = computed(() => newer && !directReply.value) const showUpperBorder = computed(() => newer && !directReply.value)
const showReplyTo = computed(() => !replyToMain.value && !directReply.value) const showReplyTo = computed(() => !replyToMain.value && !directReply.value)
@ -73,6 +77,20 @@ const forceShow = ref(false)
<div :h="showUpperBorder ? '1px' : '0'" w-auto bg-border mb-1 z--1 /> <div :h="showUpperBorder ? '1px' : '0'" w-auto bg-border mb-1 z--1 />
<slot name="meta"> <slot name="meta">
<!-- followed hashtag badge -->
<div flex="~ col" justify-between>
<div
v-if="statusTagsFollowed.length > 0"
flex="~ gap2" items-center h-auto text-sm text-orange
m="is-5" p="t-1 is-5"
relative text-secondary ws-nowrap
>
<div i-ri:hashtag />
<!-- show first hit followed tag -->
<span>{{ statusTagsFollowed[0] }}</span>
</div>
</div>
<!-- Pinned status --> <!-- Pinned status -->
<div flex="~ col" justify-between> <div flex="~ col" justify-between>
<div <div