35 lines
854 B
JavaScript
35 lines
854 B
JavaScript
import { Component } from "react";
|
|
|
|
class Ready extends Component {
|
|
|
|
constructor(props) {
|
|
super(props);
|
|
this.state = {
|
|
text: "Расставь корабли чтобы активировать",
|
|
disabled: true,
|
|
parent: props.parent
|
|
}
|
|
}
|
|
|
|
update() {
|
|
if (!this.props.ok) {
|
|
this.setState({
|
|
text: "Расставь корабли чтобы активировать",
|
|
disabled: true
|
|
})
|
|
}
|
|
else {
|
|
this.setState({
|
|
text: "Я готов",
|
|
disabled: false
|
|
})
|
|
}
|
|
}
|
|
|
|
render() {
|
|
return <button onClick={this.props.onClick} className='main' disabled={this.props.disabled}><p>{this.props.text}</p></button>
|
|
}
|
|
|
|
}
|
|
|
|
export default Ready; |