2017-09-07 17:12:50 -04:00
|
|
|
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 => ({
|
2017-09-07 17:49:41 -04:00
|
|
|
fillColor: state.scratchPaint.color.fillColor
|
2017-09-07 17:12:50 -04:00
|
|
|
});
|
|
|
|
const mapDispatchToProps = dispatch => ({
|
|
|
|
handleChangeFillColor: fillColor => {
|
|
|
|
dispatch(changeFillColor(fillColor));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(
|
|
|
|
mapStateToProps,
|
|
|
|
mapDispatchToProps
|
|
|
|
)(FillColorIndicator);
|