mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 08:28:20 +01:00
fix: 💄 Fix a few attachment layout issues
This commit is contained in:
parent
ff030b63ee
commit
4b67f6ab9a
|
|
@ -10,7 +10,7 @@
|
|||
<audio v-else-if="attachment.type === 'audio'" :src="attachment.url"
|
||||
:alt="attachment.description ?? undefined" class="w-full h-full object-cover bg-muted/20" controls />
|
||||
<DialogTrigger v-else :as-child="true">
|
||||
<div class="w-full h-full flex flex-col items-center justify-center bg-muted/20">
|
||||
<div class="w-full h-full flex flex-col items-center justify-center bg-muted/20 min-h-48">
|
||||
<File class="size-12" />
|
||||
<span class="text-sm"></span>
|
||||
</div>
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
</Button>
|
||||
</DialogClose>
|
||||
</div>
|
||||
<div class="flex items-center justify-center overflow-hidden *:max-h-[80vh] *:max-w-[80vh]">
|
||||
<div class="flex items-center justify-center overflow-hidden *:max-h-[80vh] *:max-w-[80vw]">
|
||||
<img v-if="attachment.type === 'image'" :src="attachment.url" :alt="attachment.description ?? ''"
|
||||
class="object-contain" />
|
||||
<video v-else-if="attachment.type === 'video' || attachment.type === 'gifv'" :src="attachment.url"
|
||||
|
|
@ -82,4 +82,4 @@ import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover";
|
|||
defineProps<{
|
||||
attachment: Attachment;
|
||||
}>();
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<!-- [&:has(>:last-child:nth-child(1))] means "when this element has 1 child" -->
|
||||
<div class="mt-4 grid gap-4 grid-cols-2 *:max-h-56 sm:[&:has(>:last-child:nth-child(1))]:grid-cols-1 sm:[&:has(>:last-child:nth-child(1))>*]:max-h-72">
|
||||
<Attachment v-for="attachment in attachments" :key="attachment.id" :attachment="attachment" />
|
||||
<div class="mt-4 grid gap-4 grid-cols-2 *:max-h-56 [&:has(>:last-child:nth-child(1))]:grid-cols-1 sm:[&:has(>:last-child:nth-child(1))>*]:max-h-72">
|
||||
<Attachment v-for="attachment in attachments" :key="attachment.id" :attachment="attachment" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -12,4 +12,4 @@ import Attachment from "./attachment.vue";
|
|||
defineProps<{
|
||||
attachments: AttachmentType[];
|
||||
}>();
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in a new issue