File tree Expand file tree Collapse file tree 1 file changed +16
-11
lines changed
Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change 1+ import React from "react" ;
12import useAppStore from "../store/appStore" ;
23import applyPropertyChange from "../actions/applyPropertyChange" ;
34import { PropertyChangeEvent } from "../model/event" ;
@@ -29,19 +30,23 @@ function PanelsRow() {
2930 ) => {
3031 applyPropertyChange ( contribPoint , panelIndex , panelEvent ) ;
3132 } ;
32-
33+ const visiblePanels : React . JSX . Element [ ] = [ ] ;
34+ panelStates . forEach ( ( panelState , panelIndex ) => {
35+ if ( panelState . visible ) {
36+ visiblePanels . push (
37+ < Panel
38+ key = { panelIndex }
39+ panelState = { panelState }
40+ panelModel = { panelModels [ panelIndex ] }
41+ onPropertyChange = { ( e ) => handlePropertyChange ( panelIndex , e ) }
42+ /> ,
43+ ) ;
44+ }
45+ } ) ;
46+ const panelElements = < > { visiblePanels } </ > ;
3347 return (
3448 < div style = { { display : "flex" , gap : 5 , paddingTop : 10 } } >
35- { panelStates
36- . filter ( ( panelState ) => panelState . visible )
37- . map ( ( panelState , panelIndex ) => (
38- < Panel
39- key = { panelIndex }
40- panelModel = { panelModels [ panelIndex ] }
41- panelState = { panelState }
42- onPropertyChange = { ( e ) => handlePropertyChange ( panelIndex , e ) }
43- />
44- ) ) }
49+ { panelElements }
4550 </ div >
4651 ) ;
4752}
You can’t perform that action at this time.
0 commit comments