mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-22 21:42:30 -05:00
convert container to not a component
This commit is contained in:
parent
9f40c633f8
commit
4e29f31639
2 changed files with 2 additions and 17 deletions
|
@ -14,7 +14,6 @@ const StrokeWidthIndicatorComponent = props => (
|
|||
small
|
||||
max={MAX_STROKE_WIDTH}
|
||||
min="0"
|
||||
tabIndex="1"
|
||||
type="number"
|
||||
value={props.strokeWidth}
|
||||
onSubmit={props.onChangeStrokeWidth}
|
||||
|
|
|
@ -1,26 +1,12 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import {connect} from 'react-redux';
|
||||
import {changeStrokeWidth} from '../reducers/stroke-width';
|
||||
import StrokeWidthIndicatorComponent from '../components/stroke-width-indicator.jsx';
|
||||
|
||||
const StrokeWidthIndicator = props => (
|
||||
<StrokeWidthIndicatorComponent
|
||||
strokeWidth={props.strokeWidth}
|
||||
onChangeStrokeWidth={props.handleChangeStrokeWidth}
|
||||
/>
|
||||
);
|
||||
|
||||
StrokeWidthIndicator.propTypes = {
|
||||
handleChangeStrokeWidth: PropTypes.func.isRequired,
|
||||
strokeWidth: PropTypes.string.isRequired
|
||||
};
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
strokeWidth: state.scratchPaint.color.strokeWidth
|
||||
});
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
handleChangeStrokeWidth: strokeWidth => {
|
||||
onChangeStrokeWidth: strokeWidth => {
|
||||
dispatch(changeStrokeWidth(strokeWidth));
|
||||
}
|
||||
});
|
||||
|
@ -28,4 +14,4 @@ const mapDispatchToProps = dispatch => ({
|
|||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(StrokeWidthIndicator);
|
||||
)(StrokeWidthIndicatorComponent);
|
||||
|
|
Loading…
Reference in a new issue