diff --git a/react-project/public/zelda.json b/react-project/public/zelda.json index 0630c91..91a61b4 100644 --- a/react-project/public/zelda.json +++ b/react-project/public/zelda.json @@ -4,34 +4,39 @@ "titre": "Oracle of ages", "console": "Game Boy Color", "annee": "2001", - "Type": "2d" + "Type": "2d", + "like": 0 }, { "id": "2", "titre": "Breath of the Wild", "console": "Switch", "annee": "2017", - "Type": "3d" + "Type": "3d", + "like": 0 }, { "id": "3", "titre": "Majora's Mask", "console": "N64", "annee": "2000", - "Type": "3d" + "Type": "3d", + "like": 0 }, { "id": "4", "titre": "Tears of the kingdom", "console": "Switch", "annee": "2023", - "Type": "3d" + "Type": "3d", + "like": 0 }, { "id": "5", "titre": "Echoes of Wisdom", "console": "Switch", "annee": "2024", - "Type": "3d" + "Type": "3d", + "like": 0 } ] diff --git a/react-project/src/components/Carte.jsx b/react-project/src/components/Carte.jsx index 6d40d24..daf975a 100644 --- a/react-project/src/components/Carte.jsx +++ b/react-project/src/components/Carte.jsx @@ -1,16 +1,7 @@ -import { useEffect } from "react"; import Badge from "./Badge"; -import { useState } from "react"; import { Link } from "react-router-dom"; function Carte(props) { - const [likes, setLikes] = useState( - () => Number(localStorage.getItem("likes-" + props.gameId)) || 0, - ); - useEffect(() => { - localStorage.setItem("likes-" + props.gameId, likes); - }, [likes]); - return (
Aucun jeu trouvé 😕
} - +{nbJeux} jeux · {totalLikes} likes · année moyenne {anneeMoyenne}
- + > );