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"
|
<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 />
|
:alt="attachment.description ?? undefined" class="w-full h-full object-cover bg-muted/20" controls />
|
||||||
<DialogTrigger v-else :as-child="true">
|
<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" />
|
<File class="size-12" />
|
||||||
<span class="text-sm"></span>
|
<span class="text-sm"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
</Button>
|
</Button>
|
||||||
</DialogClose>
|
</DialogClose>
|
||||||
</div>
|
</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 ?? ''"
|
<img v-if="attachment.type === 'image'" :src="attachment.url" :alt="attachment.description ?? ''"
|
||||||
class="object-contain" />
|
class="object-contain" />
|
||||||
<video v-else-if="attachment.type === 'video' || attachment.type === 'gifv'" :src="attachment.url"
|
<video v-else-if="attachment.type === 'video' || attachment.type === 'gifv'" :src="attachment.url"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- [&:has(>:last-child:nth-child(1))] means "when this element has 1 child" -->
|
<!-- [&: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">
|
<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" />
|
<Attachment v-for="attachment in attachments" :key="attachment.id" :attachment="attachment" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue