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

View File

@@ -1,10 +1,10 @@
<template>
<div style="overflow: hidden" :style="{ width: size + 'px', height: size + 'px' }">
<div class="overflow-hidden" :style="sizeStyle">
<div
v-if="image.frames"
class="avatar"
: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" />
<AvatarFallback class="rounded">
<Image class="size-4 text-muted-foreground" />
@@ -14,7 +14,7 @@
</template>
<script setup>
import { onMounted, ref, watch } from 'vue';
import { computed, onMounted, ref, watch } from 'vue';
import { Image } from 'lucide-vue-next';
import { Avatar, AvatarFallback, AvatarImage } from './ui/avatar';
@@ -26,7 +26,14 @@
const props = defineProps({
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({

View File

@@ -629,6 +629,7 @@
import SetAvatarStylesDialog from './SetAvatarStylesDialog.vue';
import SetAvatarTagsDialog from './SetAvatarTagsDialog.vue';
import { AppDebug } from '@/services/appConfig';
const { sortUserDialogAvatars } = useUserStore();
const { userDialog, currentUser } = storeToRefs(useUserStore());

View File

@@ -327,7 +327,6 @@
">
<Emoji
:imageUrl="image.versions[image.versions.length - 1].file.url"
:size="200"
class="aspect-square w-full rounded-t-md" />
</ItemHeader>
<ItemContent class="min-w-0 px-2.5 pt-1.5 pb-0">