maputnik/src/components/inputs/IconInput.jsx

30 lines
685 B
React
Raw Normal View History

2017-01-10 14:05:46 +01:00
import React from 'react'
import AutocompleteInput from './AutocompleteInput'
import input from '../../config/input.js'
import { margins } from '../../config/scales.js'
class IconInput extends React.Component {
static propTypes = {
value: React.PropTypes.array.isRequired,
icons: React.PropTypes.array,
style: React.PropTypes.object,
onChange: React.PropTypes.func.isRequired,
}
static defaultProps = {
icons: []
}
render() {
return <AutocompleteInput
value={this.props.value}
options={this.props.icons.map(f => [f, f])}
onChange={this.props.onChange}
wrapperStyle={this.props.style}
/>
}
}
export default IconInput