mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2025-01-09 14:12:13 -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 {connect} from 'react-redux';
|
||||||
import {changeFillColor} from '../reducers/fill-color';
|
import {changeFillColor} from '../reducers/fill-color';
|
||||||
import FillColorIndicatorComponent from '../components/fill-color-indicator.jsx';
|
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 => ({
|
const mapStateToProps = state => ({
|
||||||
fillColor: state.scratchPaint.color.fillColor
|
fillColor: state.scratchPaint.color.fillColor
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = dispatch => ({
|
const mapDispatchToProps = dispatch => ({
|
||||||
handleChangeFillColor: fillColor => {
|
onChangeFillColor: fillColor => {
|
||||||
dispatch(changeFillColor(fillColor));
|
dispatch(changeFillColor(fillColor));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -28,4 +14,4 @@ const mapDispatchToProps = dispatch => ({
|
||||||
export default connect(
|
export default connect(
|
||||||
mapStateToProps,
|
mapStateToProps,
|
||||||
mapDispatchToProps
|
mapDispatchToProps
|
||||||
)(FillColorIndicator);
|
)(FillColorIndicatorComponent);
|
||||||
|
|
|
@ -1,26 +1,12 @@
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
|
||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import {changeStrokeColor} from '../reducers/stroke-color';
|
import {changeStrokeColor} from '../reducers/stroke-color';
|
||||||
import StrokeColorIndicatorComponent from '../components/stroke-color-indicator.jsx';
|
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 => ({
|
const mapStateToProps = state => ({
|
||||||
strokeColor: state.scratchPaint.color.strokeColor
|
strokeColor: state.scratchPaint.color.strokeColor
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = dispatch => ({
|
const mapDispatchToProps = dispatch => ({
|
||||||
handleChangeStrokeColor: strokeColor => {
|
onChangeStrokeColor: strokeColor => {
|
||||||
dispatch(changeStrokeColor(strokeColor));
|
dispatch(changeStrokeColor(strokeColor));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -28,4 +14,4 @@ const mapDispatchToProps = dispatch => ({
|
||||||
export default connect(
|
export default connect(
|
||||||
mapStateToProps,
|
mapStateToProps,
|
||||||
mapDispatchToProps
|
mapDispatchToProps
|
||||||
)(StrokeColorIndicator);
|
)(StrokeColorIndicatorComponent);
|
||||||
|
|
Loading…
Reference in a new issue