2017-09-08 11:52:36 -04:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
import BufferedInputHOC from './forms/buffered-input-hoc.jsx';
|
|
|
|
import Input from './forms/input.jsx';
|
2017-10-02 15:25:04 -04:00
|
|
|
|
2017-09-08 11:52:36 -04:00
|
|
|
import {MAX_STROKE_WIDTH} from '../reducers/stroke-width';
|
|
|
|
|
|
|
|
import styles from './paint-editor.css';
|
|
|
|
|
|
|
|
const BufferedInput = BufferedInputHOC(Input);
|
|
|
|
const StrokeWidthIndicatorComponent = props => (
|
|
|
|
<div className={styles.inputGroup}>
|
|
|
|
<BufferedInput
|
|
|
|
small
|
|
|
|
max={MAX_STROKE_WIDTH}
|
|
|
|
min="0"
|
|
|
|
type="number"
|
2017-10-02 15:25:04 -04:00
|
|
|
value={props.strokeWidth ? props.strokeWidth : 0}
|
2017-09-08 11:52:36 -04:00
|
|
|
onSubmit={props.onChangeStrokeWidth}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
StrokeWidthIndicatorComponent.propTypes = {
|
|
|
|
onChangeStrokeWidth: PropTypes.func.isRequired,
|
2017-10-02 15:25:04 -04:00
|
|
|
strokeWidth: PropTypes.number
|
2017-09-08 11:52:36 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
export default StrokeWidthIndicatorComponent;
|