This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "feature/COR-1597-contact-page-improved-design (#4873)"
This reverts commit dae12d5.
- Loading branch information
VWSCoronaDashboard29
authored and
VWSCoronaDashboard29
committed
Oct 3, 2023
1 parent
2c0f97c
commit 487df7f
Showing
22 changed files
with
93 additions
and
537 deletions.
There are no files selected for viewing
27 changes: 0 additions & 27 deletions
27
packages/app/src/components/contact/contact-page-group.tsx
This file was deleted.
Oops, something went wrong.
51 changes: 0 additions & 51 deletions
51
packages/app/src/components/contact/contact-page-item-links.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
This file was deleted.
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,82 +1,86 @@ | ||
import css from '@styled-system/css'; | ||
import Head from 'next/head'; | ||
import styled from 'styled-components'; | ||
import { VisuallyHidden } from '~/components'; | ||
import { ContactPageGroup } from '~/components/contact/contact-page-group'; | ||
import { ContactPage } from '~/components/contact/types'; | ||
import { RichContent } from '~/components/cms/rich-content'; | ||
import { Heading } from '~/components/typography'; | ||
import { ContentLayout } from '~/domain/layout/content-layout'; | ||
import { Content } from '~/domain/layout/content'; | ||
import { Layout } from '~/domain/layout/layout'; | ||
import { useIntl } from '~/intl'; | ||
import { StaticProps, createGetStaticProps } from '~/static-props/create-get-static-props'; | ||
import { createGetContent, getLastGeneratedDate } from '~/static-props/get-data'; | ||
import { mediaQueries, space } from '~/style/theme'; | ||
import { | ||
createGetStaticProps, | ||
StaticProps, | ||
} from '~/static-props/create-get-static-props'; | ||
import { | ||
createGetContent, | ||
getLastGeneratedDate, | ||
} from '~/static-props/get-data'; | ||
import { RichContentBlock } from '~/types/cms'; | ||
|
||
interface ContactData { | ||
title: string | null; | ||
description: RichContentBlock[] | null; | ||
} | ||
|
||
export const getStaticProps = createGetStaticProps( | ||
getLastGeneratedDate, | ||
createGetContent<ContactPage>((context) => { | ||
createGetContent<ContactData>((context) => { | ||
const { locale } = context; | ||
|
||
return `// groq | ||
*[_type == 'contact'] { | ||
'groups': contactPageGroups[]->{ | ||
'id': _id, | ||
'title': title.${locale}, | ||
'items': contactPageGroupItems[]->{ | ||
'id': _id, | ||
'title': title.${locale}, | ||
'titleUrl': itemTitleUrl, | ||
'linkType': linkType.linkType, | ||
'description': description.${locale}, | ||
'links': contactPageItemLinks[] { | ||
'id': _id, | ||
'titleAboveLink': title.${locale}, | ||
'linkType': linkType.linkType, | ||
'label': link.title.${locale}, | ||
'href': link.href | ||
} | ||
} | ||
return `*[_type == 'contact']{ | ||
title, | ||
"description": { | ||
"_type": description._type, | ||
"${locale}": [ | ||
...description.${locale}[] | ||
{ | ||
..., | ||
"asset": asset-> | ||
}, | ||
] | ||
} | ||
}[0]`; | ||
}[0] | ||
`; | ||
}) | ||
); | ||
|
||
const Contact = (props: StaticProps<typeof getStaticProps>) => { | ||
const { commonTexts } = useIntl(); | ||
const { | ||
content: { groups }, | ||
lastGenerated, | ||
} = props; | ||
|
||
const middleIndexOfGroups = Math.ceil(groups.length / 2); | ||
const firstHalf = groups.slice(0, middleIndexOfGroups); | ||
const secondHalf = groups.slice(middleIndexOfGroups); | ||
const { content, lastGenerated } = props; | ||
|
||
return ( | ||
<Layout {...commonTexts.contact_metadata} lastGenerated={lastGenerated}> | ||
<Head> | ||
<link key="dc-type" rel="dcterms:type" href="https://standaarden.overheid.nl/owms/terms/webpagina" /> | ||
<link key="dc-type-title" rel="dcterms:type" href="https://standaarden.overheid.nl/owms/terms/webpagina" title="webpagina" /> | ||
<link | ||
key="dc-type" | ||
rel="dcterms:type" | ||
href="https://standaarden.overheid.nl/owms/terms/webpagina" | ||
/> | ||
<link | ||
key="dc-type-title" | ||
rel="dcterms:type" | ||
href="https://standaarden.overheid.nl/owms/terms/webpagina" | ||
title="webpagina" | ||
/> | ||
</Head> | ||
|
||
<VisuallyHidden> | ||
<Heading level={1}>Contact</Heading> | ||
</VisuallyHidden> | ||
|
||
<ContentLayout> | ||
<ContactLayout> | ||
<ContactPageGroup groups={firstHalf} /> | ||
<ContactPageGroup groups={secondHalf} /> | ||
</ContactLayout> | ||
</ContentLayout> | ||
<Content> | ||
{content.title && <Heading level={1}>{content.title}</Heading>} | ||
{content.description && ( | ||
<RichContent | ||
blocks={content.description} | ||
contentWrapper={RichContentWrapper} | ||
/> | ||
)} | ||
</Content> | ||
</Layout> | ||
); | ||
}; | ||
|
||
const ContactLayout = styled.div` | ||
@media ${mediaQueries.sm} { | ||
display: flex; | ||
gap: ${space[4]} ${space[5]}; | ||
} | ||
`; | ||
const RichContentWrapper = styled.div( | ||
css({ | ||
maxWidth: 'maxWidthText', | ||
width: '100%', | ||
}) | ||
); | ||
|
||
export default Contact; |
Oops, something went wrong.