1
1
import React , { Fragment } from 'react' ;
2
- import { boolean , text , withKnobs } from '@storybook/addon-knobs' ;
3
2
import { action } from '@storybook/addon-actions' ;
4
3
5
4
import { Alert , MessageTypes } from 'src/Alert' ;
@@ -14,7 +13,6 @@ import '../../scss/global.scss';
14
13
export default {
15
14
title : 'Components/Alert' ,
16
15
component : Alert ,
17
- decorators : [ withKnobs ] ,
18
16
parameters : {
19
17
docs : {
20
18
page : mdx ,
@@ -25,49 +23,49 @@ export default {
25
23
export const Success = ( ) => (
26
24
< Alert
27
25
id = "1"
28
- message = { text ( 'Message' , ' Success message' ) }
29
- removeBorderLeft = { boolean ( 'removeBorderLeft' , false ) }
30
- title = { text ( 'Title' , ' Success title' ) }
26
+ message = " Success message"
27
+ removeBorderLeft = { false }
28
+ title = " Success title"
31
29
type = { MessageTypes . SUCCESS }
32
30
/>
33
31
) ;
34
32
35
33
export const Info = ( ) => (
36
34
< Alert
37
35
id = "2"
38
- message = { text ( 'Message' , ' Info message' ) }
39
- removeBorderLeft = { boolean ( 'removeBorderLeft' , false ) }
40
- title = { text ( 'Title' , ' Info title' ) }
36
+ message = " Info message"
37
+ removeBorderLeft = { false }
38
+ title = " Info title"
41
39
type = { MessageTypes . INFO }
42
40
/>
43
41
) ;
44
42
45
43
export const Feature = ( ) => (
46
44
< Alert
47
45
id = "3"
48
- message = { text ( 'Message' , ' Some context around new feature if needed.' ) }
49
- removeBorderLeft = { boolean ( 'removeBorderLeft' , false ) }
50
- title = { text ( 'Title' , ' New feature alert!' ) }
46
+ message = " Some context around new feature if needed."
47
+ removeBorderLeft = { false }
48
+ title = " New feature alert!"
51
49
type = { MessageTypes . FEATURE }
52
50
/>
53
51
) ;
54
52
55
53
export const Error = ( ) => (
56
54
< Alert
57
55
id = "4"
58
- message = { text ( 'Message' , ' Error message' ) }
59
- removeBorderLeft = { boolean ( 'removeBorderLeft' , false ) }
60
- title = { text ( 'Title' , ' Error title' ) }
56
+ message = " Error message"
57
+ removeBorderLeft = { false }
58
+ title = " Error title"
61
59
type = { MessageTypes . ERROR }
62
60
/>
63
61
) ;
64
62
65
63
export const Warning = ( ) => (
66
64
< Alert
67
65
id = "5"
68
- message = { text ( 'Message' , ' Warning message' ) }
69
- removeBorderLeft = { boolean ( 'removeBorderLeft' , false ) }
70
- title = { text ( 'Title' , ' Warning title' ) }
66
+ message = " Warning message"
67
+ removeBorderLeft = { false }
68
+ title = " Warning title"
71
69
type = { MessageTypes . WARNING }
72
70
/>
73
71
) ;
@@ -79,9 +77,9 @@ const onDismiss = (id) => {
79
77
export const WithDismiss = ( ) => (
80
78
< Alert
81
79
id = "6"
82
- message = { text ( 'Message' , ' Default message' ) }
83
- removeBorderLeft = { boolean ( 'removeBorderLeft' , false ) }
84
- title = { text ( 'Title' , ' Default title' ) }
80
+ message = " Default message"
81
+ removeBorderLeft = { false }
82
+ title = " Default title"
85
83
type = { MessageTypes . SUCCESS }
86
84
onDismiss = { onDismiss }
87
85
/>
@@ -114,7 +112,7 @@ export const WithCallToAction = () => (
114
112
action = { { content : 'Primary action' , url : 'https://www.userinterviews.com/' } }
115
113
id = "8"
116
114
message = "Success message"
117
- removeBorderLeft = { boolean ( 'removeBorderLeft' , false ) }
115
+ removeBorderLeft = { false }
118
116
title = "Success title"
119
117
type = { MessageTypes . SUCCESS }
120
118
onDismiss = { onDismiss }
@@ -123,7 +121,7 @@ export const WithCallToAction = () => (
123
121
action = { { content : 'Primary action' , url : 'https://www.userinterviews.com/' } }
124
122
id = "9"
125
123
message = "Info message"
126
- removeBorderLeft = { boolean ( 'removeBorderLeft' , false ) }
124
+ removeBorderLeft = { false }
127
125
title = "Info title"
128
126
type = { MessageTypes . INFO }
129
127
onDismiss = { onDismiss }
@@ -132,7 +130,7 @@ export const WithCallToAction = () => (
132
130
action = { { content : 'Primary action' , url : 'https://www.userinterviews.com/' } }
133
131
id = "11"
134
132
message = "Error message"
135
- removeBorderLeft = { boolean ( 'removeBorderLeft' , false ) }
133
+ removeBorderLeft = { false }
136
134
title = "Error title"
137
135
type = { MessageTypes . ERROR }
138
136
onDismiss = { onDismiss }
@@ -141,7 +139,7 @@ export const WithCallToAction = () => (
141
139
action = { { content : 'Primary action' , url : 'https://www.userinterviews.com/' } }
142
140
id = "12"
143
141
message = "Warning message"
144
- removeBorderLeft = { boolean ( 'removeBorderLeft' , false ) }
142
+ removeBorderLeft = { false }
145
143
title = "Warning title"
146
144
type = { MessageTypes . WARNING }
147
145
onDismiss = { onDismiss }
@@ -150,7 +148,7 @@ export const WithCallToAction = () => (
150
148
action = { { content : 'Primary action' , url : 'https://www.userinterviews.com/' } }
151
149
id = "13"
152
150
message = "Some context around new feature if needed"
153
- removeBorderLeft = { boolean ( 'removeBorderLeft' , false ) }
151
+ removeBorderLeft = { false }
154
152
title = "New feature alert!"
155
153
type = { MessageTypes . FEATURE }
156
154
onDismiss = { onDismiss }
@@ -167,8 +165,8 @@ export const WithCallToAction = () => (
167
165
< GoogleCalendarButton />
168
166
</ Fragment >
169
167
) }
170
- removeBorderLeft = { boolean ( 'removeBorderLeft' , false ) }
171
- title = { text ( 'Title' , ' Connect to Google Calendar to create reminders automatically' ) }
168
+ removeBorderLeft = { false }
169
+ title = " Connect to Google Calendar to create reminders automatically"
172
170
type = { MessageTypes . ANNOUNCEMENT }
173
171
onDismiss = { onDismiss }
174
172
/>
@@ -177,10 +175,10 @@ export const WithCallToAction = () => (
177
175
< Alert
178
176
action = { < GoogleCalendarButton /> }
179
177
id = "8"
180
- message = { text ( 'Message' , `When you confirm a session we’ll automatically
181
- add an event and reminders to your Google Calendar.` ) }
182
- removeBorderLeft = { boolean ( 'removeBorderLeft' , false ) }
183
- title = { text ( 'Title' , ' Connect to Google Calendar to create reminders automatically' ) }
178
+ message = { `When you confirm a session we’ll automatically
179
+ add an event and reminders to your Google Calendar.` }
180
+ removeBorderLeft = { false }
181
+ title = " Connect to Google Calendar to create reminders automatically"
184
182
type = { MessageTypes . ANNOUNCEMENT }
185
183
onDismiss = { onDismiss }
186
184
/>
0 commit comments