File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed
Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change 11<script setup lang="ts">
2- import type { mastodon } from ' masto '
2+ import { getEmojiAttributes } from ' ~/config/emojis '
33
44const props = defineProps <{
5- status: mastodon . v1 . Status
5+ status: Status
66 details? : boolean
77}>()
88
99const {
1010 status,
1111} = useStatusActions (props )
12+
13+ function isCustomEmoji(emoji : EmojiReaction ) {
14+ return !! emoji .staticUrl
15+ }
1216 </script >
1317
1418<template >
15- <div flex items-center class =" status-actions" >
16- <div v-for =" (i, emoji) in status.emojiReactions" :key =" i" flex-inline gap-1 mr-4 text-secondary >
17- <picture class =" custom-emoji" :alt =" `:${emoji.name}:`" :data-emoji-id =" emoji.name" :title =" emoji.name" >
19+ <div flex flex-wrap gap-1 class =" status-actions" >
20+ <button
21+ v-for =" (emoji, i) in status?.emojiReactions ?? []"
22+ :key =" i"
23+ flex gap-1 p =" block-1 inline-2" text-secondary btn-base hover:bg-gray-1 rounded-1
24+ >
25+ <picture v-if =" isCustomEmoji(emoji)" class =" custom-emoji" :alt =" `:${emoji.name}:`" :data-emoji-id =" emoji.name" >
1826 <source :srcset =" emoji.staticUrl" media =" (prefers-reduced-motion: reduce)" >
1927 <img :src =" emoji.url" :alt =" `:${emoji.name}:`" title =" " style =" " >
2028 </picture >
21- <CommonLocalizedNumber :keypath =" emoji.count" :count =" emoji.count" />
22- </div >
29+ <picture v-else class =" custom-emoji" :alt =" `:${emoji.name}:`" :data-emoji-id =" emoji.name" >
30+ <img v-bind =" getEmojiAttributes(emoji.name)" >
31+ </picture >
32+ <CommonLocalizedNumber :keypath =" emoji.count.toString()" :count =" emoji.count" />
33+ </button >
2334 </div >
2435</template >
You can’t perform that action at this time.
0 commit comments