From 9646309a0a7b5bec2297e4bc484b6e083b40c9c7 Mon Sep 17 00:00:00 2001 From: kenilkb Date: Fri, 17 Jul 2026 16:21:29 +0530 Subject: [PATCH] Refactor showcase cards to use absolute grid overlay expansion system --- Channel-Frontend/src/pages/ShowcasePage.tsx | 184 +++++++++++--------- 1 file changed, 101 insertions(+), 83 deletions(-) diff --git a/Channel-Frontend/src/pages/ShowcasePage.tsx b/Channel-Frontend/src/pages/ShowcasePage.tsx index 7498764..4df893a 100644 --- a/Channel-Frontend/src/pages/ShowcasePage.tsx +++ b/Channel-Frontend/src/pages/ShowcasePage.tsx @@ -100,8 +100,13 @@ const TwitterEmbed: React.FC<{ url: string }> = ({ url }) => { }; // ── Collapsible Video Description Component ── -const VideoDescription: React.FC<{ text: string }> = ({ text }) => { - const [isExpanded, setIsExpanded] = useState(false); +interface VideoDescriptionProps { + text: string; + isExpanded: boolean; + onToggleExpand: () => void; +} + +const VideoDescription: React.FC = ({ text, isExpanded, onToggleExpand }) => { const shouldCollapse = text.length > 180 || text.includes('\n'); return ( @@ -118,7 +123,7 @@ const VideoDescription: React.FC<{ text: string }> = ({ text }) => { + + {/* Platform Tag */} +
+ {isIg ? 'Instagram' : isTw ? 'Twitter / X' : 'YouTube'}
- )} - - {/* Dark gradient overlay */} -
- - {/* Play button overlay */} - - - {/* Platform Tag */} -
- {isIg ? 'Instagram' : isTw ? 'Twitter / X' : 'YouTube'}
-
- {/* Content Info */} -
-
-

- {item.title} -

- {item.description && ( - + {/* Content Info */} +
+
+

+ {item.title} +

+ {item.description && ( + setExpandedItemId(isExpanded ? null : item.id)} + /> + )} +
+ + {/* Redirect CTA */} + {item.redirectUrl && ( + )}
- - {/* Redirect CTA */} - {item.redirectUrl && ( - - )} -
+
); })}