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
@@ -48,16 +57,16 @@ class HTMLComponentPanel extends Component {
48
57
className = "htmlicons"
49
58
aria-label = "Image"
50
59
onClick = { ( ) => {
51
- this . handleCreateHTMLChild ( ' Image' ) ;
60
+ this . handleCreateHTMLChild ( " Image" ) ;
52
61
} }
53
62
style = { {
54
63
margin : 0 ,
55
- padding : 0 ,
64
+ padding : 0
56
65
} }
57
66
>
58
67
< ImageIcon
59
68
style = { {
60
- color : ' #e0e0e0' ,
69
+ color : " #e0e0e0"
61
70
} }
62
71
/>
63
72
</ IconButton >
@@ -66,10 +75,10 @@ class HTMLComponentPanel extends Component {
66
75
className = { classes . chip }
67
76
variant = "outlined"
68
77
style = { {
69
- color : ' white' ,
70
- fontSize : ' 80%' ,
78
+ color : " white" ,
79
+ fontSize : " 80%" ,
71
80
margin : 0 ,
72
- padding : 0 ,
81
+ padding : 0
73
82
} }
74
83
/>
75
84
</ div >
@@ -79,22 +88,22 @@ class HTMLComponentPanel extends Component {
79
88
className = "htmlicons"
80
89
aria-label = "Form"
81
90
onClick = { ( ) => {
82
- this . handleCreateHTMLChild ( ' Form' ) ;
91
+ this . handleCreateHTMLChild ( " Form" ) ;
83
92
} }
84
93
style = { {
85
94
margin : 0 ,
86
- padding : 0 ,
95
+ padding : 0
87
96
} }
88
97
>
89
- < FormIcon style = { { color : ' #e0e0e0' } } />
98
+ < FormIcon style = { { color : " #e0e0e0" } } />
90
99
</ IconButton >
91
100
< Chip
92
101
label = "Form"
93
102
className = { classes . chip }
94
103
variant = "outlined"
95
104
style = { {
96
- color : ' white' ,
97
- fontSize : ' 80%' ,
105
+ color : " white" ,
106
+ fontSize : " 80%"
98
107
} }
99
108
/>
100
109
</ Grid >
@@ -103,22 +112,22 @@ class HTMLComponentPanel extends Component {
103
112
className = "htmlicons"
104
113
aria-label = "Button"
105
114
onClick = { ( ) => {
106
- this . handleCreateHTMLChild ( ' Button' ) ;
115
+ this . handleCreateHTMLChild ( " Button" ) ;
107
116
} }
108
117
style = { {
109
118
margin : 0 ,
110
- padding : 0 ,
119
+ padding : 0
111
120
} }
112
121
>
113
- < ButtonIcon style = { { color : ' #e0e0e0' } } />
122
+ < ButtonIcon style = { { color : " #e0e0e0" } } />
114
123
</ IconButton >
115
124
< Chip
116
125
label = "Button"
117
126
className = { classes . chip }
118
127
variant = "outlined"
119
128
style = { {
120
- color : ' white' ,
121
- fontSize : ' 80%' ,
129
+ color : " white" ,
130
+ fontSize : " 80%"
122
131
} }
123
132
/>
124
133
</ Grid >
@@ -127,22 +136,22 @@ class HTMLComponentPanel extends Component {
127
136
className = "htmlicons"
128
137
aria-label = "Link"
129
138
onClick = { ( ) => {
130
- this . handleCreateHTMLChild ( ' Link' ) ;
139
+ this . handleCreateHTMLChild ( " Link" ) ;
131
140
} }
132
141
style = { {
133
142
margin : 0 ,
134
- padding : 0 ,
143
+ padding : 0
135
144
} }
136
145
>
137
- < LinkIcon style = { { color : ' #e0e0e0' } } />
146
+ < LinkIcon style = { { color : " #e0e0e0" } } />
138
147
</ IconButton >
139
148
< Chip
140
149
label = "Link"
141
150
className = { classes . chip }
142
151
variant = "outlined"
143
152
style = { {
144
- color : ' white' ,
145
- fontSize : ' 80%' ,
153
+ color : " white" ,
154
+ fontSize : " 80%"
146
155
} }
147
156
/>
148
157
</ Grid >
@@ -151,22 +160,22 @@ class HTMLComponentPanel extends Component {
151
160
className = "htmlicons"
152
161
aria-label = "List"
153
162
onClick = { ( ) => {
154
- this . handleCreateHTMLChild ( ' List' ) ;
163
+ this . handleCreateHTMLChild ( " List" ) ;
155
164
} }
156
165
style = { {
157
166
margin : 0 ,
158
- padding : 0 ,
167
+ padding : 0
159
168
} }
160
169
>
161
- < ListIcon style = { { color : ' #e0e0e0' } } />
170
+ < ListIcon style = { { color : " #e0e0e0" } } />
162
171
</ IconButton >
163
172
< Chip
164
173
label = "List"
165
174
className = { classes . chip }
166
175
variant = "outlined"
167
176
style = { {
168
- color : ' white' ,
169
- fontSize : ' 80%' ,
177
+ color : " white" ,
178
+ fontSize : " 80%"
170
179
} }
171
180
/>
172
181
</ Grid >
@@ -175,33 +184,37 @@ class HTMLComponentPanel extends Component {
175
184
xs = { 4 }
176
185
style = { {
177
186
margin : 0 ,
178
- padding : 0 ,
187
+ padding : 0
179
188
} }
180
189
>
181
190
< IconButton
182
191
className = "htmlicons"
183
192
aria-label = "Paragraph"
184
193
onClick = { ( ) => {
185
- this . handleCreateHTMLChild ( ' Paragraph' ) ;
194
+ this . handleCreateHTMLChild ( " Paragraph" ) ;
186
195
} }
187
196
style = { {
188
197
margin : 0 ,
189
- padding : 0 ,
198
+ padding : 0
190
199
} }
191
200
>
192
201
< ParagraphIcon
193
- style = { { color : '#e0e0e0' , paddingRight : '0px' , marginRight : '0px' } }
202
+ style = { {
203
+ color : "#e0e0e0" ,
204
+ paddingRight : "0px" ,
205
+ marginRight : "0px"
206
+ } }
194
207
/>
195
208
</ IconButton >
196
209
< Chip
197
210
label = "Paragraph"
198
211
className = { classes . chip }
199
212
variant = "outlined"
200
213
style = { {
201
- color : ' white' ,
202
- fontSize : ' 62%' ,
203
- padding : ' 0px' ,
204
- margin : ' 0px' ,
214
+ color : " white" ,
215
+ fontSize : " 62%" ,
216
+ padding : " 0px" ,
217
+ margin : " 0px"
205
218
} }
206
219
/>
207
220
</ Grid >
@@ -211,40 +224,40 @@ class HTMLComponentPanel extends Component {
211
224
}
212
225
}
213
226
214
- function styles ( theme ) {
227
+ function styles ( theme ) : any {
215
228
return {
216
229
htmlPanel : {
217
- width : ' 100%' ,
218
- height : ' 30%' ,
219
- backgroundColor : ' #212121' ,
220
- borderStyle : ' solid' ,
221
- borderWidth : ' 0.5px' ,
222
- borderRadius : ' 1px' ,
223
- borderColor : ' #424242' ,
224
- bottom : ' 0px' ,
225
- paddingLeft : ' 10px' ,
226
- paddingRight : ' 10px' ,
227
- paddingBottom : ' 25px' ,
228
- paddingTop : ' 2px' ,
229
- boxShadow : ' 0 6px 6px rgba(0,0,0,0.23)' ,
230
+ width : " 100%" ,
231
+ height : " 30%" ,
232
+ backgroundColor : " #212121" ,
233
+ borderStyle : " solid" ,
234
+ borderWidth : " 0.5px" ,
235
+ borderRadius : " 1px" ,
236
+ borderColor : " #424242" ,
237
+ bottom : " 0px" ,
238
+ paddingLeft : " 10px" ,
239
+ paddingRight : " 10px" ,
240
+ paddingBottom : " 25px" ,
241
+ paddingTop : " 2px" ,
242
+ boxShadow : " 0 6px 6px rgba(0,0,0,0.23)"
230
243
// paddingBottom: "10px"
231
244
} ,
232
245
chip : {
233
- color : ' rgba(193, 66, 66, 0)' ,
246
+ color : " rgba(193, 66, 66, 0)"
234
247
} ,
235
248
htmliconwrapper : {
236
- verticalAlign : ' baseline' ,
249
+ verticalAlign : " baseline"
237
250
} ,
238
251
htmlicons : {
239
- color : ' #ffffff' ,
252
+ color : " #ffffff"
240
253
} ,
241
254
tabRoot : {
242
- textTransform : ' initial' ,
255
+ textTransform : " initial" ,
243
256
minWidth : 100 ,
244
257
fontWeight : theme . typography . fontWeightRegular ,
245
258
// marginRight: theme.spacing.unit * 4,
246
- color : ' #ffffff' ,
247
- } ,
259
+ color : " #ffffff"
260
+ }
248
261
} ;
249
262
}
250
263
0 commit comments