details on like total (still doesn't work)
This commit is contained in:
@@ -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()),
|
||||
);
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user