File tree Expand file tree Collapse file tree 4 files changed +31
-17
lines changed Expand file tree Collapse file tree 4 files changed +31
-17
lines changed Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import Button from './Button' ;
3+ import { ThemeProvider } from 'styled-components' ;
4+ import themes from '../themes' ;
35
46export 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
1117export 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
2331withOnClickHandler . story = {
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import { storiesOf } from '@storybook/react' ;
33import ImageAtom from './ImageAtom' ;
4+ import themes from '../../themes' ;
45import jellyfish from '../../../demo/images/jellyfish.jpg' ;
6+ import { ThemeProvider } from 'styled-components' ;
57
68storiesOf ( '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 ) ) ;
You can’t perform that action at this time.
0 commit comments