Commit 11188b53 by ryan

minor storybook cleanup

parent f9e3c33e
...@@ -8,7 +8,7 @@ import { renderComponentWithTheme } from '../../utils/storybook/withTheme'; ...@@ -8,7 +8,7 @@ import { renderComponentWithTheme } from '../../utils/storybook/withTheme';
import { UseState } from '../../utils/storybook/UseState'; import { UseState } from '../../utils/storybook/UseState';
const BasicGreen = getColorDefinitionByName('green'); const BasicGreen = getColorDefinitionByName('green');
const BasicBlue = getColorDefinitionByName('blue'); const BasicRed = getColorDefinitionByName('red');
const LightBlue = getColorDefinitionByName('light-blue'); const LightBlue = getColorDefinitionByName('light-blue');
const NamedColorsPaletteStories = storiesOf('UI/ColorPicker/Palettes/NamedColorsPalette', module); const NamedColorsPaletteStories = storiesOf('UI/ColorPicker/Palettes/NamedColorsPalette', module);
...@@ -41,7 +41,7 @@ NamedColorsPaletteStories.add('Named colors swatch - support for named colors', ...@@ -41,7 +41,7 @@ NamedColorsPaletteStories.add('Named colors swatch - support for named colors',
'Selected color', 'Selected color',
{ {
Green: BasicGreen.variants.dark, Green: BasicGreen.variants.dark,
Red: BasicBlue.variants.dark, Red: BasicRed.variants.dark,
'Light blue': LightBlue.variants.dark, 'Light blue': LightBlue.variants.dark,
}, },
'red' 'red'
......
import React, { FunctionComponent } from 'react'; import React from 'react';
import { storiesOf } from '@storybook/react'; import { storiesOf } from '@storybook/react';
import { DeleteButton } from './DeleteButton'; import { DeleteButton } from './DeleteButton';
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
const CenteredStory: FunctionComponent<{}> = ({ children }) => { import { action } from '@storybook/addon-actions';
return (
<div
style={{
height: '100vh ',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}
>
{children}
</div>
);
};
storiesOf('UI/DeleteButton', module) storiesOf('UI/DeleteButton', module)
.addDecorator(story => <CenteredStory>{story()}</CenteredStory>) .addDecorator(withCenteredStory)
.add('default', () => { .add('default', () => {
return <DeleteButton onConfirm={() => {}} />; return (
<DeleteButton
onConfirm={() => {
action('Delete Confirmed')('delete!');
}}
/>
);
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment