details on like total (still doesn't work)

This commit is contained in:
2026-06-24 11:58:38 +02:00
parent b5906c3f92
commit dab2650776
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ const jeux = [
function App() {
const [recherche, setRecherche] = useState("");
const [total, setTotal] = useState(0);
const filtres = jeux.filter((j) =>
j.titre.toLowerCase().includes(recherche.toLowerCase()),
);
+4 -1
View File
@@ -1,15 +1,18 @@
import { useEffect } from "react";
import Badge from "./Badge";
import { useState } from "react";
function Carte(props) {
const [likes, setLikes] = useState(0);
useEffect(() => {}, [likes]);
return (
<div className="carte">
<h2>{props.titre}</h2>
<p>
{props.console} - {props.annee} - <Badge />
</p>
<button onClick={() => setLikes(likes + 1)}> {likes}</button>
<button onClick={() => setLikes(likes + 1)}> {likes} </button>
</div>
);
}