mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-15 08:34:43 +01:00
enable grasscutter checkbox
This commit is contained in:
@@ -1,15 +1,32 @@
|
||||
import React from 'react'
|
||||
|
||||
interface IProps {
|
||||
|
||||
label: string
|
||||
}
|
||||
|
||||
interface IState {
|
||||
|
||||
checked: boolean
|
||||
}
|
||||
|
||||
export default class Checkbox extends React.Component<IProps, IState> {
|
||||
constructor(props: IProps) {
|
||||
super(props)
|
||||
|
||||
this.state = {
|
||||
checked: false,
|
||||
}
|
||||
}
|
||||
|
||||
handleChange = () => {
|
||||
this.setState({ checked: !this.state.checked })
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="Checkbox">
|
||||
<input type="checkbox" onChange={this.handleChange} />
|
||||
<label>{this.props.label}</label>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user