feat: ajoute un bouton de retour à la liste des résistants
parent
6285087e4f
commit
74006ce8a8
|
@ -1,15 +1,18 @@
|
||||||
import {useLoaderData, useParams} from "react-router";
|
import {useLoaderData, useParams} from "react-router";
|
||||||
|
import {Link} from "react-router-dom";
|
||||||
import {Resistant} from "../Resistant";
|
import {Resistant} from "../Resistant";
|
||||||
|
|
||||||
export const PageResistant = () => {
|
export const PageResistant = () => {
|
||||||
const { nomResistant } = useParams()
|
const {nomResistant} = useParams()
|
||||||
const { resistants } = useLoaderData() as { resistants: Resistant[] }
|
const {resistants} = useLoaderData() as { resistants: Resistant[] }
|
||||||
|
|
||||||
const resistant = resistants.find(r => r.noms === nomResistant)
|
const resistant = resistants.find(r => r.noms === nomResistant)
|
||||||
|
|
||||||
if (!resistant) return <>Résistant introuvable</>
|
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="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"
|
<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">
|
id="block-yui_3_17_2_1_1662985860031_30104">
|
||||||
|
@ -90,4 +93,5 @@ export const PageResistant = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</>
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue