diff --git a/apps/vth-frontend/next.config.js b/apps/vth-frontend/next.config.js index d402773a..4530be87 100644 --- a/apps/vth-frontend/next.config.js +++ b/apps/vth-frontend/next.config.js @@ -9,9 +9,6 @@ const nextConfig = { hostname: hostname, port: port, }, - { - hostname: 'omgevingsvisie.utrecht.nl', - }, ], }, experimental: { diff --git a/apps/vth-frontend/src/app/[locale]/layout.tsx b/apps/vth-frontend/src/app/[locale]/layout.tsx index adf1f612..41684ead 100644 --- a/apps/vth-frontend/src/app/[locale]/layout.tsx +++ b/apps/vth-frontend/src/app/[locale]/layout.tsx @@ -134,7 +134,7 @@ const RootLayout = async ({ children, params: { locale } }: LayoutProps) => { - + diff --git a/apps/vth-frontend/src/app/[locale]/page.tsx b/apps/vth-frontend/src/app/[locale]/page.tsx index 27fa4233..2653c4ab 100644 --- a/apps/vth-frontend/src/app/[locale]/page.tsx +++ b/apps/vth-frontend/src/app/[locale]/page.tsx @@ -1,8 +1,9 @@ import { createStrapiURL } from '@frameless/pdc-frontend/src/util/createStrapiURL'; import { fetchData } from '@frameless/pdc-frontend/src/util/fetchData'; -import { Heading1, Heading2, Link, UnorderedList, UnorderedListItem } from '@utrecht/component-library-react'; +import { Heading1 } from '@utrecht/component-library-react'; import { Metadata } from 'next'; import React from 'react'; +import { Card } from '@/components/Card'; import { Grid } from '@/components/Grid'; import { Markdown } from '@/components/Markdown'; import { GET_HOME_PAGE } from '@/query'; @@ -39,24 +40,27 @@ const Home = async ({ params: { locale } }: { params: any }) => { const themas = data?.themas?.data; return ( - -
+ +
{title} {content}
-
- Themas - - {themas && - themas.map((thema: any) => { - const { title, slug } = thema.attributes; - return ( - - {title} - - ); - })} - +
+ {themas && + themas.map((thema: any) => { + const { title, description, slug } = thema.attributes; + return ( + + ); + })}
); diff --git a/apps/vth-frontend/src/app/[locale]/themas/[themaSlug]/content/[contentSlug]/page.tsx b/apps/vth-frontend/src/app/[locale]/themas/[themaSlug]/content/[contentSlug]/page.tsx index df8e1b6d..16eeaa92 100644 --- a/apps/vth-frontend/src/app/[locale]/themas/[themaSlug]/content/[contentSlug]/page.tsx +++ b/apps/vth-frontend/src/app/[locale]/themas/[themaSlug]/content/[contentSlug]/page.tsx @@ -41,8 +41,8 @@ const Thema = async ({ params: { locale, contentSlug } }: Params) => { const { title, content, parents } = data.findSlug.data.attributes; return ( - -
+ +
{title} {content} Themas diff --git a/apps/vth-frontend/src/app/[locale]/themas/[themaSlug]/page.tsx b/apps/vth-frontend/src/app/[locale]/themas/[themaSlug]/page.tsx index dd72f0a7..228696df 100644 --- a/apps/vth-frontend/src/app/[locale]/themas/[themaSlug]/page.tsx +++ b/apps/vth-frontend/src/app/[locale]/themas/[themaSlug]/page.tsx @@ -1,13 +1,6 @@ import { createStrapiURL } from '@frameless/pdc-frontend/src/util/createStrapiURL'; import { fetchData } from '@frameless/pdc-frontend/src/util/fetchData'; -import { - Heading1, - Heading2, - Link, - Paragraph, - UnorderedList, - UnorderedListItem, -} from '@utrecht/component-library-react'; +import { Heading1 } from '@utrecht/component-library-react'; import { Metadata } from 'next'; import React from 'react'; import { useTranslation } from '@/app/i18n'; @@ -23,9 +16,6 @@ type Params = { }; }; -const cardBody = - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam euismod, nisl eget aliquam aliquam, nunc nisl aliquam nisl, nec aliquam nisl nisl nec nisl.'; - export async function generateMetadata({ params: { locale } }: Params): Promise { // eslint-disable-next-line react-hooks/rules-of-hooks const { t } = await useTranslation(locale, 'thema'); @@ -42,81 +32,45 @@ const Thema = async ({ params: { locale, themaSlug } }: Params) => { variables: { slug: themaSlug, locale: locale }, }); - const { title, content, parents, child_themas, child_contents } = data.findSlug.data.attributes; + const { title, content, child_themas, child_contents } = data.findSlug.data.attributes; return ( - -
+ +
{title} {content}
-
- -
-
- Hoofd-themas - {parents.data[0] ? ( - - {parents.data && - parents.data.map((content: any) => { - const { title, slug: parentSlug } = content.attributes; - return ( - - {title} - - ); - })} - - ) : ( - <> - Geen content paginas verbonden. - - )} -
-
- Sub-themas - {child_themas.data[0] ? ( - - {child_themas.data.map((thema: any) => { - const { title, slug: childSlug } = thema.attributes; - return ( - - {title} - - ); - })} - - ) : ( - <> - Geen sub-themas verbonden. - - )} -
-
- Content paginas - {child_contents.data[0] ? ( - - {child_contents.data && - child_contents.data.map((content: any) => { - const { title, slug: contentSlug } = content.attributes; - return ( - - {title} - - ); - })} - - ) : ( - <> - Geen content paginas verbonden. - - )} +
+ {child_themas.data[0] && + child_themas.data.map((thema: any) => { + const { title, description, slug: childSlug } = thema.attributes; + return ( + + ); + })} + {child_contents.data[0] && + child_contents.data && + child_contents.data.map((content: any) => { + const { title, description, slug: contentSlug } = content.attributes; + return ( + + ); + })}
); diff --git a/apps/vth-frontend/src/components/Card/index.style.css b/apps/vth-frontend/src/components/Card/index.style.css index 96d56317..0a5dc092 100644 --- a/apps/vth-frontend/src/components/Card/index.style.css +++ b/apps/vth-frontend/src/components/Card/index.style.css @@ -4,5 +4,8 @@ } .utrecht-card__content { - padding: 0 1rem 1rem 1rem; + padding-block-end: 1rem; + padding-block-start: 0; + padding-inline-end: 1rem; + padding-inline-start: 1rem; } diff --git a/apps/vth-frontend/src/components/Card/index.tsx b/apps/vth-frontend/src/components/Card/index.tsx index ca0678ab..51e4683b 100644 --- a/apps/vth-frontend/src/components/Card/index.tsx +++ b/apps/vth-frontend/src/components/Card/index.tsx @@ -13,10 +13,10 @@ interface CardProps extends Omit, 'children'> { title: string; } -export const Card: FC = ({ alt, body, href, imgSrc, title, ...props }) => { +export const Card: FC = ({ alt = '', body, href, imgSrc, title, ...props }) => { return (
- {alt} + {imgSrc && {alt}}
{title} diff --git a/apps/vth-frontend/src/components/Footer/index.module.scss b/apps/vth-frontend/src/components/Footer/index.module.scss index d9f06d92..0a561b4f 100644 --- a/apps/vth-frontend/src/components/Footer/index.module.scss +++ b/apps/vth-frontend/src/components/Footer/index.module.scss @@ -9,8 +9,8 @@ display: flex; flex-wrap: wrap; justify-content: space-between; - max-width: 70rem; margin-inline: auto; + max-width: 70rem; } .utrecht-footer__list-item--6 { diff --git a/apps/vth-frontend/src/components/Grid/index.style.css b/apps/vth-frontend/src/components/Grid/index.style.css index 90d32f48..606abf3e 100644 --- a/apps/vth-frontend/src/components/Grid/index.style.css +++ b/apps/vth-frontend/src/components/Grid/index.style.css @@ -1,131 +1,87 @@ .utrecht-grid { display: grid; - max-width: 70rem; - grid-template-columns: repeat(4, 1fr); + grid-auto-rows: auto; grid-column-gap: 0.5rem; - padding-block-start: 1rem; - padding-inline-start: 1rem; - padding-inline-end: 1rem; + grid-row-gap: 1rem; + grid-template-columns: repeat(4, 1fr); + max-width: 70rem; padding-block-end: 0; } -.utrecht-grid-item { +.utrecht-grid--content-padding { + padding-block-start: 1rem; + padding-inline-end: 1rem; + padding-inline-start: 1rem; } -.full-width { - grid-column: 1/5; +.utrecht-grid__full-width { + grid-column: 1/-1; } -.two-column--first, -.two-column--second { - grid-column: 1/5; +.utrecht-grid__half-width { + grid-column: span 4; } -.three-column--first, -.three-column--second, -.three-column--third { - grid-column: 1/5; +.utrecht-grid__one-third { + grid-column: span 4; } -.four-column--first, -.four-column--second, -.four-column--third, -.four-column--fourth { - grid-column: 1/5; +.utrecht-grid__two-third { + grid-column: span 4; } -.two-thirds { - grid-column: 1/5; +.utrecht-grid__one-fourth { + grid-column: span 4; } -.one-third { - grid-column: 1/5; -} - -@container(min-width: 40rem) { +@container (min-width: 40rem) { .utrecht-grid { grid-column-gap: 1rem; + } + + .utrecht-grid--content-padding { padding-block-start: 2rem; - padding-inline-start: 2rem; padding-inline-end: 2rem; + padding-inline-start: 2rem; } - .two-column--first { - grid-column: 1/3; - } - .two-column--second { - grid-column: 3/5; + .utrecht-grid__half-width { + grid-column: span 2; } - .four-column--first { - grid-column: 1/3; - } - .four-column--second { - grid-column: 3/5; - } - .four-column--third { - grid-column: 1/3; - } - .four-column--fourth { - grid-column: 3/5; + .utrecht-grid__one-fourth { + grid-column: span 2; } - .two-thirds, - .one-third { - grid-column: 1/5; + .utrecht-grid__one-third { + grid-column: span 2; } - } -@container(min-width: 60rem) { +@container (min-width: 60rem) { .utrecht-grid { grid-template-columns: repeat(12, 1fr); } - .full-width { - grid-column: 1/13; + .utrecht-grid__half-width { + grid-column: span 6; } - .two-column--first { - grid-column: 1/7; + .utrecht-grid__one-third { + grid-column: span 4; } - .two-column--second { - grid-column: 7/13; + .utrecht-grid__two-third { + grid-column: span 8; } - .three-column--first { - grid-column: 1/5; - } - .three-column--second { - grid-column: 5/9; - } - .three-column--third { - grid-column: 9/13; - } - - .four-column--first { - grid-column: 1/4; - } - .four-column--second { - grid-column: 4/7; - } - .four-column--third { - grid-column: 7/10; - } - .four-column--fourth { - grid-column: 10/13; - } - - .two-thirds { - grid-column: 1/9; - } - .one-third { - grid-column: 9/13; + .utrecht-grid__one-fourth { + grid-column: span 3; } } -@container(min-width: 70rem) { +@container (min-width: 70rem) { .utrecht-grid { grid-column-gap: 2rem; + grid-row-gap: 2rem; } } diff --git a/apps/vth-frontend/src/query/index.ts b/apps/vth-frontend/src/query/index.ts index ac357287..da641688 100644 --- a/apps/vth-frontend/src/query/index.ts +++ b/apps/vth-frontend/src/query/index.ts @@ -29,6 +29,7 @@ query getHomePage { attributes { title slug + description } } } diff --git a/apps/vth-frontend/src/styles/globals.css b/apps/vth-frontend/src/styles/globals.css index 57b28720..f286dc31 100644 --- a/apps/vth-frontend/src/styles/globals.css +++ b/apps/vth-frontend/src/styles/globals.css @@ -38,8 +38,8 @@ a { --utrecht-page-padding-inline-end: 0; container-type: inline-size; - max-width: var(--utrecht-page-header-max-width); margin-inline: auto; + max-width: var(--utrecht-page-header-max-width); } .utrecht-page-content { @@ -49,8 +49,8 @@ a { background-color: var(--utrecht-page-content-background-color); container-type: inline-size; - max-width: var(--utrecht-page-content-max-width); margin-inline: auto; + max-width: var(--utrecht-page-content-max-width); } .utrecht-link-social {