Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Extract common meta configuration for pages #1322

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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<typeof ArticlePage>

export default meta
Expand Down
11 changes: 2 additions & 9 deletions storybook/src/pages/amsterdam/FormPage/FormPage.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof FormPage>

export default meta
Expand Down
11 changes: 2 additions & 9 deletions storybook/src/pages/amsterdam/HomePage/HomePage.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<FooterProps>,
},
argTypes: {
footer: {
table: { disable: true },
},
},
parameters: {
layout: 'fullscreen',
themes: { themeOverride: 'Spacious' },
},
} satisfies Meta<typeof HomePage>

export default meta
Expand Down
11 changes: 11 additions & 0 deletions storybook/src/pages/amsterdam/common/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export const commonMeta = {
argTypes: {
footer: {
table: { disable: true },
},
},
parameters: {
layout: 'fullscreen',
themes: { themeOverride: 'Spacious' },
},
}