import { startConversation } from 'Actions/actions' import AnswerList from 'Components/AnswerList' import { ScrollToTop } from 'Components/utils/Scroll' import withColours from 'Components/utils/withColours' import withLanguage from 'Components/utils/withLanguage' import { compose } from 'ramda' import {React, Component, T} from 'Components' import { Trans, withNamespaces } from 'react-i18next' import { connect } from 'react-redux' import { Redirect, withRouter } from 'react-router' import { Link } from 'react-router-dom' import { blockingInputControlsSelector, nextStepsSelector, noUserInputSelector, validInputEnteredSelector } from 'Selectors/analyseSelectors' import * as Animate from 'Ui/animate' import sitePaths from '../sites/mycompanyinfrance.fr/sitePaths' import { normalizeBasePath } from '../utils' import Conversation from './conversation/Conversation' import Distribution from './Distribution' import PageFeedback from './Feedback/PageFeedback' import PaySlip from './PaySlip' import PeriodSwitch from './PeriodSwitch' import QuickLink from './QuickLink' import ResultView from './ResultView' import './Simu.css' import TargetSelection from './TargetSelection' import { formValueSelector } from 'redux-form' import emoji from 'react-easy-emoji' export default compose( withRouter, withColours, withNamespaces(), // Triggers rerender when the language changes connect( state => ({ blockingInputControls: blockingInputControlsSelector(state), conversationStarted: state.conversationStarted, validInputEntered: validInputEnteredSelector(state), arePreviousAnswers: state.conversationSteps.foldedSteps.length !== 0, nextSteps: state.conversationStarted && nextStepsSelector(state), noUserInput: noUserInputSelector(state), period: formValueSelector('conversation')(state, 'période') }), { startConversation } ), withLanguage )( class Simulation extends Component { state = { displayPreviousAnswers: false } render() { let { colours, conversationStarted, arePreviousAnswers, nextSteps, startConversation, blockingInputControls, displayHiringProcedures, match, validInputEntered, location, period, noUserInput } = this.props const displayConversation = conversationStarted && !blockingInputControls const simulationCompleted = !blockingInputControls && conversationStarted && !nextSteps.length const displayPreviousAnswers = arePreviousAnswers && this.state.displayPreviousAnswers const simulationHomePath = normalizeBasePath(match.path).replace( /\/simulation\/$/, '' ) return ( <>
{emoji('🌟')}
> )}