mirror of
https://github.com/maputnik/editor.git
synced 2025-12-29 09:30:01 +00:00
Restructure and rename components
This commit is contained in:
28
src/components/fields/BooleanField.jsx
Normal file
28
src/components/fields/BooleanField.jsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import React from 'react'
|
||||
import input from '../../config/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,
|
||||
style: React.PropTypes.object,
|
||||
}
|
||||
|
||||
render() {
|
||||
return <input
|
||||
type="checkbox"
|
||||
style={{
|
||||
...input.checkbox,
|
||||
...this.props.style
|
||||
}}
|
||||
value={this.props.value}
|
||||
onChange={e => {this.props.onChange(!this.props.value)}}
|
||||
checked={this.props.value}
|
||||
>
|
||||
</input>
|
||||
}
|
||||
}
|
||||
|
||||
export default BooleanField
|
||||
Reference in New Issue
Block a user