From 16dee50536dfb2a4282e9b80000ccd21f846383a Mon Sep 17 00:00:00 2001 From: Aditya-Prakash14 Date: Tue, 14 Jan 2025 09:05:05 +0530 Subject: [PATCH 1/2] Fix: Adjust case studies grid for different number of cards --- components/CaseStudyCard.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/components/CaseStudyCard.tsx b/components/CaseStudyCard.tsx index 7b6bad8dadb2..bea1831ad7f5 100644 --- a/components/CaseStudyCard.tsx +++ b/components/CaseStudyCard.tsx @@ -18,12 +18,20 @@ export default function CaseStudyCard({ studies = [] }: ICaseStudyCardProps) { return null; } + let gridClass = 'lg:grid-cols-3'; // Default to 3 columns for larger screens + + if (studies.length === 1) { + gridClass = 'lg:grid-cols-1'; + } else if (studies.length === 2) { + gridClass = 'lg:grid-cols-2'; + } + return ( -
+
{studies.map((study, index) => ( - +
From 783e97bb613cca9421807849754d04f8fc986415 Mon Sep 17 00:00:00 2001 From: Aditya-Prakash14 Date: Tue, 14 Jan 2025 16:36:00 +0530 Subject: [PATCH 2/2] Use flexbox for case study cards and fix layout issues --- components/CaseStudyCard.tsx | 38 ++++++++++++++---------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/components/CaseStudyCard.tsx b/components/CaseStudyCard.tsx index bea1831ad7f5..3c9d4be2d2b6 100644 --- a/components/CaseStudyCard.tsx +++ b/components/CaseStudyCard.tsx @@ -18,31 +18,23 @@ export default function CaseStudyCard({ studies = [] }: ICaseStudyCardProps) { return null; } - let gridClass = 'lg:grid-cols-3'; // Default to 3 columns for larger screens - - if (studies.length === 1) { - gridClass = 'lg:grid-cols-1'; - } else if (studies.length === 2) { - gridClass = 'lg:grid-cols-2'; - } - return ( -
- {studies.map((study, index) => ( - - ); }