Skip to content

Commit

Permalink
chore: Extract common meta configuration for pages (#1322)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentSmedinga authored Jul 4, 2024
1 parent 88d95bd commit 8492370
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 27 deletions.
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' },
},
}

0 comments on commit 8492370

Please sign in to comment.