diff --git a/src/containers/selection-hoc.jsx b/src/containers/selection-hoc.jsx index 2066ed09..d81a1c07 100644 --- a/src/containers/selection-hoc.jsx +++ b/src/containers/selection-hoc.jsx @@ -5,12 +5,6 @@ import React from 'react'; import {connect} from 'react-redux'; import bindAll from 'lodash.bindall'; -import {getSelectedItems} from '../helper/selection'; -import {getColorsFromSelection} from '../helper/style-path'; -import {changeStrokeColor} from '../reducers/stroke-color'; -import {changeStrokeWidth} from '../reducers/stroke-width'; -import {changeFillColor} from '../reducers/fill-color'; - const SelectionHOC = function (WrappedComponent) { class SelectionComponent extends React.Component { constructor (props) { @@ -59,21 +53,8 @@ const SelectionHOC = function (WrappedComponent) { const mapStateToProps = state => ({ hoveredItemId: state.scratchPaint.hoveredItemId }); - const mapDispatchToProps = dispatch => ({ - onUpdateColors: (() => { - const selectedItems = getSelectedItems(true /* recursive */); - if (selectedItems.length === 0) { - return; - } - const colorState = getColorsFromSelection(selectedItems); - dispatch(changeFillColor(colorState.fillColor)); - dispatch(changeStrokeColor(colorState.strokeColor)); - dispatch(changeStrokeWidth(colorState.strokeWidth)); - }) - }); return connect( - mapStateToProps, - mapDispatchToProps + mapStateToProps )(SelectionComponent); };