From cfba1f0aec4100410b150599628994c946e3bad6 Mon Sep 17 00:00:00 2001 From: plebeius Date: Thu, 26 Feb 2026 13:57:13 +0800 Subject: [PATCH] refactor(challenge-modal): extract duplicated publication details JSX into shared variable --- .../challenge-modal/challenge-modal.tsx | 65 +++++++------------ 1 file changed, 25 insertions(+), 40 deletions(-) diff --git a/src/components/challenge-modal/challenge-modal.tsx b/src/components/challenge-modal/challenge-modal.tsx index 2193069f..a128e747 100644 --- a/src/components/challenge-modal/challenge-modal.tsx +++ b/src/components/challenge-modal/challenge-modal.tsx @@ -279,6 +279,29 @@ const Challenge = ({ challenge, closeModal }: ChallengeProps) => { const mobileX = isIframeVisible ? 5 : window.innerWidth / 2 - 150; const mobileY = isIframeVisible ? Math.max(10, (window.innerHeight - 600) / 2) : window.innerHeight / 2 - 200; + const publicationDetails = ( + <> +
+ +
+ {title && ( +
+ +
+ )} + {content && ( +
+