mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-30 16:25:31 +01:00
Add missing IconInput
This commit is contained in:
parent
f5256cf80a
commit
104d6311ec
1 changed files with 29 additions and 0 deletions
29
src/components/inputs/IconInput.jsx
Normal file
29
src/components/inputs/IconInput.jsx
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
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
|
Loading…
Reference in a new issue