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