diff options
author | 2019-07-01 13:39:55 +0700 | |
---|---|---|
committer | 2019-07-01 13:39:55 +0700 | |
commit | b43b265e8d383eb9b6f0a31f096f52ad9f7171c2 (patch) | |
tree | 6b258426b849520ae29d92a44fe2aa7c608ad80b /uidev/src/stories/button.stories.tsx | |
parent | Add features list to README (diff) | |
parent | Revert: fix spellchecker (diff) | |
download | ferdium-app-b43b265e8d383eb9b6f0a31f096f52ad9f7171c2.tar.gz ferdium-app-b43b265e8d383eb9b6f0a31f096f52ad9f7171c2.tar.zst ferdium-app-b43b265e8d383eb9b6f0a31f096f52ad9f7171c2.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'uidev/src/stories/button.stories.tsx')
-rw-r--r-- | uidev/src/stories/button.stories.tsx | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/uidev/src/stories/button.stories.tsx b/uidev/src/stories/button.stories.tsx index c8e9bcbf3..f7537895c 100644 --- a/uidev/src/stories/button.stories.tsx +++ b/uidev/src/stories/button.stories.tsx | |||
@@ -1,8 +1,11 @@ | |||
1 | import { observable } from 'mobx'; | 1 | import { observable } from 'mobx'; |
2 | import { observer } from 'mobx-react'; | 2 | import { observer } from 'mobx-react'; |
3 | import React from 'react'; | 3 | import React from 'react'; |
4 | import injectSheet from 'react-jss'; | ||
4 | 5 | ||
5 | import { Button } from '@meetfranz/forms'; | 6 | import { Button, Input } from '@meetfranz/forms'; |
7 | import { classes } from 'istanbul-lib-coverage'; | ||
8 | import { Classes } from 'jss'; | ||
6 | import { storiesOf } from '../stores/stories'; | 9 | import { storiesOf } from '../stores/stories'; |
7 | 10 | ||
8 | const defaultProps = { | 11 | const defaultProps = { |
@@ -13,6 +16,17 @@ const defaultProps = { | |||
13 | disabled: false, | 16 | disabled: false, |
14 | }; | 17 | }; |
15 | 18 | ||
19 | const styles = { | ||
20 | combinedElements: { | ||
21 | display: 'flex', | ||
22 | justifyContent: 'space-between', | ||
23 | }, | ||
24 | input: { | ||
25 | flex: 1, | ||
26 | marginRight: 20, | ||
27 | }, | ||
28 | }; | ||
29 | |||
16 | const createStore = (args?: any) => { | 30 | const createStore = (args?: any) => { |
17 | return observable(Object.assign({}, defaultProps, args)); | 31 | return observable(Object.assign({}, defaultProps, args)); |
18 | }; | 32 | }; |
@@ -99,4 +113,26 @@ storiesOf('Button') | |||
99 | e.preventDefault(); | 113 | e.preventDefault(); |
100 | alert('Click event'); | 114 | alert('Click event'); |
101 | }, | 115 | }, |
102 | })} />)); | 116 | })}/> |
117 | )) | ||
118 | .add('Long multi-line button', () => ( | ||
119 | <WithStoreButton store={createStore({ | ||
120 | label: 'But there is something that I must say to my people, who stand on the warm threshold which leads into the palace of justice: In the process of gaining our rightful place, we must not be guilty of wrongful deeds. Let us not seek to satisfy our thirst for freedom by drinking from the cup of bitterness and hatred. We must forever conduct our struggle on the high plane of dignity and discipline. We must not allow our creative protest to degenerate into physical violence. Again and again, we must rise to the majestic heights of meeting physical force with soul force.', | ||
121 | })} /> | ||
122 | )) | ||
123 | .add('Button with Input', injectSheet(styles)(observer(({ classes }: { classes: Classes }) => ( | ||
124 | <div className={classes.combinedElements}> | ||
125 | <Input showLabel={false} className={classes.input} noMargin /> | ||
126 | <WithStoreButton store={createStore({})} /> | ||
127 | </div> | ||
128 | )), | ||
129 | )) | ||
130 | .add('Icon Button with Input', injectSheet(styles)(observer(({ classes }: { classes: Classes }) => ( | ||
131 | <div className={classes.combinedElements}> | ||
132 | <Input showLabel={false} className={classes.input} noMargin /> | ||
133 | <WithStoreButton store={createStore({ | ||
134 | icon: 'mdiInformation', | ||
135 | })} /> | ||
136 | </div> | ||
137 | )), | ||
138 | )); | ||