Skip to content

Commit 94dbfe5

Browse files
Merge pull request #105 from ChristianEdwardPadilla/development
Merge with Shlomo, styling changes, additions to createApp
2 parents 41b890b + b5d924c commit 94dbfe5

File tree

4 files changed

+171
-138
lines changed

4 files changed

+171
-138
lines changed

src/components/SortChildren.jsx

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ class SortChildren extends Component {
2424
} // end constrcutor
2525

2626
setLocalArray = () => {
27-
const localArray = this.props.focusComponent.childrenArray.map((child, idx) => {
28-
return { childId: child.childId, childSort: child.childSort };
29-
});
27+
const localArray = this.props.focusComponent.childrenArray.map((child, idx) => ({
28+
childId: child.childId,
29+
childSort: child.childSort,
30+
}));
3031
return localArray;
3132
};
3233

@@ -62,11 +63,12 @@ class SortChildren extends Component {
6263
// put back the dragge item after the dragged Over
6364
currentSortValues.splice(this.state.draggedOverIndex, 0, draggedBaby);
6465

65-
currentSortValues = currentSortValues.map((child, idx) => {
66-
return { childId: child.childId, childSort: idx + 1 };
67-
});
66+
currentSortValues = currentSortValues.map((child, idx) => ({
67+
childId: child.childId,
68+
childSort: idx + 1,
69+
}));
6870

69-
console.log(`currentSortValues after updating the sort `, JSON.stringify(currentSortValues));
71+
console.log('currentSortValues after updating the sort ', JSON.stringify(currentSortValues));
7072

7173
this.props.updateChildrenSort({ newSortValues: currentSortValues });
7274

@@ -89,25 +91,23 @@ class SortChildren extends Component {
8991
lineHeight: 1,
9092
cursor: 'move',
9193
};
92-
//const children = this.props.focusComponent.childrenArray;
94+
// const children = this.props.focusComponent.childrenArray;
9395
// const List = children
9496
const List = cloneDeep(this.props.focusComponent.childrenArray)
9597
.sort((a, b) => a.childSort - b.childSort)
96-
.map((child, idx) => {
97-
return (
98-
<li style={liStyle} id={child.childId} key={idx}>
99-
<div
100-
className="drag"
101-
draggable
102-
onDragStart={e => this.onDragStart(e, idx)}
103-
onDragOver={e => this.onDragOver(idx)}
104-
onDragEnd={e => this.onDragEnd()}
105-
>
106-
{child.componentName + child.childId}
107-
</div>
108-
</li>
109-
);
110-
});
98+
.map((child, idx) => (
99+
<li style={liStyle} id={child.childId} key={idx}>
100+
<div
101+
className="drag"
102+
draggable
103+
onDragStart={e => this.onDragStart(e, idx)}
104+
onDragOver={e => this.onDragOver(idx)}
105+
onDragEnd={e => this.onDragEnd()}
106+
>
107+
{child.componentName + child.childId}
108+
</div>
109+
</li>
110+
));
111111
return (
112112
<div
113113
style={{
@@ -122,21 +122,19 @@ class SortChildren extends Component {
122122
<ul style={ulStyle}>
123123
{cloneDeep(this.props.focusComponent.childrenArray)
124124
.sort((a, b) => a.childSort - b.childSort)
125-
.map((child, idx) => {
126-
return (
127-
<li style={liStyle} id={child.childId} key={idx}>
128-
<div
129-
className="drag"
130-
draggable
131-
onDragStart={e => this.onDragStart(e, idx)}
132-
onDragOver={e => this.onDragOver(idx)}
133-
onDragEnd={e => this.onDragEnd()}
134-
>
135-
{child.componentName + child.childId}
136-
</div>
137-
</li>
138-
);
139-
})}
125+
.map((child, idx) => (
126+
<li style={liStyle} id={child.childId} key={idx}>
127+
<div
128+
className="drag"
129+
draggable
130+
onDragStart={e => this.onDragStart(e, idx)}
131+
onDragOver={e => this.onDragOver(idx)}
132+
onDragEnd={e => this.onDragEnd()}
133+
>
134+
{child.componentName + child.childId}
135+
</div>
136+
</li>
137+
))}
140138

141139
{/* {List} */}
142140
</ul>

src/public/index.html

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,10 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
7-
<meta
8-
http-equiv="Content-Security-Policy"
9-
content="default-src 'self' https: filesystem: data: ws: 'unsafe-eval' 'unsafe-inline'"
10-
/>
7+
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https: filesystem: data: ws: 'unsafe-eval' 'unsafe-inline'" />
118
<title>ReacType</title>
12-
<link
13-
rel="stylesheet"
14-
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"
15-
/>
16-
<link
17-
rel="stylesheet"
18-
href="https://fonts.googleapis.com/icon?family=Material+Icons"
19-
/>
9+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" />
10+
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
2011
</head>
2112

2213
<body>

src/reducers/componentReducer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ const initialApplicationFocusChild = {
7070
position: {
7171
x: 25,
7272
y: 25,
73-
width: 600,
74-
height: 400,
73+
width: 800,
74+
height: 550,
7575
},
7676
childType: null,
7777
childSort: 0,

0 commit comments

Comments
 (0)