Skip to content

Commit d615c9f

Browse files
committed
Extract 'LEFT' constant to 'constants' file
1 parent 18c6980 commit d615c9f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/components/constants.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,12 @@ const TestInput = {
8686
yOffset: 60
8787
}
8888

89+
const LEFT = 0
90+
8991
export default {
9092
Brick,
9193
MainBrick,
94+
LEFT,
9295
Pipe,
9396
Primitive,
9497
Slot,

src/containers/Draggable.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { connect } from 'react-redux'
22
import { startDrag } from '../actions'
3-
4-
const LEFT = 0
3+
import { LEFT } from '../components/constants'
54

65
const mapDispatchToProps = (dispatch) => {
76
return {

src/utils/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { selectElement } from '../actions'
2+
import { LEFT } from '../components/constants'
23

34
export * from './slotSelection'
45
export * from './slotPosition'
@@ -7,9 +8,6 @@ export const isNotEmpty = (object) => {
78
return Object.keys(object).length > 0
89
}
910

10-
11-
const LEFT = 0
12-
1311
export const handleSelectElement = (dispatch) => {
1412
return (elementId, mouseEvent) => {
1513
if(mouseEvent.button != LEFT)

0 commit comments

Comments
 (0)