From 8492370208df0267d15e38631d3370da52da20e0 Mon Sep 17 00:00:00 2001 From: Vincent Smedinga Date: Thu, 4 Jul 2024 14:49:21 +0200 Subject: [PATCH] chore: Extract common meta configuration for pages (#1322) --- .../amsterdam/ArticlePage/ArticlePage.stories.tsx | 11 ++--------- .../src/pages/amsterdam/FormPage/FormPage.stories.tsx | 11 ++--------- .../src/pages/amsterdam/HomePage/HomePage.stories.tsx | 11 ++--------- storybook/src/pages/amsterdam/common/config.ts | 11 +++++++++++ 4 files changed, 17 insertions(+), 27 deletions(-) create mode 100644 storybook/src/pages/amsterdam/common/config.ts diff --git a/storybook/src/pages/amsterdam/ArticlePage/ArticlePage.stories.tsx b/storybook/src/pages/amsterdam/ArticlePage/ArticlePage.stories.tsx index 9c34c0ef16..a8d3b6fcef 100644 --- a/storybook/src/pages/amsterdam/ArticlePage/ArticlePage.stories.tsx +++ b/storybook/src/pages/amsterdam/ArticlePage/ArticlePage.stories.tsx @@ -9,8 +9,10 @@ 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' const meta = { + ...commonMeta, title: 'Pages/Amsterdam.nl/Article Page', component: ArticlePage, args: { @@ -23,15 +25,6 @@ const meta = { spotlightHeading: 'Vraag een paspoort of ID-kaart aan', spotlightLinkLabel: 'Vraag nu een paspoort of ID-kaart aan', }, - argTypes: { - footer: { - table: { disable: true }, - }, - }, - parameters: { - layout: 'fullscreen', - themes: { themeOverride: 'Spacious' }, - }, } satisfies Meta export default meta diff --git a/storybook/src/pages/amsterdam/FormPage/FormPage.stories.tsx b/storybook/src/pages/amsterdam/FormPage/FormPage.stories.tsx index 70495cfadb..bc7b6d7fd0 100644 --- a/storybook/src/pages/amsterdam/FormPage/FormPage.stories.tsx +++ b/storybook/src/pages/amsterdam/FormPage/FormPage.stories.tsx @@ -5,19 +5,12 @@ import { Meta, StoryObj } from '@storybook/react' import { FormPage } from './FormPage' +import { commonMeta } from '../common/config' const meta = { + ...commonMeta, title: 'Pages/Amsterdam.nl/Form Page', component: FormPage, - argTypes: { - footer: { - table: { disable: true }, - }, - }, - parameters: { - layout: 'fullscreen', - themes: { themeOverride: 'Spacious' }, - }, } satisfies Meta export default meta diff --git a/storybook/src/pages/amsterdam/HomePage/HomePage.stories.tsx b/storybook/src/pages/amsterdam/HomePage/HomePage.stories.tsx index 0c1f84e004..a4aa46900e 100644 --- a/storybook/src/pages/amsterdam/HomePage/HomePage.stories.tsx +++ b/storybook/src/pages/amsterdam/HomePage/HomePage.stories.tsx @@ -8,22 +8,15 @@ import { Meta, StoryObj } from '@storybook/react' import type { ReactElement } from 'react' import { HomePage } from './HomePage' import * as FooterStories from '../../../components/Footer/Footer.stories' +import { commonMeta } from '../common/config' const meta = { + ...commonMeta, title: 'Pages/Amsterdam.nl/Home Page', component: HomePage, args: { footer: FooterStories.Default.args?.children as ReactElement, }, - argTypes: { - footer: { - table: { disable: true }, - }, - }, - parameters: { - layout: 'fullscreen', - themes: { themeOverride: 'Spacious' }, - }, } satisfies Meta export default meta diff --git a/storybook/src/pages/amsterdam/common/config.ts b/storybook/src/pages/amsterdam/common/config.ts new file mode 100644 index 0000000000..ab4c8ae887 --- /dev/null +++ b/storybook/src/pages/amsterdam/common/config.ts @@ -0,0 +1,11 @@ +export const commonMeta = { + argTypes: { + footer: { + table: { disable: true }, + }, + }, + parameters: { + layout: 'fullscreen', + themes: { themeOverride: 'Spacious' }, + }, +}