Skip to content

Commit d9e5a9e

Browse files
added conditional rendor for table 3
1 parent 88919e8 commit d9e5a9e

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

app/src/components/StateManagement/CreateTab/components/Table3.tsx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const Table3 = props => {
2020
const currentComponent = state.components[currentId - 1];
2121
console.log({currentComponent});
2222
const passedInProps = currentComponent.name !== 'App' ? currentComponent.passedInProps : '';
23+
2324
const columnTabs = [
2425
{
2526
field: 'id',
@@ -104,6 +105,7 @@ const Table3 = props => {
104105
}
105106

106107
}, [state.canvasFocus.componentId]);
108+
let rows = passedInProps;
107109
// rows to show are either from current component or from a given provider
108110
// legacy pd convert parent props into a row array
109111
// if (!props.providerId) {
@@ -131,15 +133,18 @@ const Table3 = props => {
131133

132134
return (
133135
<div className={'state-prop-grid'}>
134-
<DataGrid
135-
rows={passedInProps}
136-
columns={gridColumns}
137-
pageSize={5}
138-
editRowsModel={editRowsModel}
139-
onRowClick={deleteParentProps}
140-
className={props.isThemeLight ? classes.themeLight : classes.themeDark}
141-
checkboxSelection
142-
/>
136+
({rows.length &&
137+
<DataGrid
138+
rows={rows}
139+
columns={gridColumns}
140+
pageSize={5}
141+
editRowsModel={editRowsModel}
142+
onRowClick={deleteParentProps}
143+
className={props.isThemeLight ? classes.themeLight : classes.themeDark}
144+
checkboxSelection
145+
/>
146+
})
147+
143148
</div>
144149
);
145150
};

app/src/components/StateManagement/CreateTab/components/TableParentProps.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,8 @@ const TableParentProps = props => {
137137
columns={gridColumns}
138138
pageSize={5}
139139
editRowsModel={editRowsModel}
140-
onRowClick={addParentProps}
141140
className={props.isThemeLight ? classes.themeLight : classes.themeDark}
142-
checkboxSelection
141+
// checkboxSelection
143142
/>
144143
)}
145144
</div>

0 commit comments

Comments
 (0)