diff --git a/full-stack-javascript/21-inventory-application/client/src/App.jsx b/full-stack-javascript/21-inventory-application/client/src/App.jsx index 75b447d..761d5f5 100644 --- a/full-stack-javascript/21-inventory-application/client/src/App.jsx +++ b/full-stack-javascript/21-inventory-application/client/src/App.jsx @@ -12,7 +12,7 @@ function App() { window.matchMedia("(prefers-color-scheme: dark)").matches, ); const [user, setUser] = useState(null); - console.log(user); + async function fetchUser() { try { const response = await fetch(`http://localhost:3000/users`); diff --git a/full-stack-javascript/21-inventory-application/client/src/components/PokeCard.jsx b/full-stack-javascript/21-inventory-application/client/src/components/PokeCard.jsx index 46b32e6..ed7476b 100644 --- a/full-stack-javascript/21-inventory-application/client/src/components/PokeCard.jsx +++ b/full-stack-javascript/21-inventory-application/client/src/components/PokeCard.jsx @@ -4,12 +4,8 @@ import { HeartIcon as HeartIconSolid } from "@heroicons/react/24/solid"; import PokeType from "./PokeType"; import { useNavigate } from "react-router-dom"; -function PokeCard({ pokemon, isFav }) { +function PokeCard({ pokemon, isFav, toggleFavorite }) { const navigate = useNavigate(); - function toggleFavorite(e, dexId) { - e.stopPropagation(); - console.log(dexId); - } return (
{ - toggleFavorite(currPokemon.dexId); + toggleFavorite(); }} > Favorite Pokemon @@ -86,7 +95,7 @@ function PokeDetails() { {!isFav && (