Skip to content

Commit d35c51a

Browse files
dragging changes
1 parent 3091e52 commit d35c51a

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

src/actions/components.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,13 @@ export const handleClose = () => ({
130130
payload: false,
131131
});
132132

133-
export const handleTransform = (componentId, id, {
133+
export const handleTransform = (componentId, childId, {
134134
x, y, width, height,
135135
}) => ({
136136
type: HANDLE_TRANSFORM,
137137
payload: {
138138
componentId,
139-
id,
139+
childId,
140140
x,
141141
y,
142142
width,

src/components/KonvaStage.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class KonvaStage extends Component {
2121
// Christian - this function causes the expansionPanel of the clicked rect to open
2222
// (and focusedComponent to change, which we don't want)
2323
// could reuse this logic for affecting state of children array
24-
// ADD FOCUS CHILD FUNCTIONALITY HERE
24+
// ADD CHANG FOCUS CHILD FUNCTIONALITY HERE
2525
handleStageMouseDown = (e) => {
2626
// // clicked on stage - cler selection
2727
// if (e.target === e.target.getStage()) {

src/utils/componentReducer.util.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -321,20 +321,22 @@ export const handleTransform = (state, {
321321
}) => {
322322
console.log('componentId and childId: ', componentId, childId);
323323
console.log('state.focuscomponent: ', state.focusComponent);
324-
// const components = state.components.map((component) => {
325-
// if (component.id === id) {
326-
// return {
327-
// ...component,
328-
// position: {
329-
// x,
330-
// y,
331-
// width,
332-
// height,
333-
// },
334-
// };
335-
// }
336-
// return component;
337-
// });
324+
// const components = state.components
325+
// .find(comp => comp.id === componentId)
326+
// .childrenArray.map((child) => {
327+
// if (child.childId === childId) {
328+
// return {
329+
// ...child,
330+
// position: {
331+
// x,
332+
// y,
333+
// width,
334+
// height,
335+
// },
336+
// };
337+
// }
338+
// return child;
339+
// });
338340
return {
339341
...state,
340342
// components,

0 commit comments

Comments
 (0)