Load icon and font metadata from endpoint

This commit is contained in:
Lukas Martinelli
2017-01-10 11:13:53 +01:00
parent 09b6b2dffe
commit 0fb59ca544
5 changed files with 80 additions and 17 deletions

View File

@@ -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',