mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-22 13:32:28 -05:00
convert containers to mysterious non-components
This commit is contained in:
parent
2c98f61d69
commit
499635ddf1
2 changed files with 4 additions and 32 deletions
|
@ -1,26 +1,12 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import {connect} from 'react-redux';
|
||||
import {changeFillColor} from '../reducers/fill-color';
|
||||
import FillColorIndicatorComponent from '../components/fill-color-indicator.jsx';
|
||||
|
||||
const FillColorIndicator = props => (
|
||||
<FillColorIndicatorComponent
|
||||
fillColor={props.fillColor}
|
||||
onChangeFillColor={props.handleChangeFillColor}
|
||||
/>
|
||||
);
|
||||
|
||||
FillColorIndicator.propTypes = {
|
||||
fillColor: PropTypes.string.isRequired,
|
||||
handleChangeFillColor: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
fillColor: state.scratchPaint.color.fillColor
|
||||
});
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
handleChangeFillColor: fillColor => {
|
||||
onChangeFillColor: fillColor => {
|
||||
dispatch(changeFillColor(fillColor));
|
||||
}
|
||||
});
|
||||
|
@ -28,4 +14,4 @@ const mapDispatchToProps = dispatch => ({
|
|||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(FillColorIndicator);
|
||||
)(FillColorIndicatorComponent);
|
||||
|
|
|
@ -1,26 +1,12 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import {connect} from 'react-redux';
|
||||
import {changeStrokeColor} from '../reducers/stroke-color';
|
||||
import StrokeColorIndicatorComponent from '../components/stroke-color-indicator.jsx';
|
||||
|
||||
const StrokeColorIndicator = props => (
|
||||
<StrokeColorIndicatorComponent
|
||||
strokeColor={props.strokeColor}
|
||||
onChangeStrokeColor={props.handleChangeStrokeColor}
|
||||
/>
|
||||
);
|
||||
|
||||
StrokeColorIndicator.propTypes = {
|
||||
handleChangeStrokeColor: PropTypes.func.isRequired,
|
||||
strokeColor: PropTypes.string.isRequired
|
||||
};
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
strokeColor: state.scratchPaint.color.strokeColor
|
||||
});
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
handleChangeStrokeColor: strokeColor => {
|
||||
onChangeStrokeColor: strokeColor => {
|
||||
dispatch(changeStrokeColor(strokeColor));
|
||||
}
|
||||
});
|
||||
|
@ -28,4 +14,4 @@ const mapDispatchToProps = dispatch => ({
|
|||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(StrokeColorIndicator);
|
||||
)(StrokeColorIndicatorComponent);
|
||||
|
|
Loading…
Reference in a new issue