File tree Expand file tree Collapse file tree 4 files changed +40
-32
lines changed
Expand file tree Collapse file tree 4 files changed +40
-32
lines changed Original file line number Diff line number Diff line change 1+ import AppFooter from '~/components/AppFooter.vue'
2+ import AppHeader from '~/components/AppHeader.vue'
3+
4+ /**
5+ * Wraps a page story with the standard site chrome: AppHeader, main content
6+ * area, and AppFooter. Use this for any full-page story so the layout stays
7+ * consistent and changes only need to be made in one place.
8+ */
9+ export const pageDecorator = ( ) => ( {
10+ components : { AppHeader, AppFooter } ,
11+ template : `
12+ <div class="min-h-screen flex flex-col bg-bg text-fg">
13+ <AppHeader />
14+ <div id="main-content" class="flex-1 flex flex-col" tabindex="-1">
15+ <story />
16+ </div>
17+ <AppFooter />
18+ </div>
19+ ` ,
20+ } )
Original file line number Diff line number Diff line change 11import About from './about.vue'
22import type { Meta , StoryObj } from '@storybook-vue/nuxt'
3- import AppHeader from '~/components/AppHeader.vue'
4- import AppFooter from '~/components/AppFooter.vue'
3+ import { pageDecorator } from '../../.storybook/decorators'
54
65const meta = {
76 component : About ,
87 parameters : {
98 layout : 'fullscreen' ,
109 } ,
11- decorators : [
12- ( ) => ( {
13- components : { AppHeader, AppFooter } ,
14- template : `
15- <div class="min-h-screen flex flex-col bg-bg text-fg">
16- <AppHeader :show-logo="true" />
17- <div id="main-content" class="flex-1 flex flex-col" tabindex="-1">
18- <story />
19- </div>
20- <AppFooter />
21- </div>
22- ` ,
23- } ) ,
24- ] ,
10+ decorators : [ pageDecorator ] ,
2511} satisfies Meta < typeof About >
2612
2713export default meta
Original file line number Diff line number Diff line change 11import Accessibility from './accessibility.vue'
22import type { Meta , StoryObj } from '@storybook-vue/nuxt'
3- import AppHeader from '~/components/AppHeader.vue'
4- import AppFooter from '~/components/AppFooter.vue'
3+ import { pageDecorator } from '../../.storybook/decorators'
54
65const meta = {
76 component : Accessibility ,
87 parameters : {
98 layout : 'fullscreen' ,
109 } ,
11- decorators : [
12- ( ) => ( {
13- components : { AppHeader, AppFooter } ,
14- template : `
15- <div class="min-h-screen flex flex-col bg-bg text-fg">
16- <AppHeader :show-logo="true" />
17- <div id="main-content" class="flex-1 flex flex-col" tabindex="-1">
18- <story />
19- </div>
20- <AppFooter />
21- </div>
22- ` ,
23- } ) ,
24- ] ,
10+ decorators : [ pageDecorator ] ,
2511} satisfies Meta < typeof Accessibility >
2612
2713export default meta
Original file line number Diff line number Diff line change 1+ import Privacy from './privacy.vue'
2+ import type { Meta , StoryObj } from '@storybook-vue/nuxt'
3+ import { pageDecorator } from '../../.storybook/decorators'
4+
5+ const meta = {
6+ component : Privacy ,
7+ parameters : {
8+ layout : 'fullscreen' ,
9+ } ,
10+ decorators : [ pageDecorator ] ,
11+ } satisfies Meta < typeof Privacy >
12+
13+ export default meta
14+ type Story = StoryObj < typeof meta >
15+
16+ export const Default : Story = { }
You can’t perform that action at this time.
0 commit comments