Merge pull request #6134 from aamct2/fix-deprecations

Fix deprecations in examples
This commit is contained in:
Michael Shilman 2019-03-17 20:42:58 +08:00 committed by GitHub
commit dd791c98b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 23 deletions

View File

@ -5,12 +5,12 @@ import { withA11y } from '@storybook/addon-a11y';
addDecorator(withA11y); addDecorator(withA11y);
addParameters({ addParameters({
options: { options: {
name: 'CRA Kitchen Sink', brandTitle: 'CRA Kitchen Sink',
url: 'https://github.com/storybooks/storybook/tree/master/examples/cra-kitchen-sink', brandUrl: 'https://github.com/storybooks/storybook/tree/master/examples/cra-kitchen-sink',
goFullScreen: false, isFullscreen: false,
showAddonsPanel: true, showAddonsPanel: true,
showSearchBox: false, showSearchBox: false,
addonPanelInRight: true, panelPosition: 'right',
sortStoriesByKind: false, sortStoriesByKind: false,
hierarchySeparator: /\./, hierarchySeparator: /\./,
hierarchyRootSeparator: /\|/, hierarchyRootSeparator: /\|/,

View File

@ -1,13 +1,12 @@
import { configure, addDecorator } from '@storybook/react'; import { configure, addDecorator, addParameters } from '@storybook/react';
import { withOptions } from '@storybook/addon-options';
import { withInfo } from '@storybook/addon-info'; import { withInfo } from '@storybook/addon-info';
addDecorator( addParameters({
withOptions({ options: {
name: 'CRA TypeScript Kitchen Sink', brandTitle: 'CRA TypeScript Kitchen Sink',
url: 'https://github.com/storybooks/storybook/tree/master/examples/cra-ts-kitchen-sink', brandUrl: 'https://github.com/storybooks/storybook/tree/master/examples/cra-ts-kitchen-sink',
}) },
); });
addDecorator(withInfo()); addDecorator(withInfo());
function loadStories() { function loadStories() {

View File

@ -2,7 +2,7 @@ import hbs from 'htmlbars-inline-precompile';
import { storiesOf } from '@storybook/ember'; import { storiesOf } from '@storybook/ember';
storiesOf('Welcome', module) storiesOf('Welcome', module)
.addParameters({ options: { showAddonPanel: false } }) .addParameters({ options: { showPanel: false } })
.add('basic', () => ({ .add('basic', () => ({
template: hbs` template: hbs`
{{welcome-page}} {{welcome-page}}

View File

@ -1,10 +1,11 @@
/** @jsx h */ /** @jsx h */
import { configure } from '@storybook/preact'; import { addParameters, configure } from '@storybook/preact';
import { setOptions } from '@storybook/addon-options';
setOptions({ addParameters({
hierarchySeparator: /\/|\./, options: {
hierarchyRootSeparator: /\|/, hierarchySeparator: /\/|\./,
hierarchyRootSeparator: /\|/,
},
}); });
const loadStories = () => { const loadStories = () => {

View File

@ -4,15 +4,14 @@ import { h } from 'preact';
import { storiesOf } from '@storybook/preact'; import { storiesOf } from '@storybook/preact';
import { withBackgrounds } from '@storybook/addon-backgrounds';
import Button from '../Button'; import Button from '../Button';
storiesOf('Addons|Backgrounds', module) storiesOf('Addons|Backgrounds', module)
.addDecorator( .addParameters({
withBackgrounds([ backgrounds: [
{ name: 'twitter', value: '#00aced' }, { name: 'twitter', value: '#00aced' },
{ name: 'facebook', value: '#3b5998', default: true }, { name: 'facebook', value: '#3b5998', default: true },
]) ],
) })
.add('Example 1', () => <Button>You should be able to switch backgrounds for this story</Button>) .add('Example 1', () => <Button>You should be able to switch backgrounds for this story</Button>)
.add('Example 2', () => <Button>This one too!</Button>); .add('Example 2', () => <Button>This one too!</Button>);