diff --git a/mon-projet/src/components/carte.jsx b/mon-projet/src/components/carte.jsx index 758064d..adda4ba 100644 --- a/mon-projet/src/components/carte.jsx +++ b/mon-projet/src/components/carte.jsx @@ -1,8 +1,8 @@ import { Link } from "react-router-dom"; function Carte(props) { - Voir les détails; return (
+ Voir les détails

{props.titre}

{props.niveaux}

diff --git a/mon-projet/src/pages/Accueil.jsx b/mon-projet/src/pages/Accueil.jsx index d6295aa..7e46f2d 100644 --- a/mon-projet/src/pages/Accueil.jsx +++ b/mon-projet/src/pages/Accueil.jsx @@ -2,6 +2,7 @@ import { useState } from "react"; import Carte from "../components/carte"; import Header from "../components/Header"; import Footer from "../components/Footer"; +import { useParams } from "react-router-dom"; const initialData = [ { id: 1, @@ -61,47 +62,48 @@ function Accueil() { } const total = Object.values(likes).reduce((s, n) => s + n, 0); - -
-
- <> - - -
+ return ( +
+
+ <> + + + + setNom(e.target.value)} + placeholder="Nom de la trilogie" + /> + setNiveaux(e.target.value)} + placeholder="Niveaux" + /> + + setNom(e.target.value)} - placeholder="Nom de la trilogie" + type="search" + placeholder="Rechercher une trilogie…" + value={recherche} + onChange={(e) => setRecherche(e.target.value)} /> - setNiveaux(e.target.value)} - placeholder="Niveaux" - /> - - - setRecherche(e.target.value)} - /> -

👍 Total de likes : {total}

- {affichees.length === 0 &&

Aucune trilogie trouvée

} - {affichees.map((trilo) => ( - liker(trilo.id)} - /> - ))} -
-
; +

👍 Total de likes : {total}

+ {affichees.length === 0 &&

Aucune trilogie trouvée

} + {affichees.map((trilo) => ( + liker(trilo.id)} + /> + ))} +
+
+ ); } export default Accueil; diff --git a/mon-projet/src/pages/Details.jsx b/mon-projet/src/pages/Details.jsx index 75b827d..a5ee210 100644 --- a/mon-projet/src/pages/Details.jsx +++ b/mon-projet/src/pages/Details.jsx @@ -1,8 +1,9 @@ import { useParams } from "react-router-dom"; function Details() { - const { id } = useParams(); - return

Détails de la trilogie {id}

; + const { id } = useParams(); // récupère le :id de l'URL +

toto

; + return

Détails de la trilogie {}

; } export default Details;