diff options
author | Stefan Malzner <stefan@adlk.io> | 2019-03-18 03:28:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-18 03:28:03 -0700 |
commit | 6134c1b49f919dd2c578bc490829d68e4d210f4e (patch) | |
tree | 1ad6530fbb7f19e4e9c9a235c6b44e0dfdbc47d4 /uidev/src/stories/infobox.stories.tsx | |
parent | Add missing bracket in brew install help (#1205) (diff) | |
download | ferdium-app-6134c1b49f919dd2c578bc490829d68e4d210f4e.tar.gz ferdium-app-6134c1b49f919dd2c578bc490829d68e4d210f4e.tar.zst ferdium-app-6134c1b49f919dd2c578bc490829d68e4d210f4e.zip |
Release/5.0.1 beta.1 (#1344)
* Add lerna
* Add theme
* Add forms
* Add misty config to build theme & forms
* reset packages version
* Publish
- @meetfranz/forms@1.0.0
- @meetfranz/theme@1.0.0
* Reset package version
* restructure packages
* try ci with lerna
* Fix missing packages in build
* move storybook to root + typescript
TODO: fix modules
* Add lerna instructions
* Merge
* wip
* Make packages work in electron, node and web
* Finalize packages & replace storybook with homegrown `uidev`
* Bring package-lock back in sync
* Publish
- @meetfranz/forms@1.0.1
- @meetfranz/theme@1.0.1
* fix webpack issue
* expose legacy styles
* Add toggle element to @meetfranz/forms
* start typings package
* Update package.json
* Add buttons
* Update theme
* add types
* Add mdi icons to buttons
* Publish
- @meetfranz/forms@1.0.2
- @meetfranz/theme@1.0.2
- @meetfranz/typings@0.0.1
* Button, add missing success state
* Update lerna packages
* Try to disable automatic npm ci
* Try to get a working bundle
* Add href and type to button component
* Update packages
* update versions
* cleanup
* Update package versions
[ci skip]
* Update versions
* Add withTheme context to button
* Update & reuse electron-rebuild
* feat(Windows): Add option to quit Franz from Taskbar icon
* Add missing withTheme
* Fix package versions
* Update versions
* Add pageview event
* Simplify analytics calls
* Pin gulp-sass-variables to 1.1.1
* Add onFocus event
* Add modal overlay color
* remove legacy theme files
* remove code
* Add dialog to share franz on social media
* Fix service count
* remove ping
* replace ms time strings with ms module
* remove unused packages
* fix value setter
* new payment flow
* fix module reference
* feat(Spell check): Add en-gb spell check languages (#1306)
* move devmode info
* fix(Windows): Fix losing window when "Keep Franz in background" is enabled
* fix(Service): Fix service zoom (cmd/ctrl+ & cmd/ctrl-)
* fixes appveyor build issue
* feat(App): Update electron to 4.0.7
* ignore intellij idea project files
* Automatic i18n update (i18n.meetfranz.com)
* feat(App): Add security checks for external URLs
* setup react-intl translations managing script
* use same zooming logic for all os
* feat(Linux): Add auto updater for Linux AppImage builds
* Add ctrl+ for zoom in on Windows
* move translation scripts into src/i18n folder
* only manage en-US translations
* manage translations before git pushes
* Fix unused i18n strings
* Bump version to 5.0.1-beta.1
* fix(Service) shortcuts for activating prev/next service fixes #1298
* fix(Service): Fix shortcut for (un)muting notifications & audio
* add missing react-intl files
* correctly update services submenu on language change
* fix(Windows): Fix copy & paste in service context menus
Closes #1316
* fix(Linux): Fix minimized window focusing (#1304) (@skoruppa)
* trigger build
* Check if window is minimized before restoring it
* restore() should be executed only when window is minimized
* fix(Notifications): Fix notifications & notification click when icon is blob
* Fix/service webview unmounting (#1328)
* detach service when underlying webview unmounts
* disable no-param-reassign eslint rule
* Add notification debug events
* Update electron to 4.0.8
Update required in order to fix performance degradation due to memory leak issue https://github.com/electron/electron/pull/16772.
* Automatic i18n update (i18n.meetfranz.com)
* Automatic i18n update (i18n.meetfranz.com)
* 5.0.1-beta.1
Diffstat (limited to 'uidev/src/stories/infobox.stories.tsx')
-rw-r--r-- | uidev/src/stories/infobox.stories.tsx | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/uidev/src/stories/infobox.stories.tsx b/uidev/src/stories/infobox.stories.tsx new file mode 100644 index 000000000..2a5e8b0d5 --- /dev/null +++ b/uidev/src/stories/infobox.stories.tsx | |||
@@ -0,0 +1,126 @@ | |||
1 | import { observable } from 'mobx'; | ||
2 | import { observer } from 'mobx-react'; | ||
3 | import React from 'react'; | ||
4 | |||
5 | import { Infobox } from '@meetfranz/ui'; | ||
6 | import { storiesOf } from '../stores/stories'; | ||
7 | |||
8 | interface IStoreArgs { | ||
9 | icon?: string; | ||
10 | ctaLabel?: string; | ||
11 | type?: string; | ||
12 | dismissable?: boolean; | ||
13 | } | ||
14 | |||
15 | const createStore = (args?: IStoreArgs) => { | ||
16 | return observable(Object.assign({ | ||
17 | type: 'primary', | ||
18 | ctaOnClick: () => { | ||
19 | alert('on click handler'); | ||
20 | }, | ||
21 | }, args)); | ||
22 | }; | ||
23 | |||
24 | const WithStoreInfobox = observer(({ store, children }: { store: any, children: string | React.ReactNode }) => ( | ||
25 | <> | ||
26 | <Infobox | ||
27 | icon={store.icon} | ||
28 | ctaLabel={store.ctaLabel} | ||
29 | type={store.type} | ||
30 | ctaOnClick={store.ctaOnClick} | ||
31 | dismissable={store.dismissable} | ||
32 | > | ||
33 | {children} | ||
34 | </Infobox> | ||
35 | </> | ||
36 | )); | ||
37 | |||
38 | storiesOf('Infobox') | ||
39 | .add('Basic', () => ( | ||
40 | <WithStoreInfobox store={createStore()}>Welcome to the world of tomorrow</WithStoreInfobox> | ||
41 | )) | ||
42 | .add('Icon + Dismissable', () => ( | ||
43 | <WithStoreInfobox | ||
44 | store={createStore({ | ||
45 | icon: 'mdiEarth', | ||
46 | dismissable: true, | ||
47 | })} | ||
48 | > | ||
49 | Welcome to the world of tomorrow | ||
50 | </WithStoreInfobox> | ||
51 | )) | ||
52 | .add('With CTA', () => ( | ||
53 | <WithStoreInfobox | ||
54 | store={createStore({ | ||
55 | icon: 'mdiEarth', | ||
56 | ctaLabel: 'Ok, hi!', | ||
57 | })} | ||
58 | > | ||
59 | Welcome to the world of tomorrow | ||
60 | </WithStoreInfobox> | ||
61 | )) | ||
62 | .add('With long text', () => ( | ||
63 | <WithStoreInfobox | ||
64 | store={createStore({ | ||
65 | icon: 'mdiEarth', | ||
66 | ctaLabel: 'Ok, hi!', | ||
67 | })} | ||
68 | > | ||
69 | Franz is your messaging app / former Emperor of Austria and combines chat & messaging services into one application. Franz currently supports Slack, WhatsApp, WeChat, HipChat, Facebook Messenger, Telegram, Google Hangouts,GroupMe, Skype and many more. | ||
70 | </WithStoreInfobox> | ||
71 | )) | ||
72 | .add('Secondary', () => ( | ||
73 | <WithStoreInfobox | ||
74 | store={createStore({ | ||
75 | icon: 'mdiEarth', | ||
76 | ctaLabel: 'Ok, hi!', | ||
77 | type: 'secondary', | ||
78 | })} | ||
79 | > | ||
80 | Welcome to the world of tomorrow | ||
81 | </WithStoreInfobox> | ||
82 | )) | ||
83 | .add('Success', () => ( | ||
84 | <WithStoreInfobox | ||
85 | store={createStore({ | ||
86 | icon: 'mdiEarth', | ||
87 | ctaLabel: 'Ok, hi!', | ||
88 | type: 'success', | ||
89 | })} | ||
90 | > | ||
91 | Welcome to the world of tomorrow | ||
92 | </WithStoreInfobox> | ||
93 | )) | ||
94 | .add('Warning', () => ( | ||
95 | <WithStoreInfobox | ||
96 | store={createStore({ | ||
97 | icon: 'mdiEarth', | ||
98 | ctaLabel: 'Ok, hi!', | ||
99 | type: 'warning', | ||
100 | })} | ||
101 | > | ||
102 | Welcome to the world of tomorrow | ||
103 | </WithStoreInfobox> | ||
104 | )) | ||
105 | .add('Danger', () => ( | ||
106 | <WithStoreInfobox | ||
107 | store={createStore({ | ||
108 | icon: 'mdiEarth', | ||
109 | ctaLabel: 'Ok, hi!', | ||
110 | type: 'danger', | ||
111 | })} | ||
112 | > | ||
113 | Welcome to the world of tomorrow | ||
114 | </WithStoreInfobox> | ||
115 | )) | ||
116 | .add('Inverted', () => ( | ||
117 | <WithStoreInfobox | ||
118 | store={createStore({ | ||
119 | icon: 'mdiEarth', | ||
120 | ctaLabel: 'Ok, hi!', | ||
121 | type: 'inverted', | ||
122 | })} | ||
123 | > | ||
124 | Welcome to the world of tomorrow | ||
125 | </WithStoreInfobox> | ||
126 | )); | ||