1
- import React , { Component , createRef } from ' react' ;
1
+ import React , { Component , createRef } from " react" ;
2
2
// import PropTypes from 'prop-types';
3
- import {
4
- Stage , Layer , Image , Group ,
5
- } from 'react-konva' ;
6
- import TransformerComponent from './TransformerComponent.jsx' ;
7
- import Rectangle from './Rectangle.jsx' ;
3
+ import { Stage , Layer , Image , Group } from "react-konva" ;
4
+ import TransformerComponent from "./TransformerComponent.jsx" ;
5
+ import Rectangle from "./Rectangle.jsx" ;
8
6
9
7
class KonvaStage extends Component {
10
8
state = {
11
9
x : undefined ,
12
- y : undefined ,
10
+ y : undefined
13
11
} ;
14
12
15
13
constructor ( props ) {
@@ -22,7 +20,7 @@ class KonvaStage extends Component {
22
20
// (and focusedComponent to change, which we don't want)
23
21
// could reuse this logic for affecting state of children array
24
22
// ADD CHANG FOCUS CHILD FUNCTIONALITY HERE
25
- handleStageMouseDown = ( e ) => {
23
+ handleStageMouseDown = e => {
26
24
// // clicked on stage - cler selection
27
25
// if (e.target === e.target.getStage()) {
28
26
// this.props.openExpansionPanel({});
@@ -71,13 +69,13 @@ class KonvaStage extends Component {
71
69
scaleX,
72
70
scaleY,
73
71
focusComponent,
74
- focusChild,
72
+ focusChild
75
73
} = this . props ;
76
74
const { selectedShapeName } = this . state ;
77
75
78
76
return (
79
77
< Stage
80
- ref = { ( node ) => {
78
+ ref = { node => {
81
79
this . stage = node ;
82
80
} }
83
81
onMouseDown = { this . handleStageMouseDown }
@@ -88,7 +86,7 @@ class KonvaStage extends Component {
88
86
< Group
89
87
scaleX = { scaleX }
90
88
scaleY = { scaleY }
91
- ref = { ( node ) => {
89
+ ref = { node => {
92
90
this . group = node ;
93
91
} }
94
92
draggable = { draggable }
@@ -99,7 +97,7 @@ class KonvaStage extends Component {
99
97
< Rectangle
100
98
draggable = { child . draggable }
101
99
selectedShapeName = { selectedShapeName }
102
- key = { i + child . componentName }
100
+ key = { i + ` ${ child . componentName } ` }
103
101
childId = { child . childId }
104
102
componentId = { focusComponent . id }
105
103
x = { child . position . x }
0 commit comments