Skip to content

Commit a9674c6

Browse files
Merge pull request #31 from steven-mercatante/fix-broken-stories
Fix broken stories
2 parents fcfbea2 + 91a8859 commit a9674c6

File tree

4 files changed

+31
-17
lines changed

4 files changed

+31
-17
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@merc/react-timeline",
3-
"version": "0.1.41",
3+
"version": "0.1.42",
44
"description": "An opinionated (but highly customizable) timeline component",
55
"main": "dist/index.cjs.js",
66
"module": "dist/index.esm.js",

src/components/Button.stories.js

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
import React from 'react';
22
import Button from './Button';
3+
import { ThemeProvider } from 'styled-components';
4+
import themes from '../themes';
35

46
export default {
57
title: 'Controls/Button',
68
component: Button,
79
};
810

9-
export const button = () => <Button>I'm just a regular button</Button>;
11+
export const button = () => (
12+
<ThemeProvider theme={themes.default}>
13+
<Button>I'm just a regular button</Button>
14+
</ThemeProvider>
15+
);
1016

1117
export const withOnClickHandler = () => (
12-
<Button
13-
onClick={() =>
14-
alert(
15-
"I'm just a regular button. Use me like you would any other button."
16-
)
17-
}
18-
>
19-
Click me for an alert
20-
</Button>
18+
<ThemeProvider theme={themes.default}>
19+
<Button
20+
onClick={() =>
21+
alert(
22+
"I'm just a regular button. Use me like you would any other button."
23+
)
24+
}
25+
>
26+
Click me for an alert
27+
</Button>
28+
</ThemeProvider>
2129
);
2230

2331
withOnClickHandler.story = {
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
import React from 'react';
22
import { storiesOf } from '@storybook/react';
33
import ImageAtom from './ImageAtom';
4+
import themes from '../../themes';
45
import jellyfish from '../../../demo/images/jellyfish.jpg';
6+
import { ThemeProvider } from 'styled-components';
57

68
storiesOf('Atoms/ImageAtom', module)
79
.addParameters({ component: ImageAtom })
810
.add('remote URL', () => (
9-
<ImageAtom
10-
src="https://images.unsplash.com/photo-1540968221243-29f5d70540bf?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=882&q=80"
11-
alt="yellow jellyfish"
12-
/>
11+
<ThemeProvider theme={themes.default}>
12+
<ImageAtom
13+
src="https://images.unsplash.com/photo-1540968221243-29f5d70540bf?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=882&q=80"
14+
alt="yellow jellyfish"
15+
/>
16+
</ThemeProvider>
1317
))
1418
.add('local image', () => (
15-
<ImageAtom src={jellyfish} alt="swimming jellyfish" />
19+
<ThemeProvider theme={themes.default}>
20+
<ImageAtom src={jellyfish} alt="swimming jellyfish" />
21+
</ThemeProvider>
1622
));

0 commit comments

Comments
 (0)