convert containers to mysterious non-components

This commit is contained in:
DD 2017-09-11 13:28:35 -04:00
parent 2c98f61d69
commit 499635ddf1
2 changed files with 4 additions and 32 deletions

View file

@ -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);

View file

@ -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);