feat: ajoute un bouton de retour à la liste des résistants

proto-module-actu-react
Jalil Arfaoui 2023-01-30 02:01:57 +01:00
parent 6285087e4f
commit 74006ce8a8
1 changed files with 7 additions and 3 deletions

View File

@ -1,15 +1,18 @@
import {useLoaderData, useParams} from "react-router";
import {Link} from "react-router-dom";
import {Resistant} from "../Resistant";
export const PageResistant = () => {
const { nomResistant } = useParams()
const { resistants } = useLoaderData() as { resistants: Resistant[] }
const {nomResistant} = useParams()
const {resistants} = useLoaderData() as { resistants: Resistant[] }
const resistant = resistants.find(r => r.noms === nomResistant)
if (!resistant) return <>Résistant introuvable</>
return <div className="row sqs-row">
return <>
<Link to="/">Retour à la liste des résistants</Link>
<div className="row sqs-row">
<div className="col sqs-col-4 span-4" id="yui_3_17_2_1_1674987238932_138">
<div className="sqs-block image-block sqs-block-image sqs-text-ready" data-block-type="5"
id="block-yui_3_17_2_1_1662985860031_30104">
@ -90,4 +93,5 @@ export const PageResistant = () => {
</div>
</div>
</div>
</>
}