feat: remplace le lien de retour à la liste par un bouton
parent
2a81a897cf
commit
0b415583ce
|
@ -1,17 +1,18 @@
|
|||
import {useLoaderData, useParams} from "react-router";
|
||||
import {useLoaderData, useNavigate, 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 navigate = useNavigate()
|
||||
|
||||
const resistant = resistants.find(r => r.noms === nomResistant)
|
||||
|
||||
if (!resistant) return <>Résistant introuvable</>
|
||||
|
||||
return <>
|
||||
<Link to="/">Retour à la liste des résistants</Link>
|
||||
<button onClick={() => navigate("/")}>Tous les résistants</button>
|
||||
<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"
|
||||
|
|
Loading…
Reference in New Issue