mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-22 21:42:30 -05:00
remove unused
This commit is contained in:
parent
aa2b70f1e7
commit
60a310ae85
1 changed files with 1 additions and 20 deletions
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue