2018-07-12 08:09:41 +00:00
|
|
|
import withColours from 'Components/utils/withColours'
|
2018-02-28 16:45:13 +00:00
|
|
|
import React, { Component } from 'react'
|
2018-07-12 08:09:41 +00:00
|
|
|
import { Trans } from 'react-i18next'
|
2018-06-06 16:17:13 +00:00
|
|
|
import { connect } from 'react-redux'
|
2018-07-06 15:03:16 +00:00
|
|
|
import { Link } from 'react-router-dom'
|
2018-07-03 16:28:45 +00:00
|
|
|
import { animated, Spring } from 'react-spring'
|
2018-06-29 16:14:00 +00:00
|
|
|
import {
|
2018-07-03 16:28:45 +00:00
|
|
|
blockingInputControlsSelector,
|
2018-07-06 16:25:59 +00:00
|
|
|
nextStepsSelector,
|
2018-07-03 16:28:45 +00:00
|
|
|
noUserInputSelector
|
2018-06-29 16:14:00 +00:00
|
|
|
} from 'Selectors/analyseSelectors'
|
2018-07-12 08:09:41 +00:00
|
|
|
import * as Animate from 'Ui/animate'
|
2018-03-01 18:07:40 +00:00
|
|
|
import Conversation from './conversation/Conversation'
|
2018-07-12 08:09:41 +00:00
|
|
|
import Distribution from './Distribution'
|
|
|
|
import PaySlip from './PaySlip'
|
2018-07-23 14:26:11 +00:00
|
|
|
import QuickLink from './QuickLink'
|
2018-06-18 09:54:18 +00:00
|
|
|
import './Simu.css'
|
|
|
|
import TargetSelection from './TargetSelection'
|
2018-06-06 16:17:13 +00:00
|
|
|
|
2018-02-28 16:45:13 +00:00
|
|
|
@withColours
|
2018-07-03 16:28:45 +00:00
|
|
|
@connect(
|
|
|
|
state => ({
|
|
|
|
noUserInput: noUserInputSelector(state),
|
|
|
|
blockingInputControls: blockingInputControlsSelector(state),
|
2018-07-06 16:25:59 +00:00
|
|
|
conversationStarted: state.conversationStarted,
|
|
|
|
nextSteps: state.conversationStarted && nextStepsSelector(state)
|
2018-07-03 16:28:45 +00:00
|
|
|
}),
|
|
|
|
{
|
2018-07-23 14:26:11 +00:00
|
|
|
startConversation: () => ({ type: 'START_CONVERSATION' })
|
2018-07-03 16:28:45 +00:00
|
|
|
}
|
|
|
|
)
|
2018-06-12 10:21:36 +00:00
|
|
|
export default class Simu extends Component {
|
2018-02-28 16:45:13 +00:00
|
|
|
render() {
|
2018-06-29 16:14:00 +00:00
|
|
|
let {
|
|
|
|
colours,
|
|
|
|
conversationStarted,
|
|
|
|
noUserInput,
|
2018-07-06 16:25:59 +00:00
|
|
|
nextSteps,
|
2018-07-23 14:26:11 +00:00
|
|
|
startConversation,
|
2018-07-03 10:19:19 +00:00
|
|
|
blockingInputControls
|
2018-06-29 16:14:00 +00:00
|
|
|
} = this.props
|
2018-07-06 16:25:59 +00:00
|
|
|
const firstValidInputEntered =
|
|
|
|
!conversationStarted && !blockingInputControls && !noUserInput
|
2018-07-03 16:28:45 +00:00
|
|
|
const displayConversation = conversationStarted && !blockingInputControls
|
2018-07-06 16:25:59 +00:00
|
|
|
const simulationCompleted =
|
|
|
|
!blockingInputControls && conversationStarted && !nextSteps.length
|
|
|
|
|
2018-02-28 16:45:13 +00:00
|
|
|
return (
|
2018-07-03 16:28:45 +00:00
|
|
|
<>
|
|
|
|
<div id="simu">
|
|
|
|
<Spring
|
|
|
|
to={{
|
2018-07-06 16:25:59 +00:00
|
|
|
height: firstValidInputEntered ? 'auto' : 0,
|
|
|
|
opacity: firstValidInputEntered ? 1 : 0
|
2018-07-03 16:28:45 +00:00
|
|
|
}}
|
|
|
|
native>
|
|
|
|
{styles => (
|
|
|
|
<animated.div
|
2018-07-12 08:09:41 +00:00
|
|
|
className="ui__ button-container"
|
2018-07-03 16:28:45 +00:00
|
|
|
style={{
|
|
|
|
...styles,
|
|
|
|
display: 'flex',
|
|
|
|
overflow: 'hidden',
|
|
|
|
flexWrap: 'wrap',
|
|
|
|
fontSize: '110%',
|
2018-07-03 16:57:12 +00:00
|
|
|
justifyContent: 'space-evenly'
|
2018-07-03 16:28:45 +00:00
|
|
|
}}>
|
2018-07-23 14:26:11 +00:00
|
|
|
<QuickLink />
|
2018-07-03 16:28:45 +00:00
|
|
|
</animated.div>
|
|
|
|
)}
|
|
|
|
</Spring>
|
2018-07-12 08:09:41 +00:00
|
|
|
{conversationStarted &&
|
|
|
|
!nextSteps.length && (
|
|
|
|
<>
|
2018-07-23 14:26:11 +00:00
|
|
|
<h1>No more questions left!</h1>
|
2018-07-12 08:09:41 +00:00
|
|
|
<p>
|
|
|
|
<Trans>
|
2018-07-23 14:26:11 +00:00
|
|
|
You have reached the most accurate estimate. You can now
|
|
|
|
turn your hiring project into reality.
|
2018-07-12 08:09:41 +00:00
|
|
|
</Trans>
|
|
|
|
</p>
|
|
|
|
<div style={{ textAlign: 'center' }}>
|
|
|
|
<Link className="ui__ button" to="/hiring-process">
|
2018-07-23 14:26:11 +00:00
|
|
|
See the procedures
|
2018-07-12 08:09:41 +00:00
|
|
|
</Link>
|
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
)}
|
2018-07-03 16:28:45 +00:00
|
|
|
<div id="focusZone">
|
|
|
|
{displayConversation && (
|
2018-07-03 13:11:25 +00:00
|
|
|
<>
|
|
|
|
<Conversation textColourOnWhite={colours.textColourOnWhite} />
|
|
|
|
</>
|
|
|
|
)}
|
2018-07-03 16:28:45 +00:00
|
|
|
<TargetSelection colours={colours} />
|
|
|
|
</div>
|
2018-07-06 16:25:59 +00:00
|
|
|
{conversationStarted &&
|
|
|
|
!simulationCompleted && (
|
|
|
|
<div style={{ textAlign: 'center' }}>
|
|
|
|
<Link className="ui__ button" to="/hiring-process">
|
|
|
|
Go to the hiring process
|
|
|
|
</Link>
|
|
|
|
</div>
|
|
|
|
)}
|
2018-07-12 08:09:41 +00:00
|
|
|
{simulationCompleted && (
|
|
|
|
<Animate.fromBottom>
|
|
|
|
<h2>Detailed payslip</h2>
|
|
|
|
<PaySlip />
|
|
|
|
</Animate.fromBottom>
|
|
|
|
)}
|
2018-03-15 14:51:39 +00:00
|
|
|
</div>
|
2018-07-03 16:28:45 +00:00
|
|
|
|
2018-07-06 16:25:59 +00:00
|
|
|
{firstValidInputEntered && (
|
2018-07-03 16:28:45 +00:00
|
|
|
<Animate.fromBottom>
|
|
|
|
<h2>What's included in my contributions?</h2>
|
|
|
|
<Distribution />
|
|
|
|
<h2>Estimate my real costs</h2>
|
|
|
|
<p>
|
|
|
|
This is a <strong>rough estimate</strong> based on a pre-made
|
|
|
|
generic contract. French legislation provides for a multitude of
|
|
|
|
special cases, and specific rules that can considerably change
|
|
|
|
hiring costs.
|
|
|
|
</p>
|
|
|
|
<p style={{ textAlign: 'center' }}>
|
2018-07-23 14:26:11 +00:00
|
|
|
<button className="ui__ button" onClick={startConversation}>
|
2018-07-03 16:28:45 +00:00
|
|
|
Estimate my real costs
|
|
|
|
</button>
|
|
|
|
</p>
|
|
|
|
</Animate.fromBottom>
|
|
|
|
)}
|
|
|
|
</>
|
2018-02-28 16:45:13 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|