Move deprecated stories to their own kinds

This commit is contained in:
Tom Coleman 2018-07-06 17:04:15 +10:00
parent fa9779ed28
commit fbbb12775e
5 changed files with 50 additions and 41 deletions

View File

@ -50,9 +50,6 @@ storiesOf('Addons|Actions', module)
Moving away from this story will persist the action logger Moving away from this story will persist the action logger
</Button> </Button>
)) ))
.add('Decorated Action (deprecated)', () => (
<Button onClick={pickNativeAction('decorated')}>Native Event</Button>
))
.add('Circular Payload', () => { .add('Circular Payload', () => {
const circular = { foo: {} }; const circular = { foo: {} };
circular.foo.circular = circular; circular.foo.circular = circular;
@ -160,3 +157,7 @@ storiesOf('Addons|Actions', module)
</div> </div>
); );
}); });
storiesOf('Addons|Actions.deprecated', module).add('Decorated Action', () => (
<Button onClick={pickNativeAction('decorated')}>Native Event</Button>
));

View File

@ -5,25 +5,6 @@ import backgrounds, { withBackgrounds } from '@storybook/addon-backgrounds';
import BaseButton from '../components/BaseButton'; import BaseButton from '../components/BaseButton';
storiesOf('Addons|Backgrounds', module) storiesOf('Addons|Backgrounds', module)
.addDecorator(
backgrounds([
{ name: 'twitter', value: '#00aced' },
{ name: 'facebook', value: '#3b5998', default: true },
])
)
.add('story 1', () => (
<BaseButton label="You should be able to switch backgrounds for this story" />
))
.add('story 2', () => <BaseButton label="This one too!" />)
.add(
'overriden',
backgrounds([
{ name: 'red', value: '#F44336' },
{ name: 'blue', value: '#2196F3', default: true },
])(() => <BaseButton label="This one should have different backgrounds" />)
);
storiesOf('Addons|Backgrounds, parameters', module)
.addDecorator(withBackgrounds) .addDecorator(withBackgrounds)
.addParameters({ .addParameters({
backgrounds: [ backgrounds: [
@ -51,3 +32,22 @@ storiesOf('Addons|Backgrounds, parameters', module)
backgrounds: { disable: true }, backgrounds: { disable: true },
} }
); );
storiesOf('Addons|Backgrounds.deprecated', module)
.addDecorator(
backgrounds([
{ name: 'twitter', value: '#00aced' },
{ name: 'facebook', value: '#3b5998', default: true },
])
)
.add('story 1', () => (
<BaseButton label="You should be able to switch backgrounds for this story" />
))
.add('story 2', () => <BaseButton label="This one too!" />)
.add(
'overriden',
backgrounds([
{ name: 'red', value: '#F44336' },
{ name: 'blue', value: '#2196F3', default: true },
])(() => <BaseButton label="This one should have different backgrounds" />)
);

View File

@ -72,7 +72,7 @@ storiesOf('Addons|Events', module)
.add('Logger', () => <Logger emitter={emitter} />); .add('Logger', () => <Logger emitter={emitter} />);
const WithEvents = withEvents; const WithEvents = withEvents;
storiesOf('Addons|Events/WithEvents (deprecated)', module) storiesOf('Addons|Events.deprecated', module)
.addDecorator(story => ( .addDecorator(story => (
<WithEvents emit={emit} events={events}> <WithEvents emit={emit} events={events}>
{story()} {story()}

View File

@ -47,8 +47,13 @@ storiesOf('Addons|Notes', module)
.add('withNotes rendering inline, github-flavored markdown', baseStory, { .add('withNotes rendering inline, github-flavored markdown', baseStory, {
notes: { markdown: markdownString }, notes: { markdown: markdownString },
}) })
.add('using decorator arguments, withNotes', withNotes('Notes into withNotes')(baseStory))
.add('using decorator arguments, withMarkdownNotes', withMarkdownNotes(markdownString)(baseStory))
.add('with a markdown table', baseStory, { .add('with a markdown table', baseStory, {
notes: { markdown: markdownTable }, notes: { markdown: markdownTable },
}); });
storiesOf('Addons|Notes.deprecated', module)
.add('using decorator arguments, withNotes', withNotes('Notes into withNotes')(baseStory))
.add(
'using decorator arguments, withMarkdownNotes',
withMarkdownNotes(markdownString)(baseStory)
);

View File

@ -29,22 +29,7 @@ storiesOf('Addons|Viewport.Custom Default (Kindle Fire 2)', module)
</Panel> </Panel>
), ),
{ viewport: 'ipad' } { viewport: 'ipad' }
) );
.add(
'Overridden via "withViewport" decorator (deprecated)',
withViewport('iphone6')(() => (
<Panel>
I respect my parents but I should be looking good on <b>iPhone 6</b>.
</Panel>
))
)
.add('Overridden via "Viewport" component (deprecated)', () => (
<Viewport name="iphone6p">
<Panel>
I respect my parents but I should be looking good on <b>iPhone 6 Plus</b>.
</Panel>
</Viewport>
));
const emitter = new EventEmitter(); const emitter = new EventEmitter();
@ -60,3 +45,21 @@ storiesOf('Addons|Viewport.withViewport', module)
}) })
) )
.add('onViewportChange', () => <Logger title="Select device/viewport" emitter={emitter} />); .add('onViewportChange', () => <Logger title="Select device/viewport" emitter={emitter} />);
storiesOf('Addons|Viewport.deprecated', module)
.addDecorator(withViewport('kindleFire2'))
.add(
'Overridden via "withViewport" decorator',
withViewport('iphone6')(() => (
<Panel>
I respect my parents but I should be looking good on <b>iPhone 6</b>.
</Panel>
))
)
.add('Overridden via "Viewport" component', () => (
<Viewport name="iphone6p">
<Panel>
I respect my parents but I should be looking good on <b>iPhone 6 Plus</b>.
</Panel>
</Viewport>
));