mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-19 05:02:40 +08:00
Fix layout parameter test stories
This commit is contained in:
parent
0624c7e2a3
commit
0e475e7d45
@ -1,24 +1,44 @@
|
||||
import { Meta, Preview, Story } from '@storybook/addon-docs/blocks';
|
||||
import { Button } from '@storybook/react/demo';
|
||||
|
||||
<Meta
|
||||
title="Core/Layout MDX"
|
||||
component={Button}
|
||||
id="core-layout-mdx"
|
||||
decorators={[storyFn => <div style={{ backgroundColor: 'yellow' }}>{storyFn()}</div>]}
|
||||
decorators={[(storyFn) => <div style={{ backgroundColor: 'yellow' }}>{storyFn()}</div>]}
|
||||
/>
|
||||
|
||||
# Selected
|
||||
# Layout parameter
|
||||
|
||||
<Preview>
|
||||
This tests Storybook's built-in `layout` parameter, both as its applied in the canvas, and also how it's handled by the `Preview` block in `addon-docs`.
|
||||
|
||||
## Default
|
||||
|
||||
<Preview withToolbar>
|
||||
<Story name="defaultValue">
|
||||
<Button>Hello world</Button>
|
||||
</Story>
|
||||
</Preview>
|
||||
|
||||
## Padded
|
||||
|
||||
<Preview withToolbar>
|
||||
<Story name="padded" parameters={{ layout: 'padded' }}>
|
||||
<Button>Hello world</Button>
|
||||
</Story>
|
||||
</Preview>
|
||||
|
||||
## Fullscreen
|
||||
|
||||
<Preview withToolbar>
|
||||
<Story name="fullscreen" parameters={{ layout: 'fullscreen' }}>
|
||||
<Button>Hello world</Button>
|
||||
</Story>
|
||||
</Preview>
|
||||
|
||||
## Centered
|
||||
|
||||
<Preview withToolbar>
|
||||
<Story name="centered" parameters={{ layout: 'centered' }}>
|
||||
<Button>Hello world</Button>
|
||||
</Story>
|
||||
|
Loading…
x
Reference in New Issue
Block a user