Skip to content

Commit df1495c

Browse files
committed
Merge branch 'updateStyle' of https://github.com/oslabs-beta/ReacType into updateStyle
2 parents dc248ec + e534402 commit df1495c

File tree

5 files changed

+30
-15
lines changed

5 files changed

+30
-15
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import StateContext from "../../../../context/context";
99
import { makeStyles } from '@material-ui/core/styles';
1010
import { StatePropsPanelProps } from '../../../../interfaces/Interfaces';
1111
import AddIcon from '@mui/icons-material/Add';
12+
import { borderLeft } from '@mui/system';
1213

1314
const Table3 = props => {
1415
// console.log('props from table state props', props)
@@ -25,7 +26,7 @@ const Table3 = props => {
2526
{
2627
field: 'id',
2728
headerName: 'ID',
28-
width: 70,
29+
width: 30,
2930
editable: false
3031
},
3132
{
@@ -49,14 +50,16 @@ const Table3 = props => {
4950
{
5051
field: 'delete',
5152
headerName: 'X',
52-
width: 70,
53+
width: 30,
5354
editable: false,
55+
align: 'left',
5456
renderCell: function renderCell(params: any) {
5557
return (
5658
<Button
5759
style={{ width: `${3}px`, color: 'black'}}
5860
onClick={() => {
59-
console.log('params inside button', params)
61+
console.log('params inside delete button', params)
62+
console.log('params.id inside delete button', params.id)
6063
deleteParentProps(params.row, params.id);
6164
}}
6265
>
@@ -138,8 +141,9 @@ const Table3 = props => {
138141
columns={gridColumns}
139142
pageSize={5}
140143
editRowsModel={editRowsModel}
141-
onRowClick={deleteParentProps}
144+
// onRowClick={deleteParentProps}
142145
className={props.isThemeLight ? classes.themeLight : classes.themeDark}
146+
// checkboxSelection
143147
/>
144148
</div>
145149
);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const TableParentProps = props => {
2323
{
2424
field: 'id',
2525
headerName: 'ID',
26-
width: 70,
26+
width: 30,
2727
editable: false
2828
},
2929
{
@@ -47,7 +47,7 @@ const TableParentProps = props => {
4747
{
4848
field: 'delete',
4949
headerName: '+',
50-
width: 90,
50+
width: 30,
5151
editable: false,
5252
renderCell: function renderCell(params: any) {
5353
return (

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const TableStateProps = props => {
2626
{
2727
field: 'id',
2828
headerName: 'ID',
29-
width: 70,
29+
width: 30,
3030
editable: false
3131
},
3232
{
@@ -50,7 +50,7 @@ const TableStateProps = props => {
5050
{
5151
field: 'delete',
5252
headerName: 'X',
53-
width: 90,
53+
width: 30,
5454
editable: false,
5555
renderCell: function renderCell(params: any) {
5656
return (

app/src/components/main/DirectChildComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function DirectChildComponent({ childId, type, typeId, style, name }: ChildEleme
5454
const combinedStyle = combineStyles(
5555
combineStyles(
5656
combineStyles(globalDefaultStyle, referencedComponent.style),
57-
style
57+
// style
5858
),
5959
interactiveStyle
6060
);

app/src/reducers/componentReducer.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -796,12 +796,23 @@ const reducer = (state: State, action: Action) => {
796796
components,
797797
state.canvasFocus.componentId
798798
);
799-
currComponent.passedInProps = action.payload.passedInProps;
800-
console.log('in delete reducer', currComponent)
801-
console.log('in delete reducer 2', action.payload.rowId)
802-
const toDelete = currComponent.passedInProps[0]
803-
console.log('in delete reducer', {toDelete})
804-
delete currComponent.passedInProps[0];
799+
console.log('currComponent.passedInProps before splice', currComponent.passedInProps)
800+
// currComponent.passedInProps = action.payload.passedInProps;
801+
// console.log('in delete reducer after assignment', currComponent.passedInProps)
802+
console.log('in delete reducer action.payload.rowId', action.payload.rowId)
803+
// const toDelete = currComponent.passedInProps[action.payload.rowId]
804+
// console.log('in delete reducer toDelete', {toDelete})
805+
let index;
806+
for (let i = 0; i < currComponent.passedInProps.length; i++) {
807+
if (currComponent.passedInProps[i].id === action.payload.rowId) {
808+
index = i;
809+
break;
810+
}
811+
}
812+
currComponent.passedInProps.splice(index, 1);
813+
// console.log('temp', temp)
814+
console.log('currComponent.passedInProps after splice', currComponent.passedInProps)
815+
// delete currComponent.passedInProps[0];
805816
currComponent.code = generateCode(
806817
components,
807818
state.canvasFocus.componentId,

0 commit comments

Comments
 (0)