From 5dd2fd72ce8dd00daa6cde0f071f64e09dcb3249 Mon Sep 17 00:00:00 2001 From: Shea Duma Date: Mon, 16 Mar 2026 01:47:51 +0200 Subject: [PATCH] unstupidified spoiler pill code --- .../message/content/ImageContent.tsx | 49 +++++++------------ .../message/content/VideoContent.tsx | 49 +++++++------------ 2 files changed, 36 insertions(+), 62 deletions(-) diff --git a/src/app/components/message/content/ImageContent.tsx b/src/app/components/message/content/ImageContent.tsx index 592e8594..92be5f9d 100644 --- a/src/app/components/message/content/ImageContent.tsx +++ b/src/app/components/message/content/ImageContent.tsx @@ -209,37 +209,24 @@ export const ImageContent = as<'div', ImageContentProps>( } }} > - {typeof spoilerReason === 'string' && spoilerReason.length > 0 ? ( - { - setBlurred(false); - if (srcState.status === AsyncStatus.Idle) { - loadSrc(); - } - }} - > - Spoiler reason: {spoilerReason} - - ) : ( - { - setBlurred(false); - if (srcState.status === AsyncStatus.Idle) { - loadSrc(); - } - }} - > - Spoilered - - )} + { + setBlurred(false); + if (srcState.status === AsyncStatus.Idle) { + loadSrc(); + } + }} + > + + {typeof spoilerReason === 'string' && spoilerReason.length > 0 + ? `Spoiler reason: ${spoilerReason}` + : `Spoilered`} + + )} {(srcState.status === AsyncStatus.Loading || srcState.status === AsyncStatus.Success) && diff --git a/src/app/components/message/content/VideoContent.tsx b/src/app/components/message/content/VideoContent.tsx index 1b38c57f..71613c59 100644 --- a/src/app/components/message/content/VideoContent.tsx +++ b/src/app/components/message/content/VideoContent.tsx @@ -179,37 +179,24 @@ export const VideoContent = as<'div', VideoContentProps>( } }} > - {typeof spoilerReason === 'string' && spoilerReason.length > 0 ? ( - { - setBlurred(false); - if (srcState.status === AsyncStatus.Idle) { - loadSrc(); - } - }} - > - Spoiler reason: {spoilerReason} - - ) : ( - { - setBlurred(false); - if (srcState.status === AsyncStatus.Idle) { - loadSrc(); - } - }} - > - Spoilered - - )} + { + setBlurred(false); + if (srcState.status === AsyncStatus.Idle) { + loadSrc(); + } + }} + > + + {typeof spoilerReason === 'string' && spoilerReason.length > 0 + ? `Spoiler reason: ${spoilerReason}` + : `Spoilered`} + + )} {(srcState.status === AsyncStatus.Loading || srcState.status === AsyncStatus.Success) &&