Skip to content

Commit 2623256

Browse files
committed
fix two row featured projects bugs
1 parent d44637d commit 2623256

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/components/sections/FeaturedProjects.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ export function FeaturedProjects({ projects }: FeaturedProjectsProps) {
2525
const projectCount = projects?.length || 0;
2626
const gridClasses = getGridClasses(projectCount);
2727

28-
// Show only first 3 projects initially, or all if less than 4
29-
const initialProjects = projects?.slice(0, 3) || [];
30-
const remainingProjects = projects?.slice(3) || [];
31-
const shouldShowMoreButton = projectCount > 3;
32-
const displayedProjects = showAllProjects ? projects : initialProjects;
28+
const shouldShowInTwoRows = projectCount == 4;
29+
const shouldShowMoreButton = !shouldShowInTwoRows && projectCount > 3;
30+
const initialProjects = projects?.slice(0, shouldShowInTwoRows? 4: 3) || [];
3331

3432
return (
3533
<section

0 commit comments

Comments
 (0)