@@ -96,31 +96,6 @@ class BottomTabs extends Component<PropsInt> {
9696 this . setState ( { value } ) ;
9797 } ;
9898
99- findChildren ( component : ComponentInt , components : ComponentsInt , tree : any ) {
100- if ( ! component . childrenArray . length ) {
101- return tree ;
102- }
103- const newChildrenArray = [ ] ;
104-
105- for ( let i = 0 ; i < component . childrenArray . length ; i ++ ) {
106- const name = component . childrenArray [ i ] . componentName ;
107- const newTree : TreeInt = {
108- name,
109- attributes : { } ,
110- children : [ ] ,
111- } ;
112- newChildrenArray . push ( newTree ) ;
113- tree . children = newChildrenArray ;
114- if ( component . childrenArray [ i ] . childType === 'COMP' ) {
115- const newFocusComp = components . find (
116- comp => comp . title === component . childrenArray [ i ] . componentName ,
117- ) ;
118- this . findChildren ( newFocusComp , components , newTree ) ;
119- }
120- }
121- return tree ;
122- }
123-
12499 generateComponentTree ( componentId : number , components : ComponentsInt ) {
125100 const component = components . find ( comp => comp . id === componentId ) ;
126101 const tree = { name : component . title , attributes : { } , children : [ ] } ;
@@ -141,13 +116,7 @@ class BottomTabs extends Component<PropsInt> {
141116
142117 render ( ) {
143118 const {
144- classes,
145- components,
146- focusComponent,
147- deleteProp,
148- addProp,
149- focusChild,
150- // rightColumnOpen
119+ classes, components, focusComponent, deleteProp, addProp, focusChild,
151120 } = this . props ;
152121 const { value } = this . state ;
153122
@@ -156,13 +125,6 @@ class BottomTabs extends Component<PropsInt> {
156125 const htmlAttribCount = focusComponent . childrenArray . filter ( child => child . childType === 'HTML' )
157126 . length ;
158127
159- // const counters = focusComponent.ch
160- const tree = {
161- name : focusComponent . title ,
162- attributes : { } ,
163- children : [ ] ,
164- } ;
165-
166128 return (
167129 < div className = { classes . root } >
168130 < Tabs
@@ -207,8 +169,7 @@ class BottomTabs extends Component<PropsInt> {
207169 ref = { node => ( this . treeWrapper = node ) }
208170 >
209171 < Tree
210- data = { [ this . findChildren ( focusComponent , components , tree ) ] }
211- // data={[this.generateComponentTree(focusComponent.id, components)]}
172+ data = { [ this . generateComponentTree ( focusComponent . id , components ) ] }
212173 separation = { { siblings : 0.3 , nonSiblings : 0.3 } }
213174 transitionDuration = { 0 }
214175 translate = { this . state . translate }
0 commit comments