mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-10 00:01:47 +01:00
28 lines
691 B
React
28 lines
691 B
React
|
import React from 'react'
|
||
|
import inputStyle from './input.js'
|
||
|
|
||
|
class BooleanField extends React.Component {
|
||
|
static propTypes = {
|
||
|
onChange: React.PropTypes.func.isRequired,
|
||
|
name: React.PropTypes.string.isRequired,
|
||
|
value: React.PropTypes.bool,
|
||
|
doc: React.PropTypes.string,
|
||
|
}
|
||
|
|
||
|
render() {
|
||
|
return <div style={inputStyle.property}>
|
||
|
<label style={inputStyle.label}>{this.props.name}</label>
|
||
|
<input
|
||
|
type="checkbox"
|
||
|
style={inputStyle.checkbox}
|
||
|
value={this.props.value}
|
||
|
onChange={e => {this.props.onChange(!this.props.value)}}
|
||
|
checked={this.props.value}
|
||
|
>
|
||
|
</input>
|
||
|
</div>
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default BooleanField
|