Skip to content

Commit

Permalink
feat: partially support read-only emoji reactions
Browse files Browse the repository at this point in the history
  • Loading branch information
shuuji3 committed Oct 31, 2024
1 parent 54cc0e4 commit 988e033
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/status/StatusDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,8 @@ useHydratedHead({
<div border="t base" py-2>
<StatusActions v-if="actions" :status="status" details :command="command" />
</div>
<div border="t base" py-2>
<StatusEmojiReaction v-if="actions" :status="status" details :command="command" />
</div>
</div>
</template>
24 changes: 24 additions & 0 deletions components/status/StatusEmojiReaction.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
const props = defineProps<{
status: mastodon.v1.Status
details?: boolean
}>()
const {
status,
} = useStatusActions(props)
</script>

<template>
<div flex items-center class="status-actions">
<div v-for="(i, emoji) in status.emojiReactions" :key="i" flex-inline gap-1 mr-4 text-secondary>

Check failure on line 16 in components/status/StatusEmojiReaction.vue

View workflow job for this annotation

GitHub Actions / ci

Property 'emojiReactions' does not exist on type 'Status'.
<picture class="custom-emoji" :alt="`:${emoji.name}:`" :data-emoji-id="emoji.name" :title="emoji.name">

Check failure on line 17 in components/status/StatusEmojiReaction.vue

View workflow job for this annotation

GitHub Actions / ci

Property 'name' does not exist on type 'number'.

Check failure on line 17 in components/status/StatusEmojiReaction.vue

View workflow job for this annotation

GitHub Actions / ci

Property 'name' does not exist on type 'number'.

Check failure on line 17 in components/status/StatusEmojiReaction.vue

View workflow job for this annotation

GitHub Actions / ci

Property 'name' does not exist on type 'number'.
<source :srcset="emoji.staticUrl" media="(prefers-reduced-motion: reduce)">

Check failure on line 18 in components/status/StatusEmojiReaction.vue

View workflow job for this annotation

GitHub Actions / ci

Property 'staticUrl' does not exist on type 'number'.
<img :src="emoji.url" :alt="`:${emoji.name}:`" title="" style="">

Check failure on line 19 in components/status/StatusEmojiReaction.vue

View workflow job for this annotation

GitHub Actions / ci

Property 'url' does not exist on type 'number'.

Check failure on line 19 in components/status/StatusEmojiReaction.vue

View workflow job for this annotation

GitHub Actions / ci

Property 'name' does not exist on type 'number'.
</picture>
<CommonLocalizedNumber :keypath="emoji.count" :count="emoji.count" />

Check failure on line 21 in components/status/StatusEmojiReaction.vue

View workflow job for this annotation

GitHub Actions / ci

Property 'count' does not exist on type 'number'.

Check failure on line 21 in components/status/StatusEmojiReaction.vue

View workflow job for this annotation

GitHub Actions / ci

Property 'count' does not exist on type 'number'.
</div>
</div>
</template>

0 comments on commit 988e033

Please sign in to comment.