diff --git a/source/components/Simu.js b/source/components/Simu.js index 4b513ae4e..071376397 100644 --- a/source/components/Simu.js +++ b/source/components/Simu.js @@ -29,10 +29,11 @@ import './Simu.css' import TargetSelection from './TargetSelection' import { formValueSelector } from 'redux-form' import emoji from 'react-easy-emoji' -import SimulationDecorator from 'Components/simulationConfig/SimulationDecorator' +import withSimulationConfig from 'Components/simulationConfigs/withSimulationConfig'; +import salariéConfig from 'Components/simulationConfigs/salarié.yaml'; export default compose( - SimulationDecorator, + withSimulationConfig(salariéConfig), withRouter, withColours, withNamespaces(), // Triggers rerender when the language changes diff --git a/source/components/simulationConfigs/SimulationDecorator.js b/source/components/simulationConfigs/withSimulationConfig.js similarity index 69% rename from source/components/simulationConfigs/SimulationDecorator.js rename to source/components/simulationConfigs/withSimulationConfig.js index f1758fc2a..66cbcf616 100644 --- a/source/components/simulationConfigs/SimulationDecorator.js +++ b/source/components/simulationConfigs/withSimulationConfig.js @@ -1,5 +1,4 @@ import React from 'react' -import { Helmet } from 'react-helmet' import { connect } from 'react-redux' export default config => SimulationComponent => @@ -15,15 +14,7 @@ export default config => SimulationComponent => } render() { if (!this.props.simulationConfig) return null - return ( - <> - - TITRE PAGE - -

Titre HTML

- - - ) + return } } ) diff --git a/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/SchemeComparaison.js b/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/SchemeComparaison.js index 3fac74311..e6d4f7104 100644 --- a/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/SchemeComparaison.js +++ b/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/SchemeComparaison.js @@ -1,33 +1,24 @@ import ComparativeSimulation from 'Components/ComparativeSimulation' +import ComparaisonConfig from 'Components/simulationConfigs/rémunération-dirigeant.yaml' +import withSimulationConfig from 'Components/simulationConfigs/withSimulationConfig' import React from 'react' import { Helmet } from 'react-helmet' -import { connect } from 'react-redux' -import config from 'Components/simulationConfigs/rémunération-dirigeant.yaml' -export default connect( - state => ({ simulationConfig: state.simulationConfig }), - dispatch => ({ - setSimulation: () => dispatch({ type: 'SET_SIMULATION_CONFIG', config }) - }) -)( - class SchemeComparaisonPage extends React.Component { - componentDidMount() { - this.props.setSimulation() - } - render() { - if (!this.props.simulationConfig) return null - return ( - <> - - - Assimilé salarié, indépendant, micro-entreprise : comparaison des - différents régimes - - -

Comparaison des différents régimes de cotisation

- - - ) - } - } +const Simulation = withSimulationConfig(ComparaisonConfig)( + ComparativeSimulation ) + +const SchemeComparaisonPage = () => ( + <> + + + Assimilé salarié, indépendant, micro-entreprise : comparaison des + différents régimes + + +

Comparaison des différents régimes de cotisation

+ + +) + +export default SchemeComparaisonPage