aboutsummaryrefslogtreecommitdiffstats
path: root/uidev
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2019-06-07 11:25:54 +0200
committerLibravatar Stefan Malzner <stefan@adlk.io>2019-06-07 11:25:54 +0200
commit9f2ab40b7602bc3df26ebb093b484b9917768f69 (patch)
treed00f2833c695cfe5e504fcc87578fe392f396585 /uidev
parentMerge pull request #1473 from meetfranz/fix/reset-news-on-logout (diff)
downloadferdium-app-9f2ab40b7602bc3df26ebb093b484b9917768f69.tar.gz
ferdium-app-9f2ab40b7602bc3df26ebb093b484b9917768f69.tar.zst
ferdium-app-9f2ab40b7602bc3df26ebb093b484b9917768f69.zip
Make buttons flexible in height
Diffstat (limited to 'uidev')
-rw-r--r--uidev/src/app.tsx2
-rw-r--r--uidev/src/stories/button.stories.tsx40
2 files changed, 39 insertions, 3 deletions
diff --git a/uidev/src/app.tsx b/uidev/src/app.tsx
index 870911c2f..cef22e7a7 100644
--- a/uidev/src/app.tsx
+++ b/uidev/src/app.tsx
@@ -2,7 +2,7 @@ import CSS from 'csstype';
2import { Classes } from 'jss'; 2import { Classes } from 'jss';
3import { observer } from 'mobx-react'; 3import { observer } from 'mobx-react';
4import DevTools from 'mobx-react-devtools'; 4import DevTools from 'mobx-react-devtools';
5import React, { Component } from 'react'; 5import React from 'react';
6import injectSheet from 'react-jss'; 6import injectSheet from 'react-jss';
7 7
8import { WithTheme } from './withTheme'; 8import { WithTheme } from './withTheme';
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 @@
1import { observable } from 'mobx'; 1import { observable } from 'mobx';
2import { observer } from 'mobx-react'; 2import { observer } from 'mobx-react';
3import React from 'react'; 3import React from 'react';
4import injectSheet from 'react-jss';
4 5
5import { Button } from '@meetfranz/forms'; 6import { Button, Input } from '@meetfranz/forms';
7import { classes } from 'istanbul-lib-coverage';
8import { Classes } from 'jss';
6import { storiesOf } from '../stores/stories'; 9import { storiesOf } from '../stores/stories';
7 10
8const defaultProps = { 11const defaultProps = {
@@ -13,6 +16,17 @@ const defaultProps = {
13 disabled: false, 16 disabled: false,
14}; 17};
15 18
19const styles = {
20 combinedElements: {
21 display: 'flex',
22 justifyContent: 'space-between',
23 },
24 input: {
25 flex: 1,
26 marginRight: 20,
27 },
28};
29
16const createStore = (args?: any) => { 30const 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 ));