2016-09-12 19:54:02 +02:00
|
|
|
import React from 'react'
|
|
|
|
import { Input } from 'rebass'
|
|
|
|
|
|
|
|
/*** Number fields with support for min, max and units and documentation*/
|
|
|
|
class StringField extends React.Component {
|
|
|
|
static propTypes = {
|
2016-09-12 20:10:49 +02:00
|
|
|
onChange: React.PropTypes.func.isRequired,
|
2016-09-12 19:54:02 +02:00
|
|
|
name: React.PropTypes.string.isRequired,
|
|
|
|
value: React.PropTypes.number,
|
|
|
|
default: React.PropTypes.number,
|
|
|
|
doc: React.PropTypes.string,
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return <Input
|
2016-09-12 20:10:49 +02:00
|
|
|
onChange={this.props.onChange}
|
2016-09-12 19:54:02 +02:00
|
|
|
label={this.props.name}
|
|
|
|
name={this.props.name}
|
|
|
|
value={this.props.value}
|
|
|
|
/>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default StringField
|