From 531df09182fe3d40c1206bb3e24949b0664162dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Thu, 26 Feb 2026 14:16:27 +0100 Subject: [PATCH] nicolium: the same but for events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- .../src/features/status/components/thread.tsx | 50 +++++++++++++++---- packages/pl-fe/src/layouts/event-layout.tsx | 49 +++++++++++++++--- 2 files changed, 83 insertions(+), 16 deletions(-) diff --git a/packages/pl-fe/src/features/status/components/thread.tsx b/packages/pl-fe/src/features/status/components/thread.tsx index c7b58f54c..1d792ecc4 100644 --- a/packages/pl-fe/src/features/status/components/thread.tsx +++ b/packages/pl-fe/src/features/status/components/thread.tsx @@ -342,6 +342,45 @@ const Thread = ({ return children; }, [thread, linear, status, isModal]); + const meta = useMemo(() => { + const firstAttachment = status.media_attachments && status.media_attachments[0]; + + return ( + + {status.spoiler_text && } + {(firstAttachment?.type === 'image' || firstAttachment?.type === 'gifv') && ( + <> + + + {firstAttachment.mime_type && ( + + )} + {firstAttachment.meta.original && ( + + )} + {firstAttachment.meta.original && ( + + )} + + )} + + + + + + {status.edited_at && } + + {status.account.local === false && } + + ); + }, [status]); + useEffect(() => { setExpandAllStatuses?.(() => { expandStatuses(thread); @@ -357,16 +396,7 @@ const Thread = ({ 'mt-2': !isModal, })} > - - {status.spoiler_text && } - - - - - {status.edited_at && } - - {status.account.local === false && } - + {meta}
{ pathname.endsWith(path), ); + const meta = useMemo(() => { + if (!status) return null; + + const firstAttachment = status.media_attachments && status.media_attachments[0]; + + return ( + + {status.spoiler_text && } + {(firstAttachment?.type === 'image' || firstAttachment?.type === 'gifv') && ( + <> + + + {firstAttachment.mime_type && ( + + )} + {firstAttachment.meta.original && ( + + )} + {firstAttachment.meta.original && ( + + )} + + )} + + + + + + {status.edited_at && } + + {status.account.local === false && } + + ); + }, [status]); + return ( <> - {status?.account.local === false && ( - - - - )} + {meta}