Skip to content

Commit 5aa644c

Browse files
committed
add in table formatting
1 parent 47e0c2e commit 5aa644c

File tree

6 files changed

+34
-31
lines changed

6 files changed

+34
-31
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,16 @@ const CreateContainer = ({isThemeLight, data}) => {
8080
};
8181
return (
8282
<>
83-
<Grid container display="flex" justifyContent="space-evenly">
84-
<Grid item>
83+
<Grid container display="flex" justifyContent="stretch" flexDirection="column">
84+
{/* <Grid item>
8585
<Grid
8686
container
8787
spacing={2}
8888
display="flex"
8989
direction="column"
9090
justifyContent="center"
91-
alignItems="center"
92-
>
91+
alignItems="center" */}
92+
{/* > */}
9393
{/* LegacyPD deleted the components below because we're going to replace with the component from CreationPanel */}
9494
{/* <Grid item>
9595
<AddContextForm
@@ -109,11 +109,11 @@ const CreateContainer = ({isThemeLight, data}) => {
109109
contextInput={contextInput}
110110
/>
111111
</Grid> */}
112-
<Grid item>
112+
{/* <Grid item> */}
113113
<StatePropsPanel isThemeLight={isThemeLight} data={data}/>
114-
</Grid>
115-
</Grid>
116-
</Grid>
114+
{/* </Grid> */}
115+
{/* </Grid> */}
116+
{/* </Grid> */}
117117

118118
{/*
119119
LegacyPD commented out the below to move to DisplayContainer

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,22 +229,32 @@ const StatePropsPanel = ({ isThemeLight, data}): JSX.Element => {
229229
</FormControl>
230230
</div>
231231
<br></br>
232-
<div style={{display: 'flex', overflowX: 'scroll', width: '1000px'}}>
232+
<div style={{display: 'flex', overflowX: 'scroll', width: '1700px'}}>
233+
<div style={{display: 'flex', flexDirection: 'column'}}>
233234
<h4 className={isThemeLight ? classes.lightThemeFontColor : classes.darkThemeFontColor}>
234235
Current Component State: {state.components[state.canvasFocus.componentId - 1].name}
235236
</h4>
236237
<TableStateProps rows1={rows1} setRows1={setRows1} canDeleteState = {true} selectHandler={handlerRowSelect} isThemeLight={isThemeLight} data={data}/>
238+
</div>
237239

238-
239-
<h4 className={isThemeLight ? classes.lightThemeFontColor : classes.darkThemeFontColor}>
240+
<div style={{display: 'flex', flexDirection: 'column'}}>
241+
<h4 className={isThemeLight ? classes.lightThemeFontColor : classes.darkThemeFontColor}>
240242
Available Props from Parent: {parentName ? parentName : 'No Parents'}
241243
</h4>
242-
243244
<TableParentProps parentComponent ={parentComponent} parentProps={parentProps} canDeleteState = {true} selectHandler={handlerRowSelect} isThemeLight={isThemeLight} data={data}/>
245+
</div>
246+
<div style={{display: 'flex', flexDirection: 'column', width: `${40}px`, color: 'black', alignItems: 'center'}}>
247+
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" fill="currentColor" class="bi bi-arrow-right-circle-fill" viewBox="0 0 16 16">
248+
<path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zM4.5 7.5a.5.5 0 0 0 0 1h5.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3a.5.5 0 0 0 0-.708l-3-3a.5.5 0 1 0-.708.708L10.293 7.5H4.5z"/>
249+
</svg>
250+
</div>
251+
252+
<div style={{display: 'flex', flexDirection: 'column'}}>
244253
<h4 className={isThemeLight ? classes.lightThemeFontColor : classes.darkThemeFontColor}>
245254
Passed in Props from Parent: {parentName ? parentName : 'No Parents'}
246255
</h4>
247256
<Table3 canDeleteState = {true} selectHandler={handlerRowSelect} isThemeLight={isThemeLight} data={data}/>
257+
</div>
248258

249259

250260

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,14 @@ const Table3 = props => {
133133

134134
return (
135135
<div className={'state-prop-grid'}>
136-
({rows.length &&
137136
<DataGrid
138137
rows={rows}
139138
columns={gridColumns}
140139
pageSize={5}
141140
editRowsModel={editRowsModel}
142141
onRowClick={deleteParentProps}
143142
className={props.isThemeLight ? classes.themeLight : classes.themeDark}
144-
checkboxSelection
145143
/>
146-
})
147-
148144
</div>
149145
);
150146
};

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,31 @@ const TableParentProps = props => {
2323
{
2424
field: 'id',
2525
headerName: 'ID',
26-
width: 70,
26+
width: 50,
2727
editable: false
2828
},
2929
{
3030
field: 'key',
3131
headerName: 'Key',
32-
width: 90,
32+
width: 50,
3333
editable: true
3434
},
3535
{
3636
field: 'value',
3737
headerName: 'Value',
38-
width: 90,
38+
width: 50,
3939
editable: true
4040
},
4141
{
4242
field: 'type',
4343
headerName: 'Type',
44-
width: 90,
44+
width: 50,
4545
editable: false
4646
},
4747
{
4848
field: 'delete',
4949
headerName: '+',
50-
width: 70,
50+
width: 50,
5151
editable: false,
5252
renderCell: function renderCell(params: any) {
5353
return (
@@ -130,17 +130,14 @@ const TableParentProps = props => {
130130

131131

132132
return (
133-
<div className={'state-prop-grid'}>
134-
{(rows.length &&
133+
<div className={'state-prop-grid'}>
135134
<DataGrid
136135
rows={rows}
137136
columns={gridColumns}
138137
pageSize={5}
139138
editRowsModel={editRowsModel}
140139
className={props.isThemeLight ? classes.themeLight : classes.themeDark}
141-
// checkboxSelection
142140
/>
143-
)}
144141
</div>
145142
);
146143
};

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,31 @@ const TableStateProps = props => {
2626
{
2727
field: 'id',
2828
headerName: 'ID',
29-
width: 70,
29+
width: 50,
3030
editable: false
3131
},
3232
{
3333
field: 'key',
3434
headerName: 'Key',
35-
width: 90,
35+
width: 50,
3636
editable: true
3737
},
3838
{
3939
field: 'value',
4040
headerName: 'Value',
41-
width: 90,
41+
width: 50,
4242
editable: true
4343
},
4444
{
4545
field: 'type',
4646
headerName: 'Type',
47-
width: 90,
47+
width: 50,
4848
editable: false
4949
},
5050
{
5151
field: 'delete',
5252
headerName: 'X',
53-
width: 70,
53+
width: 50,
5454
editable: false,
5555
renderCell: function renderCell(params: any) {
5656
return (

app/src/public/styles/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ h4 {
4444
}
4545
.state-prop-grid {
4646
height: 300px;
47-
width: 500px;
47+
width: max-content;
4848
flex-grow: 1;
4949
}
5050
.HTMLItemCreate {

0 commit comments

Comments
 (0)