📎 Ajoute un lien vers le simulateur Embaucher

Sur la page « formalités d'embauches »
Fixes #1175
pull/1538/head
Maxime Quandalle 2021-05-07 12:06:02 +02:00
parent 1052739d95
commit 76e8563603
2 changed files with 35 additions and 17 deletions

View File

@ -4,6 +4,7 @@ import {
} from 'Actions/hiringChecklistAction'
import Animate from 'Components/ui/animate'
import { CheckItem, Checklist, ChecklistProps } from 'Components/ui/Checklist'
import { SimulatorRessourceCard } from '../Simulateurs/Page'
import { Helmet } from 'react-helmet'
import { Trans, useTranslation } from 'react-i18next'
import { connect, useSelector } from 'react-redux'
@ -216,6 +217,14 @@ function Embaucher({ onChecklistInitialization, onItemCheck }: EmbaucherProps) {
<li>Remettre la fiche de paie à votre employé</li>
</ul>
</Trans>
<h2 className="ui__ h h3">
<Trans>Ressources utiles</Trans>
</h2>
<div className="ui__ box-container">
<SimulatorRessourceCard simulatorId="salarié" />
</div>
</Animate.fromBottom>
)
}

View File

@ -103,7 +103,6 @@ type NextStepsProps = Pick<
function NextSteps({ iframePath, nextSteps }: NextStepsProps) {
const sitePaths = useContext(SitePathsContext)
const simulators = useSimulatorsData()
const { language } = useTranslation().i18n
const engine = useEngine()
@ -140,22 +139,7 @@ function NextSteps({ iframePath, nextSteps }: NextStepsProps) {
</a>
)}
{nextSteps?.map((simulatorId) => (
<Link
key={simulatorId}
className="ui__ interactive card lighter-bg box thinner"
to={{
state: { fromSimulateurs: true },
pathname: simulators[simulatorId].path,
}}
>
<h3 className="ui__ h h5">
<Emoji emoji={simulators[simulatorId].icône} />{' '}
{simulators[simulatorId].shortName}
</h3>
<p className="ui__ notice">
{simulators[simulatorId].meta?.description}
</p>
</Link>
<SimulatorRessourceCard key={simulatorId} simulatorId={simulatorId} />
))}
{iframePath && (
<Link
@ -181,6 +165,31 @@ function NextSteps({ iframePath, nextSteps }: NextStepsProps) {
)
}
type SimulatorRessourceCardProps = {
simulatorId: keyof SimulatorData
}
export function SimulatorRessourceCard({
simulatorId,
}: SimulatorRessourceCardProps) {
const simulators = useSimulatorsData()
return (
<Link
className="ui__ interactive card lighter-bg box thinner"
to={{
state: { fromSimulateurs: true },
pathname: simulators[simulatorId].path,
}}
>
<h3 className="ui__ h h5">
<Emoji emoji={simulators[simulatorId].icône} />{' '}
{simulators[simulatorId].shortName}
</h3>
<p className="ui__ notice">{simulators[simulatorId].meta?.description}</p>
</Link>
)
}
const guidesUrssaf = [
{
url: