fix: emoji size in gallery and avatar dialog

This commit is contained in:
pa
2026-03-27 23:01:06 +09:00
parent 0635378cef
commit 91ac716c34
3 changed files with 12 additions and 5 deletions
+11 -4
View File
@@ -1,10 +1,10 @@
<template> <template>
<div style="overflow: hidden" :style="{ width: size + 'px', height: size + 'px' }"> <div class="overflow-hidden" :style="sizeStyle">
<div <div
v-if="image.frames" v-if="image.frames"
class="avatar" class="avatar"
:style="generateEmojiStyle(imageUrl, image.framesOverTime, image.frames, image.loopStyle, size)"></div> :style="generateEmojiStyle(imageUrl, image.framesOverTime, image.frames, image.loopStyle, size)"></div>
<Avatar v-else class="rounded" :style="{ width: size + 'px', height: size + 'px' }"> <Avatar v-else class="rounded w-full h-full">
<AvatarImage :src="imageUrl" class="object-cover" /> <AvatarImage :src="imageUrl" class="object-cover" />
<AvatarFallback class="rounded"> <AvatarFallback class="rounded">
<Image class="size-4 text-muted-foreground" /> <Image class="size-4 text-muted-foreground" />
@@ -14,7 +14,7 @@
</template> </template>
<script setup> <script setup>
import { onMounted, ref, watch } from 'vue'; import { computed, onMounted, ref, watch } from 'vue';
import { Image } from 'lucide-vue-next'; import { Image } from 'lucide-vue-next';
import { Avatar, AvatarFallback, AvatarImage } from './ui/avatar'; import { Avatar, AvatarFallback, AvatarImage } from './ui/avatar';
@@ -26,7 +26,14 @@
const props = defineProps({ const props = defineProps({
imageUrl: { type: String, default: '' }, imageUrl: { type: String, default: '' },
size: { type: Number, default: 100 } size: { type: Number, default: 0 }
});
const sizeStyle = computed(() => {
if (props.size > 0) {
return { width: props.size + 'px', height: props.size + 'px' };
}
return {};
}); });
const image = ref({ const image = ref({
@@ -629,6 +629,7 @@
import SetAvatarStylesDialog from './SetAvatarStylesDialog.vue'; import SetAvatarStylesDialog from './SetAvatarStylesDialog.vue';
import SetAvatarTagsDialog from './SetAvatarTagsDialog.vue'; import SetAvatarTagsDialog from './SetAvatarTagsDialog.vue';
import { AppDebug } from '@/services/appConfig';
const { sortUserDialogAvatars } = useUserStore(); const { sortUserDialogAvatars } = useUserStore();
const { userDialog, currentUser } = storeToRefs(useUserStore()); const { userDialog, currentUser } = storeToRefs(useUserStore());
-1
View File
@@ -327,7 +327,6 @@
"> ">
<Emoji <Emoji
:imageUrl="image.versions[image.versions.length - 1].file.url" :imageUrl="image.versions[image.versions.length - 1].file.url"
:size="200"
class="aspect-square w-full rounded-t-md" /> class="aspect-square w-full rounded-t-md" />
</ItemHeader> </ItemHeader>
<ItemContent class="min-w-0 px-2.5 pt-1.5 pb-0"> <ItemContent class="min-w-0 px-2.5 pt-1.5 pb-0">