2018-10-21 17:06:04 +00:00
|
|
|
import React from 'react'
|
2018-11-11 21:54:17 +00:00
|
|
|
import { connect } from 'react-redux'
|
|
|
|
import { isEmpty } from 'ramda'
|
2018-11-11 15:58:34 +00:00
|
|
|
import Answers from 'Components/AnswerList'
|
|
|
|
import Conversation from 'Components/conversation/Conversation'
|
|
|
|
import withColours from 'Components/utils/withColours'
|
|
|
|
import Targets from 'Components/Targets'
|
2018-11-11 21:54:17 +00:00
|
|
|
import './GenericSimulation.css'
|
2018-10-21 17:06:04 +00:00
|
|
|
|
2018-11-11 15:58:34 +00:00
|
|
|
@withColours
|
2018-11-11 21:54:17 +00:00
|
|
|
@connect(state => ({
|
|
|
|
previousAnswers: state.conversationSteps.foldedSteps
|
|
|
|
}))
|
2018-11-11 15:58:34 +00:00
|
|
|
export default class YO extends React.Component {
|
|
|
|
state = {
|
|
|
|
displayAnswers: false
|
|
|
|
}
|
|
|
|
render() {
|
2018-11-11 21:54:17 +00:00
|
|
|
let colours = this.props.colours
|
2018-11-11 15:58:34 +00:00
|
|
|
return (
|
2018-11-11 21:54:17 +00:00
|
|
|
<div className="ui__ container" id="GenericSimulation">
|
|
|
|
<h1>Quel est l'impact de vos douches ? </h1>
|
|
|
|
{!isEmpty(this.props.previousAnswers) && (
|
|
|
|
<button
|
|
|
|
style={{ background: colours.colour, color: colours.textColour }}
|
|
|
|
onClick={() => this.setState({ displayAnswers: true })}>
|
|
|
|
Mes réponses
|
|
|
|
</button>
|
|
|
|
)}
|
2018-11-11 15:58:34 +00:00
|
|
|
|
|
|
|
{this.state.displayAnswers && (
|
|
|
|
<Answers onClose={() => this.setState({ displayAnswers: false })} />
|
|
|
|
)}
|
|
|
|
<Conversation
|
|
|
|
textColourOnWhite={this.props.colours.textColourOnWhite}
|
|
|
|
/>
|
|
|
|
<Targets />
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|