From 209d1ef6d4a53bccc299b06908dbdad99185a737 Mon Sep 17 00:00:00 2001 From: Vincent Smedinga Date: Thu, 4 Jul 2024 17:44:21 +0200 Subject: [PATCH] chore: Extract common layout component for pages (#1323) --- .../ArticlePage/ArticlePage.stories.tsx | 4 - .../amsterdam/ArticlePage/ArticlePage.tsx | 31 ++-- .../src/pages/amsterdam/FormPage/FormPage.tsx | 155 +++++++++--------- .../amsterdam/HomePage/HomePage.stories.tsx | 6 - .../src/pages/amsterdam/HomePage/HomePage.tsx | 31 +--- .../src/pages/amsterdam/common/Layout.tsx | 17 ++ .../src/pages/amsterdam/common/config.ts | 11 -- .../src/pages/amsterdam/common/config.tsx | 16 ++ 8 files changed, 124 insertions(+), 147 deletions(-) create mode 100644 storybook/src/pages/amsterdam/common/Layout.tsx delete mode 100644 storybook/src/pages/amsterdam/common/config.ts create mode 100644 storybook/src/pages/amsterdam/common/config.tsx diff --git a/storybook/src/pages/amsterdam/ArticlePage/ArticlePage.stories.tsx b/storybook/src/pages/amsterdam/ArticlePage/ArticlePage.stories.tsx index a8d3b6fcef..63bf5ad169 100644 --- a/storybook/src/pages/amsterdam/ArticlePage/ArticlePage.stories.tsx +++ b/storybook/src/pages/amsterdam/ArticlePage/ArticlePage.stories.tsx @@ -3,11 +3,8 @@ * Copyright Gemeente Amsterdam */ -import type { FooterProps } from '@amsterdam/design-system-react' import { Meta, StoryObj } from '@storybook/react' -import type { ReactElement } from 'react' import { ArticlePage } from './ArticlePage' -import * as FooterStories from '../../../components/Footer/Footer.stories' import * as ImageStories from '../../../components/Image/Image.stories' import { commonMeta } from '../common/config' @@ -16,7 +13,6 @@ const meta = { title: 'Pages/Amsterdam.nl/Article Page', component: ArticlePage, args: { - footer: FooterStories.Default.args?.children as ReactElement, heading: 'Ontvang uw paspoort of ID-kaart in de zomer gratis thuis', imageSrc: ImageStories.LazyLoading.args?.src, lead: 'Niet meer naar het Stadsloket, maar thuis of op het werk uw nieuwe paspoort ontvangen. In juni en juli kan dat. Deze zomer bezorgt de gemeente reisdocumenten gratis aan huis. We doen dat om de drukte in de Stadsloketten te verminderen. En u hoeft maar 1 keer naar het Stadsloket.', diff --git a/storybook/src/pages/amsterdam/ArticlePage/ArticlePage.tsx b/storybook/src/pages/amsterdam/ArticlePage/ArticlePage.tsx index 85cf5854aa..b30ec3d443 100644 --- a/storybook/src/pages/amsterdam/ArticlePage/ArticlePage.tsx +++ b/storybook/src/pages/amsterdam/ArticlePage/ArticlePage.tsx @@ -1,13 +1,8 @@ -import { Footer, Screen, SkipLink } from '@amsterdam/design-system-react' -import type { FooterProps } from '@amsterdam/design-system-react' -import { ReactElement } from 'react' import { ArticleBody } from './ArticleBody' import { ArticleBreadcrumb } from './ArticleBreadcrumb' import { ArticleHeader } from './ArticleHeader' -import { AppHeader } from '../common/AppHeader' export type ArticlePageProps = { - footer: ReactElement heading: string imageSrc: string lead: string @@ -17,7 +12,6 @@ export type ArticlePageProps = { } export const ArticlePage = ({ - footer, heading, imageSrc, lead, @@ -26,20 +20,15 @@ export const ArticlePage = ({ spotlightLinkLabel, }: ArticlePageProps) => ( <> - Direct naar inhoud - - - -
- - -
-
{footer}
-
+ +
+ + +
) diff --git a/storybook/src/pages/amsterdam/FormPage/FormPage.tsx b/storybook/src/pages/amsterdam/FormPage/FormPage.tsx index 9be619a571..037632cd7d 100644 --- a/storybook/src/pages/amsterdam/FormPage/FormPage.tsx +++ b/storybook/src/pages/amsterdam/FormPage/FormPage.tsx @@ -12,100 +12,91 @@ import { Paragraph, Radio, Row, - Screen, Select, - SkipLink, TextArea, TextInput, } from '@amsterdam/design-system-react' import { useState } from 'react' -import { AppHeader } from '../common/AppHeader' export const FormPage = () => { const [textareaLength, setTextareaLength] = useState(0) return ( - <> - Direct naar inhoud - - - - - - Home - - Contact -
e.preventDefault()}> + + + + Home + + Contact + e.preventDefault()}> + + + + Een duidelijke beschrijving van uw vraag helpt ons bij het behandelen. + +