|
1 | | -import React from 'react'; |
| 1 | +import React from 'react' |
2 | 2 |
|
3 | | -import { storiesOf } from '@storybook/react'; |
| 3 | +import { storiesOf } from '@storybook/react' |
4 | 4 |
|
5 | | -import ContentLoader from '../src/index'; |
6 | | -import {Rect, Circle} from '../src/index'; |
| 5 | +import ContentLoader from '../src/index' |
| 6 | +import { Rect, Circle } from '../src/index' |
7 | 7 |
|
8 | 8 | let defaultStyle = { |
9 | | - width: 400, |
10 | | - marginLeft: 'auto', |
11 | | - marginRight: 'auto' |
| 9 | + width: 400, |
| 10 | + marginLeft: 'auto', |
| 11 | + marginRight: 'auto', |
12 | 12 | } |
13 | 13 |
|
14 | | -const Container = (props) => (<div style={defaultStyle}>{props.children}</div>) |
| 14 | +const Container = props => <div style={defaultStyle}>{props.children}</div> |
15 | 15 |
|
16 | 16 | const MyLoader = () => { |
17 | | - return( |
| 17 | + return ( |
18 | 18 | <ContentLoader height={140} speed={1} primaryColor={'#333'} secondaryColor={'#999'}> |
19 | 19 | <Circle x={195} y={30} radius={30} /> |
20 | 20 | <Rect x={50} y={80} height={10} radius={5} width={300} /> |
21 | 21 | <Rect x={75} y={100} height={10} radius={5} width={250} /> |
22 | 22 | </ContentLoader> |
23 | | - ) |
| 23 | + ) |
24 | 24 | } |
25 | 25 |
|
26 | | - |
27 | 26 | storiesOf('ContentLoader', module) |
28 | | - .add('facebook style', () => <Container><ContentLoader /></Container>) |
29 | | - .add('instagram style', () => <Container><ContentLoader type='instagram' /></Container>) |
30 | | - .add('code style', () => <Container><ContentLoader type='code' /></Container>) |
31 | | - .add('list style', () => <Container><ContentLoader type='list' /></Container>) |
32 | | - .add('bullet list style', () => <Container><ContentLoader type='bullet-list' /></Container>) |
33 | | - .add('custom style', () => <Container><MyLoader /></Container>) |
| 27 | + .add('facebook style', () => ( |
| 28 | + <Container> |
| 29 | + <ContentLoader /> |
| 30 | + </Container> |
| 31 | + )) |
| 32 | + .add('instagram style', () => ( |
| 33 | + <Container> |
| 34 | + <ContentLoader type="instagram" /> |
| 35 | + </Container> |
| 36 | + )) |
| 37 | + .add('code style', () => ( |
| 38 | + <Container> |
| 39 | + <ContentLoader type="code" /> |
| 40 | + </Container> |
| 41 | + )) |
| 42 | + .add('list style', () => ( |
| 43 | + <Container> |
| 44 | + <ContentLoader type="list" /> |
| 45 | + </Container> |
| 46 | + )) |
| 47 | + .add('bullet list style', () => ( |
| 48 | + <Container> |
| 49 | + <ContentLoader type="bullet-list" /> |
| 50 | + </Container> |
| 51 | + )) |
| 52 | + .add('custom style', () => ( |
| 53 | + <Container> |
| 54 | + <MyLoader /> |
| 55 | + </Container> |
| 56 | + )) |
| 57 | + .add('className', () => ( |
| 58 | + <Container> |
| 59 | + <ContentLoader className="random-className" /> |
| 60 | + </Container> |
| 61 | + )) |
| 62 | + .add('width and height', () => ( |
| 63 | + <Container> |
| 64 | + <ContentLoader width={400} height={150} /> |
| 65 | + </Container> |
| 66 | + )) |
0 commit comments