File size: 977 Bytes
5913525 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
import React from 'react';
import PropTypes from 'prop-types';
import Input from './forms/input.jsx';
import InputGroup from './input-group/input-group.jsx';
import LiveInputHOC from './forms/live-input-hoc.jsx';
import {MAX_STROKE_WIDTH} from '../reducers/stroke-width';
const LiveInput = LiveInputHOC(Input);
const StrokeWidthIndicatorComponent = props => (
<InputGroup disabled={props.disabled}>
<LiveInput
range
small
disabled={props.disabled}
max={MAX_STROKE_WIDTH}
min="0"
type="number"
value={props.strokeWidth ? props.strokeWidth : 0}
onSubmit={props.onChangeStrokeWidth}
/>
</InputGroup>
);
StrokeWidthIndicatorComponent.propTypes = {
disabled: PropTypes.bool.isRequired,
onChangeStrokeWidth: PropTypes.func.isRequired,
strokeWidth: PropTypes.number
};
export default StrokeWidthIndicatorComponent;
|