From 4892f270062f066db588fc727b95956872eaca7a Mon Sep 17 00:00:00 2001 From: MohFarawati Date: Tue, 14 Jul 2026 22:19:05 +0200 Subject: [PATCH] feat(home): image-led featured projects section Bring imagery to the homepage projects block (Phase 3), matching the portfolio gallery. - Thread coverImagePath through ProjectCardCopy and the home mapping. - Rewrite ProjectsSection as image-first cards (reusing PortfolioCover with the branded placeholder fallback): whole-card link, featured project spans two columns with a larger cover, type-scale title, meta + stack badges, hover lift. Replaces the previous text-only cards. Verified: eslint clean; no new type errors (pre-existing Prisma-gen anys only). --- app/[locale]/(site)/page.tsx | 1 + components/home/projects-section.tsx | 120 ++++++++++++++++----------- components/home/types.ts | 1 + 3 files changed, 72 insertions(+), 50 deletions(-) diff --git a/app/[locale]/(site)/page.tsx b/app/[locale]/(site)/page.tsx index da8f60e..6bcc712 100644 --- a/app/[locale]/(site)/page.tsx +++ b/app/[locale]/(site)/page.tsx @@ -180,6 +180,7 @@ export default async function HomePage({ params }: HomePageProps) { String(project.projectYear), ], featured: index === 0, + coverImagePath: project.coverImagePath, })); const fallbackProjectCards: ProjectCardCopy[] = projectsCopy.fallbackItems.map((item) => ({ diff --git a/components/home/projects-section.tsx b/components/home/projects-section.tsx index a484f2c..b19c5de 100644 --- a/components/home/projects-section.tsx +++ b/components/home/projects-section.tsx @@ -1,8 +1,9 @@ import { ArrowUpRight } from "lucide-react"; import Link from "next/link"; +import { PortfolioCover } from "@/components/site/portfolio-cover"; import { Badge } from "@/components/ui/badge"; -import { AppCard } from "@/components/ui/app-card"; +import { cn } from "@/lib/utils"; import { SectionHeading } from "./section-heading"; import type { ProjectCardCopy, ProjectsSectionCopy } from "./types"; @@ -20,66 +21,85 @@ export function ProjectsSection({ copy, items }: ProjectsSectionProps) { description={copy.description} /> -
- {items.map((item, index) => ( - -
-
- {item.meta.map((metaItem) => ( - - {metaItem} - - ))} +
+ {items.map((item, index) => { + const featured = Boolean(item.featured); + + return ( + +
+
-
-

- {item.title} -

-

{item.summary}

-
- -
-

- {copy.stackLabel} -

-
- {item.stack.map((stackItem) => ( +
+
+ {item.meta.map((metaItem) => ( - {stackItem} + {metaItem} ))}
-
-
- + {item.title} + + +

+ {item.summary} +

+ + {item.stack.length > 0 ? ( +
+ {item.stack.map((stackItem) => ( + + {stackItem} + + ))} +
+ ) : null} + + {item.cta} - - + +
-
- - ))} + + ); + })}
); diff --git a/components/home/types.ts b/components/home/types.ts index a8f9077..82395b8 100644 --- a/components/home/types.ts +++ b/components/home/types.ts @@ -71,6 +71,7 @@ export type ProjectCardCopy = { cta: string; meta: string[]; featured?: boolean; + coverImagePath?: string | null; }; export type ProjectsSectionCopy = {