Merge pull request #18 from SundownDEV/devFront

Update modal opening condition
pull/21/head
Rémi Doreau 2018-06-06 09:34:39 +02:00 committed by GitHub
commit 0fe2b74fa4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -43,7 +43,9 @@ class App extends Component {
closeModal() { closeModal() {
this.setState({ this.setState({
pastQuestion: null,
modalIsOpen: false, modalIsOpen: false,
pastResponse: null,
start: true, start: true,
score: 0 score: 0
}); });
@ -56,8 +58,7 @@ class App extends Component {
} }
_handleClick(element) { _handleClick(element) {
console.log(element.child +" "+this.state.currentQuestion); if(element.child !== element.question) {
if(element.child !== this.state.currentQuestion || element.child !== null || element.child !== undefined) {
this.setState({ this.setState({
pastQuestion: this.state.currentQuestion , pastQuestion: this.state.currentQuestion ,
pastResponse: element.text, pastResponse: element.text,
@ -141,7 +142,7 @@ class App extends Component {
<div className="jumbotron"> <div className="jumbotron">
<div className="currentSection vertical-center container"> <div className="currentSection vertical-center container">
<h1 className="currentState">{this.state.currentQuestion}</h1> <h1 className="currentState">{this.state.currentQuestion}</h1>
<img src={this.state.currentSticker} height="42" width="42" /> <img src={this.state.currentSticker} height="92" width="92" />
<h2 className="currentQuestion">Je fais quoi ?</h2> <h2 className="currentQuestion">Je fais quoi ?</h2>
<div className="currentOptions"> <div className="currentOptions">
{this.state.currentResponses ? currentOptions : null} {this.state.currentResponses ? currentOptions : null}