From cb9c7c89704e9f126755c7f71d1c785dd464ed76 Mon Sep 17 00:00:00 2001 From: AmirReza Jamali Date: Sat, 29 Nov 2025 12:27:14 +0330 Subject: [PATCH] feat(marketing): Make marketing page content configurable via CMS data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace hardcoded centerFrames array with CMS data from features.cards - Update hero section to use CMS data for title, description, button text and link - Migrate features section title and description from hardcoded text to CMS - Replace hardcoded challenges section with dynamic CMS data for title, description and cards - Update advantages section to use CMS data for title and cards - Normalize CMS field names from PascalCase to snake_case (Title → title, ButtonLink → button_link, etc.) - Replace Image component with ImageWithFallback for better error handling on dynamic images - Add unoptimized prop to images to support dynamic CMS image URLs - Remove 29 lines of hardcoded content, making the page fully data-driven from CMS --- app/marketing/[id]/page.tsx | 140 ++++++++++++------------------------ 1 file changed, 44 insertions(+), 96 deletions(-) diff --git a/app/marketing/[id]/page.tsx b/app/marketing/[id]/page.tsx index 07549b9..35935e9 100644 --- a/app/marketing/[id]/page.tsx +++ b/app/marketing/[id]/page.tsx @@ -41,29 +41,7 @@ export default async function Home({ params }: IProps) { } console.log(cmsData); - const centerFrames = [ - { - src: "/magnifier.svg", - title: "1. Discover with AI", - alt: "Magnifier", - description: - "Our intelligent platform scours thousands of sources to find the perfect, most relevant tender opportunities for your specific business and expertise", - }, - { - src: "/clipboard.svg", - title: "2. Prepare with Experts", - alt: "Clipboard", - description: - "Gain access to expert support and powerful tools to craft compelling, competitive, and high-quality bids that stand out from the competition.", - }, - { - src: "/thumbs-up.svg", - title: "3. Win with a Partner", - alt: "thumbs-up", - description: - "We operate on a partnership model. We only succeed when you win. This aligns our goals and makes us a true partner in your growth.", - }, - ]; + const centerFrames = cmsData?.data.features.cards ?? []; return ( <> @@ -86,7 +64,7 @@ export default async function Home({ params }: IProps) {

$ - {cmsData?.data.chart.missedAmount ?? 1672} + {cmsData?.data.chart.missed_amount ?? 1672}

total tender amount you missed today @@ -115,29 +93,27 @@ export default async function Home({ params }: IProps) {

- {cmsData?.data.hero.Title} + {cmsData?.data.hero.title}

- {cmsData?.data.hero.Description} + {cmsData?.data.hero.description}

- {cmsData?.data.hero.ButtonText} + href={cmsData?.data.hero.button_link ?? "#"}> + {cmsData?.data.hero.button_text}

- your in-house tender department, powered by - ai + {cmsData?.data.features.title}

- Opplens is the end-to-end solution that gives you the power to - compete and win. + {cmsData?.data.features.description}
@@ -146,11 +122,12 @@ export default async function Home({ params }: IProps) {
- {frame.alt}

{frame.title}

{frame.description}

@@ -160,82 +137,53 @@ export default async function Home({ params }: IProps) {

- Tired of Complex Tenders & Lost Opportunities? + {cmsData?.data.challenges.title}

- The procurement market is tough for SMEs. We get it. You're facing - an uphill battle. + {cmsData?.data.challenges.description}

    -
  • -
    - clock icon -
    -

    Resource Drain

    -

    - Lacking the time, dedicated staff, and expertise to constantly - monitor the market and prepare high-quality bids. -

    -
  • -
  • -
    - -
    -

    Overwhelming Complexity

    -

    - Navigating complex requirements and processes designed for large - corporations with dedicated tender departments. -

    -
  • -
  • -
    - -
    -

    Low Win Rates

    -

    - Did you know 68% of SMEs in Sweden rarely or never win public - tenders? It's time to change that. -

    -
  • + {cmsData?.data.challenges.cards.map((card) => ( +
  • +
    + +
    +

    {card.title}

    +

    {card.description}

    +
  • + ))}

- {cmsData?.data.advantages.Title} + {cmsData?.data.advantages.title}

- {cmsData?.data.advantages.Cards.map((card) => ( + {cmsData?.data.advantages.cards.map((card) => (
+ key={card.title}>
-

{card.Title}

-

{card.Description}

+

{card.title}

+

{card.description}

))} @@ -262,10 +210,10 @@ export default async function Home({ params }: IProps) { />

- {cmsData?.data.footer.Tagline} + {cmsData?.data.footer.tagline}

- {cmsData?.data.footer.Copyright} + {cmsData?.data.footer.copyright}

@@ -279,8 +227,8 @@ export default async function Home({ params }: IProps) { alt="" aria-hidden="true" /> - - {cmsData?.data.footer.Phone} + + {cmsData?.data.footer.phone}
  • @@ -291,8 +239,8 @@ export default async function Home({ params }: IProps) { alt="" aria-hidden="true" /> - - {cmsData?.data.footer.Email} + + {cmsData?.data.footer.email}
  • @@ -303,7 +251,7 @@ export default async function Home({ params }: IProps) { alt="" aria-hidden="true" /> -

    {cmsData?.data.footer.Location}

    +

    {cmsData?.data.footer.location}