mirror of
https://github.com/maputnik/editor.git
synced 2026-02-09 22:20:03 +00:00
Adds lint to CI and fixes errors. I'm not sure I'm fully proud of all the solutions there. But there's no lint issues and the lint is being checked as part of the CI. --------- Co-authored-by: Yuri Astrakhan <yuriastrakhan@gmail.com>
37 lines
924 B
TypeScript
37 lines
924 B
TypeScript
import React from 'react'
|
|
|
|
export type InputCheckboxProps = {
|
|
value?: boolean
|
|
style?: object
|
|
onChange(...args: unknown[]): unknown
|
|
};
|
|
|
|
export default class InputCheckbox extends React.Component<InputCheckboxProps> {
|
|
static defaultProps = {
|
|
value: false,
|
|
}
|
|
|
|
onChange = () => {
|
|
this.props.onChange(!this.props.value);
|
|
}
|
|
|
|
render() {
|
|
return <div className="maputnik-checkbox-wrapper">
|
|
<input
|
|
className="maputnik-checkbox"
|
|
type="checkbox"
|
|
style={this.props.style}
|
|
onChange={this.onChange}
|
|
onClick={this.onChange}
|
|
checked={this.props.value}
|
|
/>
|
|
<div className="maputnik-checkbox-box">
|
|
<svg style={{
|
|
display: this.props.value ? 'inline' : 'none'
|
|
}} className="maputnik-checkbox-icon" viewBox='0 0 32 32'>
|
|
<path d='M1 14 L5 10 L13 18 L27 4 L31 8 L13 26 z' />
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
}
|
|
} |