👽 Ajoute la traduction de toutes les URLs

pull/418/head
Johan Girod 2018-11-09 12:36:29 +01:00
parent 137c2a063e
commit 0f2a2c01d4
23 changed files with 431 additions and 234 deletions

View File

@ -11,6 +11,7 @@ import type {
} from 'Types/companyTypes'
import type { RouterHistory } from 'react-router'
import { nextQuestionUrlSelector } from 'Selectors/companyStatusSelectors'
import sitePaths from '../sites/mycompanyinfrance.fr/sitePaths';
const thenGoToNextQuestion = actionCreator => (...args: any) => (
dispatch: any => void,
@ -66,5 +67,5 @@ export const goToCompanyStatusChoice = () => (
type: 'RESET_COMPANY_STATUS_CHOICE'
}: ResetCompanyStatusAction)
)
history.push('/company')
history.push(sitePaths().entreprise.index)
}

View File

@ -1,12 +1,13 @@
import React from 'react'
import './Controls.css'
import emoji from 'react-easy-emoji'
import { connect } from 'react-redux'
import { startConversation, hideControl } from 'Actions/actions'
import { hideControl, startConversation } from 'Actions/actions'
import withLanguage from 'Components/utils/withLanguage'
import { makeJsx } from 'Engine/evaluation'
import { createMarkdownDiv } from 'Engine/marked'
import { compose } from 'ramda'
import React from 'react'
import emoji from 'react-easy-emoji'
import { connect } from 'react-redux'
import './Controls.css'
import withColours from './utils/withColours'
import withLanguage from 'Components/utils/withLanguage'
function Controls({
blockingInputControls,
@ -41,7 +42,9 @@ function Controls({
<li
key={test}
className="control"
style={{ background: colours.lightenColour(45) }}>
style={{
background: colours.lighterColour
}}>
{emoji(level == 'avertissement' ? '⚠️' : '')}
<div className="controlText">
{message && createMarkdownDiv(message)}
@ -79,14 +82,18 @@ function Controls({
)
}
export default connect(
(state, props) => ({
foldedSteps: state.conversationSteps.foldedSteps,
key: props.language,
hiddenControls: state.hiddenControls
}),
dispatch => ({
startConversation: cible => dispatch(startConversation(cible)),
hideControl: id => dispatch(hideControl(id))
})
)(withColours(withLanguage(Controls)))
export default compose(
connect(
(state, props) => ({
foldedSteps: state.conversationSteps.foldedSteps,
key: props.language,
hiddenControls: state.hiddenControls
}),
dispatch => ({
startConversation: cible => dispatch(startConversation(cible)),
hideControl: id => dispatch(hideControl(id))
})
),
withColours,
withLanguage
)(Controls)

View File

@ -15,6 +15,7 @@ import {
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'
@ -118,7 +119,9 @@ class Simulation extends Component {
</p>
{this.props.displayHiringProcedures && (
<div style={{ textAlign: 'center' }}>
<Link className="ui__ button" to="/hiring-process">
<Link
className="ui__ button"
to={sitePaths().démarcheEmbauche}>
<Trans i18nKey="simulation-end.cta">
Connaître les démarches
</Trans>

View File

@ -10,6 +10,7 @@ export default forcedThemeColour => {
colour = forcedThemeColour || defaultColour,
lightColour = lightenColour(colour, 10),
darkColour = lightenColour(colour, -10),
lighterColour = lightenColour(colour, 45),
lightestColour = lightenColour(colour, 100),
darkestColour = lightenColour(colour, -100),
textColour = findContrastedTextColour(colour, true), // the 'simple' version feels better...
@ -22,14 +23,14 @@ export default forcedThemeColour => {
return {
colour,
lightenColour: amount => lightenColour(colour, amount),
textColour,
inverseTextColour,
lighterTextColour,
lighterInverseTextColour,
textColourOnWhite,
lightColour,
darkColour,
lightColour,
lighterColour,
lightestColour,
darkestColour
}

View File

@ -34,4 +34,4 @@ i18next.init(
}
)
export default lang
export default i18next

View File

@ -403,8 +403,12 @@ après:
retour: Creation checklist
avance: Go to social security
sécu: |
<0>Social protection: costs and benefits</0><1>France has chosen to provide its citizens with a high-quality social safety net. This mandatory system is based on solidarity and designed to ensure the <strong>general welfare of its people</2>.</1><2>Easy access to health care and other services ensures that companies can put healthy, productive and highly skilled employees to work in an attractive market in the heart of Europe.</2><3>As soon as you declare and pay your employees, you automatically entitle them to the general scheme of French Social Security (health, maternity, disability, old age, occupational illness and accidents) and unemployment insurance.</3><4><0></0></4><5>How much does it cost to hire ?</5>
sécu:
page:
titre: 'Social security in France: costs and benefits'
description: Découvrez les coûts et avantages de la sécurité sociale française en simulant un cas concret d'embauche dans votre entreprise.
content: |
<0>Social protection: costs and benefits</0><1>France has chosen to provide its citizens with a high-quality social safety net. This mandatory system is based on solidarity and designed to ensure the <strong>general welfare of its people</2>.</1><2>Easy access to health care and other services ensures that companies can put healthy, productive and highly skilled employees to work in an attractive market in the heart of Europe.</2><3>As soon as you declare and pay your employees, you automatically entitle them to the general scheme of French Social Security (health, maternity, disability, old age, occupational illness and accidents) and unemployment insurance.</3><4><0></0></4><5>How much does it cost to hire ?</5>
Votre entreprise: Your company
Protection sociale: Social security
@ -480,3 +484,23 @@ embauche:
Guide du status juridique: Legal status guide
Démarches de création: Creation process checklist
path:
entreprise:
index: '/company'
monEntreprise: '/my-company'
créer: '/create-a-{{companyStatus}}'
trouver: '/find'
après: '/after-registration'
statusJuridique:
index: '/legal-status'
liste: '/list'
gérantMinoritaire: '/chairman-or-managing-director'
responsabilité: '/liability'
statusDirigeant: '/directors-status'
nombreAssociés: '/multiple-associates'
microEntreprise: '/micro-enterprise-or-individual-business'
sécurité sociale:
index: '/social-security'
démarche embauche:
index: '/hiring-process'

View File

@ -17,7 +17,7 @@ import { combineReducers } from 'redux'
import { reducer as formReducer } from 'redux-form'
import computeThemeColours from 'Ui/themeColours'
import { simulationTargetNames } from '../config.js'
import defaultLang from '../i18n'
import i18n from '../i18n'
import inFranceAppReducer from './inFranceAppReducer'
import storageReducer from './storageReducer'
import type { Action } from 'Types/ActionsTypes'
@ -66,7 +66,7 @@ function activeTargetInput(state = null, { type, name }) {
}
}
function lang(state = defaultLang, { type, lang }) {
function lang(state = i18n.language, { type, lang }) {
switch (type) {
case 'SWITCH_LANG':
return lang

View File

@ -12,6 +12,7 @@ import {
pick,
sortBy
} from 'ramda'
import sitePaths from '../sites/mycompanyinfrance.fr/sitePaths'
const LEGAL_STATUS_DETAILS: { [status: string]: CompanyLegalStatus } = {
'Micro-enterprise': {
@ -169,24 +170,10 @@ export const nextQuestionSelector = (state: {
}
export const nextQuestionUrlSelector = (state: { inFranceApp: State }) => {
const questionToUrl = {
multipleAssociates: 'number-of-associates'
}
const paths = sitePaths()
const nextQuestion = nextQuestionSelector(state)
if (!nextQuestion) {
return '/company/legal-status/list'
return paths.entreprise.statusJuridique.liste
}
return `/company/legal-status/${
nextQuestion in questionToUrl
? // $FlowFixMe
questionToUrl[nextQuestion]
: nextQuestion
.replace(/[^a-zA-Z0-9]+/g, '-')
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')
.replace(/([a-z])([A-Z])/g, '$1-$2')
.replace(/([0-9])([^0-9])/g, '$1-$2')
.replace(/([^0-9])([0-9])/g, '$1-$2')
.replace(/-+/g, '-')
.toLowerCase()
}`
return paths.entreprise.statusJuridique[nextQuestion]
}

View File

@ -21,6 +21,7 @@ import CompanyIndex from './pages/Company'
import HiringProcess from './pages/HiringProcess'
import Landing from './pages/Landing'
import SocialSecurity from './pages/SocialSecurity'
import sitePaths from './sitePaths'
if (process.env.NODE_ENV === 'production') {
Raven.config(
@ -66,24 +67,35 @@ class InFranceRoute extends Component {
}
}
let RouterSwitch = translate()(() => (
<Switch>
<Route exact path="/" component={Landing} />
<div className="app-container">
{/* Passing location down to prevent update blocking */}
<Navigation location={location} />
<div className="app-content">
<ProgressHeader />
<div className="ui__ container" style={{ flexGrow: 1, flexShrink: 0 }}>
<Route path="/company" component={CompanyIndex} />
<Route path="/social-security" component={SocialSecurity} />
<Route path="/hiring-process" component={HiringProcess} />
let RouterSwitch = translate()(() => {
const paths = sitePaths()
return (
<Switch>
<Route exact path="/" component={Landing} />
<div className="app-container">
{/* Passing location down to prevent update blocking */}
<Navigation location={location} />
<div className="app-content">
<ProgressHeader />
<div
className="ui__ container"
style={{ flexGrow: 1, flexShrink: 0 }}>
<Route path={paths.entreprise.index} component={CompanyIndex} />
<Route
path={paths.sécuritéSociale.index}
component={SocialSecurity}
/>
<Route
path={paths.démarcheEmbauche.index}
component={HiringProcess}
/>
</div>
<Footer />
</div>
<Footer />
</div>
</div>
</Switch>
))
</Switch>
)
})
let ExportedApp = InFranceRoute

View File

@ -9,6 +9,7 @@ import selectors from 'Selectors/progressSelectors'
import companySvg from '../../images/company.svg'
import estimateSvg from '../../images/estimate.svg'
import hiringSvg from '../../images/hiring.svg'
import sitePaths from '../../sitePaths'
import './Navigation.css'
import NavOpener from './NavOpener'
import SideBar from './SideBar'
@ -44,7 +45,7 @@ const StepsHeader = ({
<ul>
<li>
<NavOpener
to="/company"
to={sitePaths().entreprise.index}
exact={false}
title={
<>
@ -62,36 +63,59 @@ const StepsHeader = ({
<ul>
<li>
<NavOpener
to="/company/legal-status"
to={sitePaths().entreprise.statusJuridique}
title={t('Guide du statut juridique')}>
<ul>
<li>
<NavLink to="/company/legal-status/number-of-associates">
<NavLink
to={
sitePaths().entreprise.statusJuridique
.multipleAssociates
}>
<T>Nombre d'associés</T>
</NavLink>
</li>
<li>
<NavLink to="/company/legal-status/director-status">
<NavLink
to={
sitePaths().entreprise.statusJuridique
.directorStatus
}>
<T>Status du dirigeant</T>
</NavLink>
</li>
<li>
<NavLink to="/company/legal-status/liability">
<NavLink
to={
sitePaths().entreprise.statusJuridique
.liability
}>
<T>Responsabilité</T>
</NavLink>
</li>
<li>
<NavLink to="/company/legal-status/minority-director">
<NavLink
to={
sitePaths().entreprise.statusJuridique
.minorityDirector
}>
<T>Gérant majoritaire ou minoritaire</T>
</NavLink>
</li>
<li>
<NavLink to="/company/legal-status/micro-enterprise">
<NavLink
to={
sitePaths().entreprise.statusJuridique
.microEnterprise
}>
<T>Micro-entreprise ou EI</T>
</NavLink>
</li>
<li>
<NavLink to="/company/legal-status/list">
<NavLink
to={
sitePaths().entreprise.statusJuridique.liste
}>
<T>Liste des status</T>
</NavLink>
</li>
@ -103,45 +127,70 @@ const StepsHeader = ({
<NavOpener
to={
companyStatusChoice
? `/company/create-${companyStatusChoice}`
? sitePaths().entreprise.créer(
companyStatusChoice
)
: null
}
title={t('Démarches de création')}>
<ul>
<li>
<NavLink to="/company/create-micro-enterprise">
<NavLink
to={sitePaths().entreprise.créer(
'micro-enterprise'
)}>
<T>Micro-entreprise</T>
</NavLink>
</li>
<li>
<NavLink to="/company/create-EI">EI</NavLink>
<NavLink to={sitePaths().entreprise.créer('EI')}>
EI
</NavLink>
</li>
<li>
<NavLink to="/company/create-EIRL">EIRL</NavLink>
<NavLink
to={sitePaths().entreprise.créer('EIRL')}>
EIRL
</NavLink>
</li>
<li>
<NavLink to="/company/create-EURL">EURL</NavLink>
<NavLink
to={sitePaths().entreprise.créer('EURL')}>
EURL
</NavLink>
</li>
<li>
<NavLink to="/company/create-SA">SA</NavLink>
<NavLink to={sitePaths().entreprise.créer('SA')}>
SA
</NavLink>
</li>
<li>
<NavLink to="/company/create-SARL">SARL</NavLink>
<NavLink
to={sitePaths().entreprise.créer('SARL')}>
SARL
</NavLink>
</li>
<li>
<NavLink to="/company/create-SAS">SAS</NavLink>
<NavLink to={sitePaths().entreprise.créer('SAS')}>
SAS
</NavLink>
</li>
<li>
<NavLink to="/company/create-SASU">SASU</NavLink>
<NavLink
to={sitePaths().entreprise.créer('SASU')}>
SASU
</NavLink>
</li>
<li>
<NavLink to="/company/create-SNC">SNC</NavLink>
<NavLink to={sitePaths().entreprise.créer('SNC')}>
SNC
</NavLink>
</li>
</ul>
</NavOpener>
</li>
<li>
<NavLink to="/company/after-registration">
<NavLink to={sitePaths().entreprise.après}>
<T k="entreprise.tâches.ensuite">Après la création</T>
</NavLink>
</li>
@ -149,7 +198,7 @@ const StepsHeader = ({
</NavOpener>
</li>
<li>
<NavLink to="/company/find">
<NavLink to={sitePaths().entreprise.trouver}>
<T k="trouver.titre">Trouver mon entreprise</T>
</NavLink>
</li>
@ -157,7 +206,7 @@ const StepsHeader = ({
</NavOpener>
</li>
<li>
<NavLink exact to="/social-security">
<NavLink exact to={sitePaths().sécuritéSociale.index}>
<T>Protection sociale</T>
<img
style={{ height: '2.5rem', marginBottom: '-0.8rem' }}
@ -168,7 +217,7 @@ const StepsHeader = ({
</NavLink>
</li>
<li>
<NavLink to="/hiring-process">
<NavLink to={sitePaths().démarcheEmbauche.index}>
<T>Embauche</T>
<img
style={{ height: '2.5rem', marginBottom: '-0.8rem' }}

View File

@ -1,17 +1,18 @@
/* @flow */
import { React, T } from 'Components'
import withTracker from 'Components/utils/withTracker'
import { compose } from 'ramda'
import { React, T } from 'Components'
import { translate } from 'react-i18next'
import { connect } from 'react-redux'
import { NavLink, withRouter } from 'react-router-dom'
import selectors from 'Selectors/progressSelectors'
import companySvg from '../../images/company.svg'
import estimateSvg from '../../images/estimate.svg'
import hiringSvg from '../../images/hiring.svg'
import sitePaths from '../../sitePaths'
import './ProgressHeader.css'
import type { Tracker } from 'Components/utils/withTracker'
import { translate } from 'react-i18next'
const Progress = ({ percent }) => (
<div className="progress">
@ -38,7 +39,7 @@ const StepsHeader = ({
<header className="steps-header">
<nav className="ui__ container">
<NavLink
to="/company"
to={sitePaths().entreprise.index}
activeClassName="active"
onClick={() =>
tracker.push(['trackEvent', 'Header', 'click', 'Your company'])
@ -50,7 +51,7 @@ const StepsHeader = ({
<Progress percent={companyProgress} />
</NavLink>
<NavLink
to="/social-security"
to={sitePaths().sécuritéSociale.index}
activeClassName="active"
onClick={() =>
tracker.push(['trackEvent', 'Header', 'click', 'Social security'])
@ -63,7 +64,7 @@ const StepsHeader = ({
<Progress percent={estimationProgress} />
</NavLink>
<NavLink
to="/hiring-process"
to={sitePaths().démarcheEmbauche.index}
activeClassName="active"
onClick={() =>
tracker.push(['trackEvent', 'Header', 'click', 'Hiring process'])

View File

@ -5,6 +5,7 @@ import { translate } from 'react-i18next'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import Animate from 'Ui/animate'
import sitePaths from '../../sitePaths'
import siret from './siret.jpg'
import type { TFunction } from 'react-i18next'
@ -82,10 +83,10 @@ const AfterRegistration = ({ t, companyStatusChoice }: Props) => (
</>
)}
<p style={{ display: 'flex', justifyContent: 'space-between' }}>
<Link to="/company" className="ui__ skip-button left">
<Link to={sitePaths().entreprise.index} className="ui__ skip-button left">
<T k="après.actions.retour">Démarche de création</T>
</Link>
<Link to="/social-security" className="ui__ skip-button">
<Link to={sitePaths().sécuritéSociale.index} className="ui__ skip-button">
<T k="après.actions.avance">Sécu et coût d'embauche </T>
</Link>
</p>

View File

@ -13,8 +13,10 @@ import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import * as Animate from 'Ui/animate'
import { CheckItem, Checklist } from 'Ui/Checklist'
import sitePaths from '../../sitePaths'
import StatusDescription from './StatusDescription'
import type { Match } from 'react-router'
import type { TFunction } from 'react-i18next'
type Props = {
@ -36,8 +38,8 @@ const CreateCompany = ({
onStatusChange,
t
}: Props) => {
const status = match.params.status
if (!match.params.status) {
const companyStatus = match.params.status
if (!companyStatus) {
return null
}
return (
@ -45,7 +47,7 @@ const CreateCompany = ({
<Helmet>
<title>
{t(['entreprise.tâches.page.titre', 'Créer une {{companyStatus}}'], {
companyStatus: match.params.status
companyStatus
})}
</title>
<meta
@ -55,15 +57,13 @@ const CreateCompany = ({
'entreprise.tâches.page.description',
`Une liste complète des démarches à faire pour vous aider à créer une {{companyStatus}} auprès de l'administration française.`
],
{ companyStatus: match.params.status }
{ companyStatus }
)}
/>
</Helmet>
<Scroll.toTop />
<h1>
<T k="entreprise.tâches.titre">
Créer une {{ companyStatus: match.params.status }}
</T>
<T k="entreprise.tâches.titre">Créer une {{ companyStatus }}</T>
</h1>
{!statusChooserCompleted && (
<>
@ -76,7 +76,7 @@ const CreateCompany = ({
</button>
</p>
<p>
<StatusDescription status={match.params.status} />
<StatusDescription companyStatus={companyStatus} />
</p>
</>
)}
@ -85,19 +85,19 @@ const CreateCompany = ({
Voici la liste des tâches nécessaires pour créer votre
</T>
&nbsp;
{match.params.status}.
{companyStatus}.
</p>
<h2 style={{ fontSize: '1.5rem' }}>
<T k="entreprise.tâches.titre1">Pour créer votre société</T>
</h2>
<Checklist
key={match.params.status}
key={companyStatus}
onInitialization={items =>
onChecklistInitialization(match.params.status || '', items)
onChecklistInitialization(companyStatus || '', items)
}
onItemCheck={onItemCheck}
defaultChecked={companyCreationChecklist}>
{!['EI', 'EIRL', 'micro-enterprise'].includes(status) && (
{!['EI', 'EIRL', 'micro-enterprise'].includes(companyStatus) && (
<CheckItem
name="corporateName"
title={
@ -139,7 +139,7 @@ const CreateCompany = ({
</p>
}
/>
{status !== 'micro-enterprise' && (
{companyStatus !== 'micro-enterprise' && (
<CheckItem
name="companyAddress"
title={
@ -162,7 +162,7 @@ const CreateCompany = ({
}
/>
)}
{!['EI', 'EIRL', 'micro-enterprise'].includes(status) && (
{!['EI', 'EIRL', 'micro-enterprise'].includes(companyStatus) && (
<CheckItem
name="companyStatus"
title={
@ -177,8 +177,8 @@ const CreateCompany = ({
y a plus d'un associé, il est recommandé de faire appel à un
juriste pour les rédiger.{' '}
</T>
{['SARL', 'EURL'].includes(status) && (
<StatutsExample status={status} />
{['SARL', 'EURL'].includes(companyStatus) && (
<StatutsExample companyStatus={companyStatus} />
)}
</p>
}
@ -196,10 +196,10 @@ const CreateCompany = ({
Le but d'un <strong>compte bancaire d'entreprise</strong> est
de séparer les actifs de l'entreprise des vôtres.
</T>{' '}
{status === 'EI' && (
{companyStatus === 'EI' && (
<T k="entreprise.tâches.banque.EI">
If its opening is not obligatory for an EI, it is strongly
recommended.{' '}
Si son ouverture n'est pas obligatoire pour un IE, elle
reste fortement recommandée.{' '}
</T>
)}
<T k="entreprise.tâches.banque.description.2">
@ -218,7 +218,7 @@ const CreateCompany = ({
</>
}
/>
{!['EI', 'EIRL', 'micro-enterprise'].includes(status) && (
{!['EI', 'EIRL', 'micro-enterprise'].includes(companyStatus) && (
<CheckItem
name="fundsDeposit"
title={
@ -246,7 +246,7 @@ const CreateCompany = ({
}
/>
)}
{!['EI', 'EIRL', 'micro-enterprise'].includes(status) && (
{!['EI', 'EIRL', 'micro-enterprise'].includes(companyStatus) && (
<CheckItem
title={
<T k="entreprise.tâches.journal.titre">
@ -325,7 +325,7 @@ const CreateCompany = ({
</h2>
<Checklist>
{status !== 'micro-enterprise' && (
{companyStatus !== 'micro-enterprise' && (
<CheckItem
name="chooseCertifiedAccountant"
title={
@ -383,7 +383,7 @@ const CreateCompany = ({
<button onClick={onStatusChange} className="ui__ skip-button left">
<T k="entreprise.tâches.retour">Choisir un autre statut</T>
</button>
<Link to={'/company/after-registration'} className="ui__ skip-button">
<Link to={sitePaths().entreprise.après} className="ui__ skip-button">
<T k="entreprise.tâches.ensuite">Après la création</T>
</Link>
</p>
@ -406,9 +406,9 @@ export default compose(
)
)(CreateCompany)
let StatutsExample = ({ status }) => (
let StatutsExample = ({ companyStatus }) => (
<a href="http://media.apce.com/file/72/3/statuts_sarl_(aout_2014).37032.72723.doc">
<T k="entreprise.tâches.statuts.exemple">Exemple de statuts pour votre</T>
{status}
{companyStatus}
</a>
)

View File

@ -1,21 +1,22 @@
/* @flow */
import { saveExistingCompanyDetails } from 'Actions/existingCompanyActions'
import { compose } from 'ramda'
import { React, T } from 'Components'
import { compose } from 'ramda'
import Helmet from 'react-helmet'
import { translate } from 'react-i18next'
import { connect } from 'react-redux'
import { Link, withRouter } from 'react-router-dom'
// $FlowFixMe
import ReactSelect from 'react-select'
// $FlowFixMe
import 'react-select/dist/react-select.css'
import sitePaths from '../../sitePaths'
import './Find.css'
import { CompanyDetails as Company } from './YourCompany'
import type { RouterHistory } from 'react-router'
import { translate } from 'react-i18next'
const goToNextStep = (history: RouterHistory) => {
history.push('/social-security')
history.push(sitePaths().sécuritéSociale.index)
}
type State = {
@ -64,7 +65,7 @@ class Search extends React.Component<Props, State> {
<T k="trouver.titre">Trouver mon entreprise</T>
</h1>
<p>
<Link to="/company">
<Link to={sitePaths().entreprise.index}>
<T k="trouver.non">Je n'ai pas encore d'entreprise</T>
</Link>
</p>

View File

@ -4,6 +4,7 @@ import Helmet from 'react-helmet'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import { nextQuestionUrlSelector } from 'Selectors/companyStatusSelectors'
import sitePaths from '../../sitePaths'
import LegalStatusChoices from './LegalStatusChoice'
import type { Match } from 'react-router'
@ -12,46 +13,49 @@ type Props = {
match: Match,
nextQuestionUrl: string
}
const CreateMyCompany = ({ match, nextQuestionUrl }: Props) => (
<>
<h1 className="question__title">
<T>Créez votre entreprise</T>
</h1>
<Helmet>
<title>Trouvez la bonne forme juridique pour votre entreprise.</title>
<meta
name="description"
content="The French business law defines more than 20 possible legal statuses to
const CreateMyCompany = ({ match, nextQuestionUrl }: Props) =>
console.log(sitePaths()) || (
<>
<h1 className="question__title">
<T>Créez votre entreprise</T>
</h1>
<Helmet>
<title>Trouvez la bonne forme juridique pour votre entreprise.</title>
<meta
name="description"
content="The French business law defines more than 20 possible legal statuses to
declare a company with various acronyms and processes : SAS, SARL, SA,
EIRL... This guide quickly helps you to find the right status for your company project"
/>
</Helmet>
<p>
<Link className="ui__ link-button" to="/company/find">
<T k="entreprise.existeDéjà">Mon entreprise existe déjà</T>
</Link>
</p>
<p>
<T k="formeJuridique.intro">
Le droit des sociétés définit plus de 20 statuts juridiques possibles
pour déclarer une société avec différents acronymes et démarches : SAS,
SARL, SA, EIRL.... Ce guide vous aide à trouver rapidement le statut qui
vous convient.
</T>
</p>
{match.isExact && (
<div className="ui__ answer-group">
<Link className="ui__ button" to={nextQuestionUrl}>
<T>Choisir la forme juridique</T>
/>
</Helmet>
<p>
<Link className="ui__ link-button" to={sitePaths().entreprise.trouver}>
<T k="entreprise.existeDéjà">Mon entreprise existe déjà</T>
</Link>
<Link to={'/social-security'} className="ui__ skip-button">
<T>Plus tard</T>
</Link>
</div>
)}
<LegalStatusChoices />
</>
)
</p>
<p>
<T k="formeJuridique.intro">
Le droit des sociétés définit plus de 20 statuts juridiques possibles
pour déclarer une société avec différents acronymes et démarches :
SAS, SARL, SA, EIRL.... Ce guide vous aide à trouver rapidement le
statut qui vous convient.
</T>
</p>
{match.isExact && (
<div className="ui__ answer-group">
<Link className="ui__ button" to={nextQuestionUrl}>
<T>Choisir la forme juridique</T>
</Link>
<Link
to={sitePaths().sécuritéSociale.index}
className="ui__ skip-button">
<T>Plus tard</T>
</Link>
</div>
)}
<LegalStatusChoices />
</>
)
export default connect(
state => ({ nextQuestionUrl: nextQuestionUrlSelector(state) }),

View File

@ -1,7 +1,7 @@
/* @flow */
import { goToCompanyStatusChoice } from 'Actions/companyStatusActions'
import { isNil } from 'ramda'
import { React, T } from 'Components'
import { isNil } from 'ramda'
import emoji from 'react-easy-emoji'
import { connect } from 'react-redux'
import { capitalise0 } from '../../../../utils'

View File

@ -10,7 +10,9 @@ import type { RouterHistory } from 'react-router'
import {compose} from 'ramda'
import type { LegalStatus } from 'Selectors/companyStatusSelectors'
import withLanguage from 'Components/utils/withLanguage'
import type { TFunction } from 'react-i18next'
import type
{ TFunction } from 'react-i18next'
import sitePaths from '../../sitePaths';
const setMainStatus = () => {}
@ -23,7 +25,7 @@ type Props = {
}
const StatusButton = ({ status }: { status: LegalStatus }) => (
<Link to={`/company/create-${status}`} className="ui__ button">
<Link to={sitePaths().entreprise.créer(status)} className="ui__ button">
<T>Créer une</T> {status}
</Link>
)
@ -135,7 +137,7 @@ const SetMainStatus = ({ history, possibleStatus, t, language }: Props) => {
)}
</ul>
<div className="ui__ answer-group">
<Link to="/social-security" className="ui__ skip-button">
<Link to={sitePaths().sécuritéSociale.index} className="ui__ skip-button">
Choose later
</Link>
</div>

View File

@ -1,11 +1,13 @@
/* @flow */
import { React, T } from 'Components'
import withLanguage from 'Components/utils/withLanguage'
import { toPairs } from 'ramda'
import { React, T } from 'Components'
import { connect } from 'react-redux'
import { Link, Redirect } from 'react-router-dom'
import sitePaths from '../../sitePaths'
import type { ResetExistingCompanyDetailsAction } from 'Types/companyTypes'
let companyDataSelection = {
l1_normalisee: 'Name',
libelle_activite_principale: 'Main activity',
@ -57,18 +59,18 @@ export const CompanyDetails = (data: { [string]: string }) => {
const YourCompany = ({ companyDetails, resetCompanyDetails }) => (
<>
{!companyDetails && <Redirect to="/company" />}
{!companyDetails && <Redirect to={sitePaths().entreprise.index} />}
<h1>
<T>Your company</T>
</h1>
<CompanyDetails {...companyDetails.apiDetails} />
<p>
<Link onClick={resetCompanyDetails} to="/company/find">
<Link onClick={resetCompanyDetails} to={sitePaths().entreprise.trouver}>
This is not my company
</Link>
</p>
<p>
<Link to="/social-security" className="ui__ button">
<Link to={sitePaths().sécuritéSociale.index} className="ui__ button">
Simulate hiring costs
</Link>
</p>

View File

@ -1,8 +1,10 @@
import React from 'react'
import { translate } from 'react-i18next'
import { connect } from 'react-redux'
import { Redirect, Route, Switch } from 'react-router'
import * as Animate from 'Ui/animate'
import { ScrollToElement } from '../../../../components/utils/Scroll'
import sitePaths from '../../sitePaths'
import AfterRegistration from './AfterRegistration'
import CreationChecklist from './CreationChecklist'
import DefineDirectorStatus from './DirectorStatus'
@ -14,8 +16,6 @@ import MinorityDirector from './MinorityDirector'
import NumberOfAssociate from './NumberOfAssociate'
import PickLegalStatus from './PickLegalStatus'
import YourCompany from './YourCompany'
import { translate } from 'react-i18next'
const withAnimation = Component => {
const AnimateRouteComponent = (...props) => (
<ScrollToElement onlyIfNotVisible>
@ -32,63 +32,77 @@ const CreateMyCompany = ({
location,
companyStatusChoice,
existingCompany
}) => (
<>
<Animate.fromBottom>
<Switch>
<Route path={match.path + '/your-company'} component={YourCompany} />
<Route
path={match.path + '/create-:status'}
component={CreationChecklist}
/>
<Route path={match.path + '/find'} component={Find} />
<Route
path={match.path + '/after-registration'}
component={AfterRegistration}
/>
<Route path={match.path + '/legal-status'} component={Home} />
{existingCompany && (
<Redirect exact from={match.path} to={match.path + '/your-company'} />
)}
{companyStatusChoice ? (
<Redirect
exact
from={match.path}
to={match.path + '/create-' + companyStatusChoice}
}) => {
const paths = sitePaths()
return (
<>
<Animate.fromBottom>
<Switch>
<Route
path={paths.entreprise.monEntreprise}
component={YourCompany}
/>
) : (
<Redirect exact from={match.path} to={match.path + '/legal-status'} />
)}
</Switch>
<Switch location={location}>
<Route
path={match.path + '/legal-status/liability'}
component={withAnimation(Liability)}
/>
<Route
path={match.path + '/legal-status/director-status'}
component={withAnimation(DefineDirectorStatus)}
/>
<Route
path={match.path + '/legal-status/micro-enterprise'}
component={withAnimation(Microenterprise)}
/>
<Route
path={match.path + '/legal-status/number-of-associates'}
component={withAnimation(NumberOfAssociate)}
/>
<Route
path={match.path + '/legal-status/minority-director'}
component={withAnimation(MinorityDirector)}
/>
<Route
path={match.path + '/legal-status/list'}
component={withAnimation(PickLegalStatus)}
/>
</Switch>
</Animate.fromBottom>
</>
)
<Route
path={paths.entreprise.créer(':status')}
component={CreationChecklist}
/>
<Route path={paths.entreprise.trouver} component={Find} />
<Route path={paths.entreprise.après} component={AfterRegistration} />
<Route
path={paths.entreprise.statusJuridique.index}
component={Home}
/>
{existingCompany && (
<Redirect
exact
from={match.path}
to={paths.entreprise.monEntreprise}
/>
)}
{companyStatusChoice ? (
<Redirect
exact
from={match.path}
to={paths.entreprise.créer(companyStatusChoice)}
/>
) : (
<Redirect
exact
from={match.path}
to={paths.entreprise.statusJuridique.index}
/>
)}
</Switch>
<Switch location={location}>
<Route
path={paths.entreprise.statusJuridique.liability}
component={withAnimation(Liability)}
/>
<Route
path={paths.entreprise.statusJuridique.directorStatus}
component={withAnimation(DefineDirectorStatus)}
/>
<Route
path={paths.entreprise.statusJuridique.microEnterprise}
component={withAnimation(Microenterprise)}
/>
<Route
path={paths.entreprise.statusJuridique.multipleAssociates}
component={withAnimation(NumberOfAssociate)}
/>
<Route
path={paths.entreprise.statusJuridique.minorityDirector}
component={withAnimation(MinorityDirector)}
/>
<Route
path={paths.entreprise.statusJuridique.liste}
component={withAnimation(PickLegalStatus)}
/>
</Switch>
</Animate.fromBottom>
</>
)
}
export default connect(state => ({
companyStatusChoice: state.inFranceApp.companyStatusChoice,

View File

@ -11,6 +11,7 @@ import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import Animate from 'Ui/animate'
import { CheckItem, Checklist } from 'Ui/Checklist'
import sitePaths from '../sitePaths'
const HiringProcess = ({
onChecklistInitialization,
@ -197,7 +198,7 @@ const HiringProcess = ({
</li>
<li>Remettre la fiche de paie à votre employé</li>
</ul>
<Link className="ui__ button" to="/social-security/simulation">
<Link className="ui__ button" to={sitePaths().sécuritéSociale.simulation}>
Obtenir un exemple de fiche de paie
</Link>
</T>

View File

@ -5,14 +5,14 @@ import marianneSvg from 'Images/marianne.svg'
import urssafSvg from 'Images/urssaf.svg'
import React from 'react'
import emoji from 'react-easy-emoji'
import { Trans, translate } from 'react-i18next'
import { Link } from 'react-router-dom'
import companySvg from '../images/company.svg'
import estimateSvg from '../images/estimate.svg'
import hiringSvg from '../images/hiring.svg'
import Footer from '../layout/Footer/Footer'
import sitePaths from '../sitePaths'
import './Landing.css'
import { Trans } from 'react-i18next'
import { translate } from 'react-i18next'
export default translate()(
withColours(({ colours: { colour } }) => (
@ -35,7 +35,7 @@ export default translate()(
</p>
<Link
className="ui__ inverted-button"
to="/company"
to={sitePaths().entreprise.index}
alt="the first step to create a company">
<Trans>Commencer</Trans>
</Link>
@ -70,7 +70,9 @@ export default translate()(
</ul>
</div>
<p>
<Link className="ui__ skip-button" to="/company">
<Link
className="ui__ skip-button"
to={sitePaths().entreprise.index}>
<Trans i18nKey="accueil.entreprise.action">
Créez votre entreprise
</Trans>
@ -97,7 +99,9 @@ export default translate()(
</ul>
</div>
<p>
<Link className="ui__ skip-button" to="/social-security">
<Link
className="ui__ skip-button"
to={sitePaths().sécuritéSociale.index}>
<Trans i18nKey="accueil.sécu.action">
Découvrez le coût et les avantages
</Trans>
@ -126,7 +130,9 @@ export default translate()(
</ul>
</div>
<p>
<Link className="ui__ skip-button" to="/hiring-process">
<Link
className="ui__ skip-button"
to={sitePaths().démarcheEmbauche.index}>
<Trans i18nKey="accueil.embauche.action">
Découvrez le proccessus d'embauche
</Trans>

View File

@ -1,25 +1,32 @@
/* @flow */
import { Component, React, T } from 'Components'
import Simulateur from 'Components/Simu'
import { ScrollToTop } from 'Components/utils/Scroll'
import { React, Component, T } from 'Components'
import Helmet from 'react-helmet'
import { translate } from 'react-i18next'
import * as Animate from 'Ui/animate'
import type { Match, Location } from 'react-router'
import type { TFunction } from 'react-i18next'
type Props = {
match: Match,
location: Location
location: Location,
t: TFunction
}
class SocialSecurity extends Component<Props, {}> {
render() {
return (
<>
<Helmet>
<title>Social security in France: costs and benefits</title>
<title>
{this.props.t(
'sécu.page.titre',
"Sécurité sociale et coût d'embauche"
)}
</title>
<meta
name="description"
content="Discover the costs and benefits of French social security and protection (welfare) by simulating a concrete case of hiring in your company."
content={this.props.t('sécu.page.description')}
/>
</Helmet>
<ScrollToTop />
@ -75,4 +82,4 @@ class SocialSecurity extends Component<Props, {}> {
}
}
export default SocialSecurity
export default translate()(SocialSecurity)

View File

@ -0,0 +1,74 @@
/* @flow */
import { map } from 'ramda'
import i18n from '../../i18n'
const constructLocalizedSitePath = () =>
constructSitePaths('', {
index: '',
entreprise: {
index: i18n.t('path.entreprise.index', '/entreprise'),
monEntreprise: i18n.t('path.entreprise.monEntreprise', '/mon-entreprise'),
créer: (companyStatus: string) =>
i18n.t(['path.entreprise.créer', '/créer-une-{{companyStatus}}'], {
companyStatus
}),
trouver: i18n.t('path.entreprise.trouver', '/retrouver-mon-entreprise'),
après: i18n.t('path.entreprise.après', '/après-la-création'),
statusJuridique: {
index: i18n.t(
'path.entreprise.statusJuridique.index',
'/status-juridique'
),
liste: i18n.t('path.entreprise.statusJuridique.liste', '/liste'),
liability: i18n.t(
'path.entreprise.statusJuridique.responsabilité',
'/responsabilité'
),
directorStatus: i18n.t(
'path.entreprise.statusJuridique.statusDirigeant',
'/status-du-dirigeant'
),
microEnterprise: i18n.t(
'path.entreprise.statusJuridique.microEntreprise',
'/micro-entreprise-ou-entreprise-individuelle'
),
multipleAssociates: i18n.t(
'path.entreprise.statusJuridique.nombreAssociés',
'/nombre-associés'
),
minorityDirector: i18n.t(
'path.entreprise.statusJuridique.gérantMinoritaire',
'/gérant-majoritaire-ou-minoritaire'
)
}
},
sécuritéSociale: {
index: i18n.t('path.sécuritéSociale', '/sécurité-sociale'),
simulation: '/simulation'
},
démarcheEmbauche: {
index: i18n.t('path.démarcheEmbauche', '/démarches-embauche')
}
})
const constructSitePaths = (
root: string,
{ index, ...sitePaths }: { index: string }
) => ({
index: root + index,
...map(
value =>
typeof value === 'string'
? root + index + value
: typeof value === 'function'
? (...args) => root + index + value(...args)
: constructSitePaths(root + index, value),
sitePaths
)
})
let sitePath = constructLocalizedSitePath()
i18n.on('languageChanged', () => {
sitePath = constructLocalizedSitePath()
})
export default () => sitePath