mon-entreprise/source/components/Simu.js

52 lines
1.4 KiB
JavaScript
Raw Normal View History

import React, { Component } from 'react'
2018-06-06 16:17:13 +00:00
import { connect } from 'react-redux'
import {
noUserInputSelector,
analysisWithDefaultsSelector
} from 'Selectors/analyseSelectors'
import Conversation from './conversation/Conversation'
2018-03-15 14:51:39 +00:00
import FoldedSteps, { GoToAnswers } from './conversation/FoldedSteps'
import GoToExplanations from './GoToExplanations'
import ProgressTip from './ProgressTip'
import ResultView from './ResultView/ResultView'
import './Simu.css'
2018-05-02 15:55:25 +00:00
import Sondage from './Sondage'
import TargetSelection from './TargetSelection'
import withColours from './withColours'
2018-06-06 16:17:13 +00:00
@withColours
2018-06-06 16:17:13 +00:00
@connect(state => ({
2018-06-15 18:09:43 +00:00
noUserInput: noUserInputSelector(state),
analysis: analysisWithDefaultsSelector(state),
2018-06-06 16:17:13 +00:00
conversationStarted: state.conversationStarted
}))
export default class Simu extends Component {
render() {
let {
colours,
conversationStarted,
noUserInput,
analysis: { blockingInputControls }
} = this.props
return (
2018-04-05 17:53:01 +00:00
<div id="simu">
2018-03-15 14:51:39 +00:00
<div id="focusZone">
<FoldedSteps />
2018-06-15 18:09:43 +00:00
<GoToAnswers />
2018-03-22 16:41:45 +00:00
<TargetSelection colours={colours} />
2018-06-06 16:17:13 +00:00
{conversationStarted && (
<>
<ProgressTip />
<Conversation textColourOnWhite={colours.textColourOnWhite} />
</>
2018-06-06 16:17:13 +00:00
)}
{!noUserInput && !blockingInputControls && <GoToExplanations />}
2018-03-15 14:51:39 +00:00
</div>
{!noUserInput && !blockingInputControls && <ResultView />}
{!blockingInputControls && <Sondage />}
2018-04-05 17:53:01 +00:00
</div>
)
}
}