Skip to content

Commit a91bd85

Browse files
committed
Added examples
1 parent 48ad440 commit a91bd85

File tree

5 files changed

+69
-47
lines changed

5 files changed

+69
-47
lines changed

docs/client/components/ComponentsPage/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,26 @@ import React from 'react';
33
import CardReadme from '../../../../src/card/readMe.md';
44
import ButtonReadme from '../../../../src/button/readMe.md';
55

6+
import CardExample from '../../../../src/examples/card.js';
7+
import ButtonExample from '../../../../src/examples/button.js';
8+
69
import styles from './styles.scss';
710

11+
const renderHowItLooks = (ExampleComponent) => (
12+
<div>
13+
<h3>How it looks</h3>
14+
<div>
15+
<ExampleComponent />
16+
</div>
17+
</div>
18+
);
19+
820
const ComponentsPage = () => (
921
<div className={styles.usage}>
1022
<div dangerouslySetInnerHTML={{ __html: CardReadme }} />
23+
{ renderHowItLooks(CardExample) }
1124
<div dangerouslySetInnerHTML={{ __html: ButtonReadme }} />
25+
{ renderHowItLooks(ButtonExample) }
1226
<div style={{ height: '300px' }} />
1327
</div>
1428
);

src/customcard.scss

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/examples/button.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import React from 'react';
2+
import Button from './../button'; // eslint-disable-line
3+
4+
const ButtonExample = () => (
5+
<div>
6+
<div>
7+
<h4>Buttons with diffent styles</h4>
8+
<Button>Default</Button>
9+
<Button type="primary">Primary</Button>
10+
<Button type="secondary">Secondary</Button>
11+
<Button type="success">Success</Button>
12+
<Button type="danger">Danger</Button>
13+
<Button type="warning">Warning</Button>
14+
<Button type="info">Info</Button>
15+
<Button type="light">Light</Button>
16+
<Button type="dark">Dark</Button>
17+
</div>
18+
19+
<div>
20+
<h4>Buttons with diffent sizes</h4>
21+
<Button type="primary" size="small">Small</Button>
22+
<Button type="primary" size="medium">Medium</Button>
23+
<Button type="primary" size="large">Large</Button>
24+
</div>
25+
26+
<div>
27+
<h4>Buttons with Icon</h4>
28+
<Button type="success" icon="done">Left Icon</Button>
29+
<Button type="success" icon="done" iconAlignment="right">Right Icon</Button>
30+
</div>
31+
</div>
32+
);
33+
34+
export default ButtonExample;

src/examples/card.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from 'react';
2+
3+
import Card from './../card';
4+
5+
const CardExample = () => (
6+
<div>
7+
<Card
8+
header="Card String header"
9+
wrapContent
10+
>
11+
<div>Hello world!</div>
12+
<div>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</div>
13+
</Card>
14+
</div>
15+
);
16+
17+
export default CardExample;

src/index.js

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,13 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import Card from './card';
4-
import customTheme from './customcard.scss';
53

6-
import Button from './button'; // eslint-disable-line
4+
import CardExample from './examples/card';
5+
import ButtonExample from './examples/button';
76

87
const Index = () => (
98
<div>
10-
<Card
11-
header="Card String header"
12-
wrapContent
13-
theme={customTheme}
14-
>
15-
<span>Card Content</span>
16-
<span>Card Content</span>
17-
<span>Card Content</span>
18-
</Card>
19-
20-
<div style={{ margin: '20px' }}>
21-
<div>
22-
<h4>Buttons with diffent styles</h4>
23-
<Button>Default</Button>
24-
<Button type="primary">Primary</Button>
25-
<Button type="secondary">Secondary</Button>
26-
<Button type="success">Success</Button>
27-
<Button type="danger">Danger</Button>
28-
<Button type="warning">Warning</Button>
29-
<Button type="info">Info</Button>
30-
<Button type="light">Light</Button>
31-
<Button type="dark">Dark</Button>
32-
</div>
33-
34-
<div>
35-
<h4>Buttons with diffent sizes</h4>
36-
<Button type="primary" size="small">Small</Button>
37-
<Button type="primary" size="medium">Medium</Button>
38-
<Button type="primary" size="large">Large</Button>
39-
</div>
40-
41-
<div>
42-
<h4>Buttons with Icon</h4>
43-
<Button type="success" icon="done">Left Icon</Button>
44-
<Button type="success" icon="done" iconAlignment="right">Right Icon</Button>
45-
</div>
46-
</div>
9+
<CardExample />
10+
<ButtonExample />
4711
</div>
4812
);
4913

0 commit comments

Comments
 (0)