1
- import React , { Component } from ' react' ;
2
- import { connect } from ' react-redux' ;
3
- import { compose } from ' redux' ;
4
- import { withStyles } from ' @material-ui/core/styles' ;
5
- import TextField from '@material-ui/core/TextField' ;
6
- import IconButton from ' @material-ui/core/IconButton' ;
7
- import ImageIcon from ' @material-ui/icons/Image' ;
8
- import FormIcon from ' @material-ui/icons/Description' ;
9
- import ButtonIcon from ' @material-ui/icons/EditAttributes' ;
10
- import LinkIcon from ' @material-ui/icons/Link' ;
11
- import ListIcon from ' @material-ui/icons/List' ;
12
- import ParagraphIcon from ' @material-ui/icons/LocalParking' ;
13
- import Typography from '@material-ui/core/Typography' ;
14
- import Grid from ' @material-ui/core/Grid' ;
15
- import Paper from '@material-ui/core/Paper' ;
16
- import Tab from ' @material-ui/core/Tab' ;
17
- import Chip from ' @material-ui/core/Chip' ;
18
- import theme from './theme.ts' ;
1
+ import React , { Component } from " react" ;
2
+ import { connect } from " react-redux" ;
3
+ import { compose } from " redux" ;
4
+ import { withStyles } from " @material-ui/core/styles" ;
5
+ // import TextField from '@material-ui/core/TextField';
6
+ import IconButton from " @material-ui/core/IconButton" ;
7
+ import ImageIcon from " @material-ui/icons/Image" ;
8
+ import FormIcon from " @material-ui/icons/Description" ;
9
+ import ButtonIcon from " @material-ui/icons/EditAttributes" ;
10
+ import LinkIcon from " @material-ui/icons/Link" ;
11
+ import ListIcon from " @material-ui/icons/List" ;
12
+ import ParagraphIcon from " @material-ui/icons/LocalParking" ;
13
+ // import Typography from '@material-ui/core/Typography';
14
+ import Grid from " @material-ui/core/Grid" ;
15
+ // import Paper from '@material-ui/core/Paper';
16
+ import Tab from " @material-ui/core/Tab" ;
17
+ import Chip from " @material-ui/core/Chip" ;
18
+ // import theme from './theme.ts';
19
19
20
- class HTMLComponentPanel extends Component {
20
+ interface PropsInt {
21
+ classes : any ;
22
+ addChild : any ;
23
+ }
24
+
25
+ interface StateInt {
26
+ HtmlComponentName : string ;
27
+ }
28
+
29
+ class HTMLComponentPanel extends Component < PropsInt , StateInt > {
21
30
state = {
22
- HtmlComponentName : '' ,
31
+ HtmlComponentName : ""
23
32
} ;
24
33
25
- handleChange = ( event ) => {
34
+ handleChange = event => {
26
35
this . setState ( {
27
- HtmlComponentName : event . target . value ,
36
+ HtmlComponentName : event . target . value
28
37
} ) ;
29
38
} ;
30
39
31
- handleCreateHTMLChild = ( type ) => {
40
+ handleCreateHTMLChild = type => {
32
41
this . props . addChild ( { title : type , childType : type , HTMLInfo : { } } ) ;
33
42
} ;
34
43
@@ -49,16 +58,16 @@ class HTMLComponentPanel extends Component {
49
58
className = "htmlicons"
50
59
aria-label = "Image"
51
60
onClick = { ( ) => {
52
- this . handleCreateHTMLChild ( ' Image' ) ;
61
+ this . handleCreateHTMLChild ( " Image" ) ;
53
62
} }
54
63
style = { {
55
64
margin : 0 ,
56
- padding : 0 ,
65
+ padding : 0
57
66
} }
58
67
>
59
68
< ImageIcon
60
69
style = { {
61
- color : ' #e0e0e0' ,
70
+ color : " #e0e0e0"
62
71
} }
63
72
/>
64
73
</ IconButton >
@@ -67,10 +76,10 @@ class HTMLComponentPanel extends Component {
67
76
className = { classes . chip }
68
77
variant = "outlined"
69
78
style = { {
70
- color : ' white' ,
71
- fontSize : ' 80%' ,
79
+ color : " white" ,
80
+ fontSize : " 80%" ,
72
81
margin : 0 ,
73
- padding : 0 ,
82
+ padding : 0
74
83
} }
75
84
onClick = { ( ) => {
76
85
this . handleCreateHTMLChild ( 'Image' ) ;
@@ -83,22 +92,22 @@ class HTMLComponentPanel extends Component {
83
92
className = "htmlicons"
84
93
aria-label = "Form"
85
94
onClick = { ( ) => {
86
- this . handleCreateHTMLChild ( ' Form' ) ;
95
+ this . handleCreateHTMLChild ( " Form" ) ;
87
96
} }
88
97
style = { {
89
98
margin : 0 ,
90
- padding : 0 ,
99
+ padding : 0
91
100
} }
92
101
>
93
- < FormIcon style = { { color : ' #e0e0e0' } } />
102
+ < FormIcon style = { { color : " #e0e0e0" } } />
94
103
</ IconButton >
95
104
< Chip
96
105
label = "Form"
97
106
className = { classes . chip }
98
107
variant = "outlined"
99
108
style = { {
100
- color : ' white' ,
101
- fontSize : ' 80%' ,
109
+ color : " white" ,
110
+ fontSize : " 80%"
102
111
} }
103
112
onClick = { ( ) => {
104
113
this . handleCreateHTMLChild ( 'Form' ) ;
@@ -110,22 +119,22 @@ class HTMLComponentPanel extends Component {
110
119
className = "htmlicons"
111
120
aria-label = "Button"
112
121
onClick = { ( ) => {
113
- this . handleCreateHTMLChild ( ' Button' ) ;
122
+ this . handleCreateHTMLChild ( " Button" ) ;
114
123
} }
115
124
style = { {
116
125
margin : 0 ,
117
- padding : 0 ,
126
+ padding : 0
118
127
} }
119
128
>
120
- < ButtonIcon style = { { color : ' #e0e0e0' } } />
129
+ < ButtonIcon style = { { color : " #e0e0e0" } } />
121
130
</ IconButton >
122
131
< Chip
123
132
label = "Button"
124
133
className = { classes . chip }
125
134
variant = "outlined"
126
135
style = { {
127
- color : ' white' ,
128
- fontSize : ' 80%' ,
136
+ color : " white" ,
137
+ fontSize : " 80%"
129
138
} }
130
139
onClick = { ( ) => {
131
140
this . handleCreateHTMLChild ( 'Button' ) ;
@@ -137,22 +146,22 @@ class HTMLComponentPanel extends Component {
137
146
className = "htmlicons"
138
147
aria-label = "Link"
139
148
onClick = { ( ) => {
140
- this . handleCreateHTMLChild ( ' Link' ) ;
149
+ this . handleCreateHTMLChild ( " Link" ) ;
141
150
} }
142
151
style = { {
143
152
margin : 0 ,
144
- padding : 0 ,
153
+ padding : 0
145
154
} }
146
155
>
147
- < LinkIcon style = { { color : ' #e0e0e0' } } />
156
+ < LinkIcon style = { { color : " #e0e0e0" } } />
148
157
</ IconButton >
149
158
< Chip
150
159
label = "Link"
151
160
className = { classes . chip }
152
161
variant = "outlined"
153
162
style = { {
154
- color : ' white' ,
155
- fontSize : ' 80%' ,
163
+ color : " white" ,
164
+ fontSize : " 80%"
156
165
} }
157
166
onClick = { ( ) => {
158
167
this . handleCreateHTMLChild ( 'Link' ) ;
@@ -164,22 +173,22 @@ class HTMLComponentPanel extends Component {
164
173
className = "htmlicons"
165
174
aria-label = "List"
166
175
onClick = { ( ) => {
167
- this . handleCreateHTMLChild ( ' List' ) ;
176
+ this . handleCreateHTMLChild ( " List" ) ;
168
177
} }
169
178
style = { {
170
179
margin : 0 ,
171
- padding : 0 ,
180
+ padding : 0
172
181
} }
173
182
>
174
- < ListIcon style = { { color : ' #e0e0e0' } } />
183
+ < ListIcon style = { { color : " #e0e0e0" } } />
175
184
</ IconButton >
176
185
< Chip
177
186
label = "List"
178
187
className = { classes . chip }
179
188
variant = "outlined"
180
189
style = { {
181
- color : ' white' ,
182
- fontSize : ' 80%' ,
190
+ color : " white" ,
191
+ fontSize : " 80%"
183
192
} }
184
193
onClick = { ( ) => {
185
194
this . handleCreateHTMLChild ( 'List' ) ;
@@ -191,33 +200,37 @@ class HTMLComponentPanel extends Component {
191
200
xs = { 4 }
192
201
style = { {
193
202
margin : 0 ,
194
- padding : 0 ,
203
+ padding : 0
195
204
} }
196
205
>
197
206
< IconButton
198
207
className = "htmlicons"
199
208
aria-label = "Paragraph"
200
209
onClick = { ( ) => {
201
- this . handleCreateHTMLChild ( ' Paragraph' ) ;
210
+ this . handleCreateHTMLChild ( " Paragraph" ) ;
202
211
} }
203
212
style = { {
204
213
margin : 0 ,
205
- padding : 0 ,
214
+ padding : 0
206
215
} }
207
216
>
208
217
< ParagraphIcon
209
- style = { { color : '#e0e0e0' , paddingRight : '0px' , marginRight : '0px' } }
218
+ style = { {
219
+ color : "#e0e0e0" ,
220
+ paddingRight : "0px" ,
221
+ marginRight : "0px"
222
+ } }
210
223
/>
211
224
</ IconButton >
212
225
< Chip
213
226
label = "Paragraph"
214
227
className = { classes . chip }
215
228
variant = "outlined"
216
229
style = { {
217
- color : ' white' ,
218
- fontSize : ' 62%' ,
219
- padding : ' 0px' ,
220
- margin : ' 0px' ,
230
+ color : " white" ,
231
+ fontSize : " 62%" ,
232
+ padding : " 0px" ,
233
+ margin : " 0px"
221
234
} }
222
235
onClick = { ( ) => {
223
236
this . handleCreateHTMLChild ( 'Paragraph' ) ;
@@ -230,40 +243,40 @@ class HTMLComponentPanel extends Component {
230
243
}
231
244
}
232
245
233
- function styles ( theme ) {
246
+ function styles ( theme ) : any {
234
247
return {
235
248
htmlPanel : {
236
- width : ' 100%' ,
237
- height : ' 30%' ,
238
- backgroundColor : ' #212121' ,
239
- borderStyle : ' solid' ,
240
- borderWidth : ' 0.5px' ,
241
- borderRadius : ' 1px' ,
242
- borderColor : ' #424242' ,
243
- bottom : ' 0px' ,
244
- paddingLeft : ' 10px' ,
245
- paddingRight : ' 10px' ,
246
- paddingBottom : ' 25px' ,
247
- paddingTop : ' 2px' ,
248
- boxShadow : ' 0 6px 6px rgba(0,0,0,0.23)' ,
249
+ width : " 100%" ,
250
+ height : " 30%" ,
251
+ backgroundColor : " #212121" ,
252
+ borderStyle : " solid" ,
253
+ borderWidth : " 0.5px" ,
254
+ borderRadius : " 1px" ,
255
+ borderColor : " #424242" ,
256
+ bottom : " 0px" ,
257
+ paddingLeft : " 10px" ,
258
+ paddingRight : " 10px" ,
259
+ paddingBottom : " 25px" ,
260
+ paddingTop : " 2px" ,
261
+ boxShadow : " 0 6px 6px rgba(0,0,0,0.23)"
249
262
// paddingBottom: "10px"
250
263
} ,
251
264
chip : {
252
- color : ' rgba(193, 66, 66, 0)' ,
265
+ color : " rgba(193, 66, 66, 0)"
253
266
} ,
254
267
htmliconwrapper : {
255
- verticalAlign : ' baseline' ,
268
+ verticalAlign : " baseline"
256
269
} ,
257
270
htmlicons : {
258
- color : ' #ffffff' ,
271
+ color : " #ffffff"
259
272
} ,
260
273
tabRoot : {
261
- textTransform : ' initial' ,
274
+ textTransform : " initial" ,
262
275
minWidth : 100 ,
263
276
fontWeight : theme . typography . fontWeightRegular ,
264
277
// marginRight: theme.spacing.unit * 4,
265
- color : ' #ffffff' ,
266
- } ,
278
+ color : " #ffffff"
279
+ }
267
280
} ;
268
281
}
269
282
0 commit comments