File tree Expand file tree Collapse file tree 3 files changed +21
-14
lines changed Expand file tree Collapse file tree 3 files changed +21
-14
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ const DragDropPanel = (props): JSX.Element => {
40
40
41
41
// filter out separator so that it will not appear on the html panel
42
42
const htmlTypesToRender = state . HTMLTypes . filter ( type => type . name !== 'separator' ) ;
43
+
43
44
return (
44
45
< div className = "HTMLItems" >
45
46
< div id = "HTMLItemsTopHalf" >
@@ -48,19 +49,19 @@ const DragDropPanel = (props): JSX.Element => {
48
49
>
49
50
< h3 > HTML ELEMENTS</ h3 >
50
51
{ htmlTypesToRender . map ( option => {
51
- if ( option . id === 17 || option . id === 18 ) {
52
- return ;
52
+ if ( option . id !== 17 || option . id !== 18 ) {
53
+ return (
54
+ < HTMLItem
55
+ name = { option . name }
56
+ key = { `html-${ option . name } ` }
57
+ id = { option . id }
58
+ Icon = { option . icon }
59
+ handleDelete = { handleDelete }
60
+ isThemeLight = { isThemeLight }
61
+ />
62
+ ) ;
53
63
}
54
- return (
55
- < HTMLItem
56
- name = { option . name }
57
- key = { `html-${ option . name } ` }
58
- id = { option . id }
59
- Icon = { option . icon }
60
- handleDelete = { handleDelete }
61
- isThemeLight = { isThemeLight }
62
- />
63
- ) ;
64
+
64
65
} ) }
65
66
< h3 > REACT ROUTER</ h3 >
66
67
{ htmlTypesToRender . map ( option => {
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ function Canvas() {
25
25
function onClickHandler ( event ) {
26
26
event . stopPropagation ( ) ;
27
27
// note: a null value for the child id means that we are focusing on the top-level component rather than any child
28
+ console . log ( state . canvasFocus ) ;
28
29
changeFocus ( state . canvasFocus . componentId , null ) ;
29
30
} ;
30
31
Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ const generateUnformattedCode = (
52
52
} else if ( child . type === 'HTML Element' ) {
53
53
const referencedHTML = HTMLTypes . find ( elem => elem . id === child . typeId ) ;
54
54
child [ 'tag' ] = referencedHTML . tag ;
55
- console . log ( referencedHTML ) ;
56
55
if (
57
56
referencedHTML . tag === 'div' ||
58
57
referencedHTML . tag === 'separator' ||
@@ -79,10 +78,16 @@ const generateUnformattedCode = (
79
78
// Raised formatStyles so that it is declared before it is referenced. It was backwards.
80
79
// format styles stored in object to match React inline style format
81
80
const formatStyles = ( styleObj : any ) => {
81
+ console . log ( styleObj ) ;
82
+
82
83
if ( Object . keys ( styleObj ) . length === 0 ) return `` ;
83
84
const formattedStyles = [ ] ;
84
85
for ( let i in styleObj ) {
85
- const styleString = i + ': ' + "'" + styleObj [ i ] + "'" ;
86
+ let styleString = i + ': ' + "'" + styleObj [ i ] + "'" ;
87
+ // if(i === 'style') {
88
+ // styleString = i + ':' + JSON.stringify(styleObj[i]);
89
+ // }
90
+
86
91
formattedStyles . push ( styleString ) ;
87
92
}
88
93
return ' style={{' + formattedStyles . join ( ',' ) + '}}' ;
You can’t perform that action at this time.
0 commit comments