From 343e461e2c31a68a40b87bb833c9118f907860a0 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Tue, 13 Dec 2022 20:26:53 +0100 Subject: [PATCH] fix: status media display (#421) --- components/status/StatusAttachment.vue | 18 +++++++++++++----- components/status/StatusCard.vue | 13 ++++++++++--- components/status/StatusDetails.vue | 13 +++++++++++-- components/status/StatusMedia.vue | 4 ++-- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/components/status/StatusAttachment.vue b/components/status/StatusAttachment.vue index e10bc8eb..566ac908 100644 --- a/components/status/StatusAttachment.vue +++ b/components/status/StatusAttachment.vue @@ -2,9 +2,13 @@ import { clamp } from '@vueuse/core' import type { Attachment } from 'masto' -const { attachment } = defineProps<{ +const { + attachment, + fullSize = false, +} = defineProps<{ attachment: Attachment attachments?: Attachment[] + fullSize?: boolean }>() const src = $computed(() => attachment.previewUrl || attachment.url || attachment.remoteUrl!) @@ -23,8 +27,10 @@ const rawAspectRatio = computed(() => { }) const aspectRatio = computed(() => { + if (fullSize) + return rawAspectRatio.value if (rawAspectRatio.value) - return clamp(rawAspectRatio.value, 0.5, 2) + return clamp(rawAspectRatio.value, 0.8, 1.5) return undefined }) @@ -54,7 +60,7 @@ const type = $computed(() => { - + - + STATUS_VISIBILITIES.find(v => v.value === sta

- + + -
diff --git a/components/status/StatusMedia.vue b/components/status/StatusMedia.vue index ce14fdfc..bd72b795 100644 --- a/components/status/StatusMedia.vue +++ b/components/status/StatusMedia.vue @@ -3,7 +3,7 @@ import type { Status } from 'masto' const { status } = defineProps<{ status: Status - minimized?: boolean + fullSize?: boolean }>() @@ -13,7 +13,7 @@ const { status } = defineProps<{