Skip to content

Commit e7f2a69

Browse files
committed
worked on prop form and DataTable changed, props form change
1 parent ee59241 commit e7f2a69

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

src/components/DataTable.jsx

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import TableHead from '@material-ui/core/TableHead';
88
import TableRow from '@material-ui/core/TableRow';
99
import Paper from '@material-ui/core/Paper';
1010
import Button from '@material-ui/core/Button';
11+
import DeleteIcon from '@material-ui/icons/Delete';
12+
import { IconButton } from '@material-ui/core';
13+
1114

1215
const styles = theme => ({
1316
root: {
@@ -16,7 +19,7 @@ const styles = theme => ({
1619
overflowX: 'auto',
1720
},
1821
table: {
19-
minWidth: 700,
22+
minWidth: 500,
2023
},
2124
});
2225

@@ -38,26 +41,33 @@ function dataTable(props) {
3841
if (!row) return;
3942
// for some reason we must put each value in a div.
4043
return rowHeader.map((header, idx) => (
41-
<TableCell key={`td_${idx}`}>
42-
<div>{typeof row[header] === 'string' ? row[header] : row[header].toString()}</div>
44+
<TableCell align={'center'} key={`td_${idx}`}>
45+
{/* <div align={'center'} padding = {'none'} >{typeof row[header] === 'string' ? row[header] : row[header].toString()}</div> */}
46+
{/* {row[header]} */}
47+
{typeof row[header] === 'string' ? row[header] : row[header].toString()}
4348
</TableCell>
4449
));
4550
}
46-
51+
//style={{height: 30}}
4752
const renderRows = rowData.map(row => (
4853
<TableRow key={`row-${row.id}`}>
4954
{renderRowCells(row)}
50-
<TableCell>
51-
<Button onClick={() => deletePropHandler(row.id)}>Delete</Button>
55+
<TableCell align={'center'} padding = {'none'} >
56+
<IconButton color="default" fontSize="small" onClick={() => deletePropHandler(row.id)} >
57+
<DeleteIcon/>
58+
</IconButton>
59+
{/* <Button style={{height: 20}} onClick={() => deletePropHandler(row.id)}>Delete</Button> */}
5260
</TableCell>
5361
</TableRow>
5462
));
5563

5664
return (
5765
<Paper className={classes.root}>
58-
<Table className={classes.table}>
66+
<Table className={classes.table}
67+
selectable = {"true"}
68+
>
5969
<TableHead>
60-
<TableRow>{renderHeader}</TableRow>
70+
<TableRow >{renderHeader}</TableRow>
6171
</TableHead>
6272
<TableBody>{renderRows}</TableBody>
6373
</Table>

src/components/LeftColExpansionPanel.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const LeftColExpansionPanel = props => {
2222
const { title, id, color } = component;
2323

2424
function isFocused() {
25-
return focusComponent.title === title ? "focused" : "";
25+
return focusComponent.id == id ? "focused" : "";
2626
}
2727

2828
return (

src/components/Props.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@ class Props extends Component {
177177
) : (
178178
<Fragment>
179179
<div className="props-container">
180-
<Grid container spacing={16}>
181-
<Grid item xs={5}>
180+
<Grid container spacing={8}>
181+
<Grid item xs={4}>
182182
<form className="props-input" onSubmit={this.handleAddProp}>
183-
<Grid container spacing={24}>
183+
<Grid container spacing={8}>
184184
<Grid item xs={6}>
185185
<TextField
186186
id="propKey"
@@ -260,7 +260,7 @@ class Props extends Component {
260260
</Grid>
261261
</form>
262262
</Grid>
263-
<Grid item xs={11}>
263+
<Grid item xs={8}>
264264
<DataTable
265265
rowHeader={rowHeader}
266266
rowData={propsRows}

0 commit comments

Comments
 (0)