-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Feature/partners and journeys collections (#43) * feat (strapi): white paper collection * feat (strapi): white paper linked section * feat (strapi): two column section * fix (strapi): make icon card section props required * fix (strapi): add cta to icon card section * feat (strapi): move white label section to relations * feat (strapi): calendly collection * feat (strapi): calendly relation section * feat (strapi): text section component * feat (strapi): page_partner_and_products collection with dynamic zones * feat (strapi): add slug and new intro comopnent to page-parenter-and-product collection * chore: gitignore * chore (strapi): upgrade npx @strapi/upgrade latest * feat (strapi)!: find page by slug instead of documentId, breaking default strapi behaviour * feat (strapi): add default populate middleware for partners and products page * feat: strapi & frontend hero on partner products page * feat (frontend): add intro to product partners page new intro component implementation * feat (frontend): support two column section on partners and products page * fix (strapi): detailed populate dynamic comopnents also add card section * feat: white paper section * feat: quotes section on partners and products page * refactor: code style * feat: heading with link container on partners and products page * chore (frontend): add navbar to partner products page * fix (strapi): support locale for navbar language switcher * refactor (frontend): reusable partner and products page * feat (frontend): de product and partners page * fix (frontend): tests * fix (nextjs): build * fix (strapi): build * fix (frontend): 404 when slug is not found * fix (frontend): rely on asset url instead of crop * chore: changelog
- Loading branch information
1 parent
dc8ff0a
commit a80bc1a
Showing
37 changed files
with
2,205 additions
and
1,489 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "nextjs", | ||
"version": "0.7.1", | ||
"version": "0.8.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "next dev", | ||
|
19 changes: 19 additions & 0 deletions
19
nextjs/src/app/[locale]/(partners-products)/partner-und-produkte/[slug]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { SLUGS } from "@/app/[locale]/(partners-products)/slugs" | ||
import PartnersProducts from "@/app/[locale]/(partners-products)/partners-products" | ||
|
||
export default async function PartnerAndProductsPage({ | ||
params: { locale, slug }, | ||
}: { | ||
params: { | ||
locale: string | ||
slug: string | ||
} | ||
}) { | ||
const currentLocale = { | ||
href: `/${locale}/${SLUGS[locale]}/${slug}`, | ||
locale: locale, | ||
isActive: true, | ||
} | ||
|
||
return <PartnersProducts activeLocale={currentLocale} slug={slug} /> | ||
} |
19 changes: 19 additions & 0 deletions
19
nextjs/src/app/[locale]/(partners-products)/partners-and-products/[slug]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { SLUGS } from "@/app/[locale]/(partners-products)/slugs" | ||
import PartnersProducts from "@/app/[locale]/(partners-products)/partners-products" | ||
|
||
export default async function PartnerAndProductsPage({ | ||
params: { locale, slug }, | ||
}: { | ||
params: { | ||
locale: string | ||
slug: string | ||
} | ||
}) { | ||
const currentLocale = { | ||
href: `/${locale}/${SLUGS[locale]}/${slug}`, | ||
locale: locale, | ||
isActive: true, | ||
} | ||
|
||
return <PartnersProducts activeLocale={currentLocale} slug={slug} /> | ||
} |
19 changes: 19 additions & 0 deletions
19
nextjs/src/app/[locale]/(partners-products)/partners-en-producten/[slug]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { SLUGS } from "@/app/[locale]/(partners-products)/slugs" | ||
import PartnersProducts from "@/app/[locale]/(partners-products)/partners-products" | ||
|
||
export default async function PartnerAndProductsPage({ | ||
params: { locale, slug }, | ||
}: { | ||
params: { | ||
locale: string | ||
slug: string | ||
} | ||
}) { | ||
const currentLocale = { | ||
href: `/${locale}/${SLUGS[locale]}/${slug}`, | ||
locale: locale, | ||
isActive: true, | ||
} | ||
|
||
return <PartnersProducts activeLocale={currentLocale} slug={slug} /> | ||
} |
189 changes: 189 additions & 0 deletions
189
nextjs/src/app/[locale]/(partners-products)/partners-products.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
import { SLUGS } from "@/app/[locale]/(partners-products)/slugs" | ||
import strapi from "@/lib/strapi" | ||
import Hero from "@/components/hero" | ||
import Title from "@/components/title" | ||
import Text from "@/components/text" | ||
import Intro from "@/components/intro" | ||
import SectionGroup from "@/components/sections/section-group" | ||
import Container from "@/components/container" | ||
import CardGroup from "@/components/cards/card-group" | ||
import CardIcon from "@/components/cards/card-icon" | ||
import SectionWhitepaper from "@/components/sections/section-whitepaper" | ||
import SectionQuote from "@/components/sections/section-quote" | ||
import ButtonGroup from "@/components/button-group" | ||
import NavBar from "@/components/nav-bar/nav-bar" | ||
import { LinkedLocale } from "@/components/nav-bar/linked-locales-provider" | ||
import { notFound } from "next/navigation" | ||
|
||
export default async function PartnersProducts({ | ||
activeLocale, | ||
slug, | ||
}: { | ||
activeLocale: LinkedLocale | ||
slug: string | ||
}) { | ||
const url = `page-partner-and-products/${slug}?locale=${activeLocale.locale}` | ||
const page = await strapi(url) | ||
if (page && page.status === 404) { | ||
return notFound() | ||
} | ||
|
||
const { data } = await page.json() | ||
|
||
const locales = data.localizations.map( | ||
(item: { locale: string; slug: string }) => { | ||
return { | ||
href: `/${item.locale}/${SLUGS[item.locale]}/${item.slug}`, | ||
locale: item.locale, | ||
isActive: false, | ||
} | ||
}, | ||
) | ||
|
||
locales.push(activeLocale) | ||
|
||
const { hero, intro, sections } = data | ||
|
||
return ( | ||
<> | ||
<NavBar items={locales} /> | ||
{hero && ( | ||
<Hero color={hero.color.color} imageUrl={hero.backround_image.url}> | ||
<Title markdown={hero.title} /> | ||
<Text markdown={hero.body} /> | ||
</Hero> | ||
)} | ||
{intro && ( | ||
<Intro> | ||
<Text markdown={intro.body} className="grid gap-8" /> | ||
</Intro> | ||
)} | ||
{sections && sections.length > 0 && ( | ||
<div>{sections.map(dynamicSection)}</div> | ||
)} | ||
</> | ||
) | ||
} | ||
|
||
function dynamicSection(section: any, index: number) { | ||
switch (section.__component) { | ||
case "sections.two-column-section": | ||
return ( | ||
<Container | ||
key={`section_two_column_${index}`} | ||
background={section.props.background} | ||
padding={section.props.padding} | ||
> | ||
<SectionGroup columns={2}> | ||
<Text markdown={section.left_column} /> | ||
<Text markdown={section.right_column} /> | ||
</SectionGroup> | ||
</Container> | ||
) | ||
case "sections.icon-card-section-with-relation": | ||
return ( | ||
<Container | ||
key={`section_icon_card_${index}`} | ||
background={section.section_props.background} | ||
padding={section.section_props.padding} | ||
> | ||
<SectionGroup title={section.title}> | ||
<CardGroup> | ||
{section.cards.map((item: any, i: number) => { | ||
return ( | ||
<CardIcon | ||
imageUrl={item.icon_image.url} | ||
title={item.title} | ||
description={item.description} | ||
cta={[item.cta].map(mapCta)[0]} | ||
key={`kpi_sections_${i}`} | ||
/> | ||
) | ||
})} | ||
</CardGroup> | ||
</SectionGroup> | ||
</Container> | ||
) | ||
case "relations.white-paper-section": | ||
return ( | ||
<Container | ||
key={`section_white_paper_${index}`} | ||
background={section.props.background} | ||
padding={section.props.padding} | ||
> | ||
<SectionWhitepaper | ||
title={section.white_paper.title} | ||
cta={{ | ||
text: "Download whitepaper", | ||
href: section.white_paper.download_file.url, | ||
variant: "cta", | ||
size: "large", | ||
}} | ||
image={{ | ||
src: section.white_paper.cover_image.url, | ||
alt: section.white_paper.cover_image.alternativeText ?? "", | ||
}} | ||
text={section.white_paper.description} | ||
/> | ||
</Container> | ||
) | ||
case "relations.quotes-relation": | ||
return ( | ||
<Container | ||
key={`section_quote_${index}`} | ||
background={"neutral"} | ||
padding={"both-padding"} | ||
> | ||
<SectionGroup hasDividers> | ||
{section.quotes.length > 0 && section.quotes[0] && ( | ||
<SectionQuote | ||
author={`${section.quotes[0].name} | ${section.quotes[0].tagline}`} | ||
image={section.quotes[0].image} | ||
quote={section.quotes[0].quote} | ||
/> | ||
)} | ||
</SectionGroup> | ||
</Container> | ||
) | ||
case "sections.heading-with-link-container": | ||
return ( | ||
<Container | ||
key={`section_heading_with_link_${index}`} | ||
background={section.background} | ||
padding={section.padding} | ||
> | ||
<SectionGroup | ||
title={section.section_group_with_external_link.title} | ||
align={"center"} | ||
> | ||
<ButtonGroup | ||
align={"center"} | ||
ctas={[ | ||
{ | ||
href: section.section_group_with_external_link | ||
.external_cta_link.href, | ||
size: section.section_group_with_external_link | ||
.external_cta_link.size, | ||
variant: | ||
section.section_group_with_external_link.external_cta_link | ||
.variant, | ||
text: section.section_group_with_external_link | ||
.external_cta_link.label, | ||
}, | ||
]} | ||
/> | ||
</SectionGroup> | ||
</Container> | ||
) | ||
default: | ||
return <p key={`section_${index}`}>Unknown section</p> | ||
} | ||
} | ||
|
||
const mapCta = (cta: any) => { | ||
if (!cta) return undefined | ||
return { | ||
text: cta.label, | ||
...cta, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const SLUGS: { [key: string]: string } = { | ||
nl: "partners-en-producten", | ||
en: "partners-and-products", | ||
de: "partner-und-produkte", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.