mirror of
https://github.com/maputnik/editor.git
synced 2025-12-26 08:00:01 +00:00
Load icon and font metadata from endpoint
This commit is contained in:
@@ -9,10 +9,15 @@ import fontStacks from '../../config/fontstacks.json'
|
||||
class FontInput extends React.Component {
|
||||
static propTypes = {
|
||||
value: React.PropTypes.array.isRequired,
|
||||
fonts: React.PropTypes.array,
|
||||
style: React.PropTypes.object,
|
||||
onChange: React.PropTypes.func.isRequired,
|
||||
}
|
||||
|
||||
static defaultProps = {
|
||||
fonts: []
|
||||
}
|
||||
|
||||
get values() {
|
||||
return this.props.value || this.props.default.slice(1) || []
|
||||
}
|
||||
@@ -28,7 +33,7 @@ class FontInput extends React.Component {
|
||||
return <AutocompleteInput
|
||||
key={i}
|
||||
value={value}
|
||||
options={fontStacks.map(f => [f, f])}
|
||||
options={this.props.fonts.map(f => [f, f])}
|
||||
onChange={this.changeFont.bind(this, i)}
|
||||
wrapperStyle={{
|
||||
display: 'block',
|
||||
|
||||
Reference in New Issue
Block a user