From a5825d8197f7bfd5f87407c33847e953d0c58bd1 Mon Sep 17 00:00:00 2001 From: milenarismo Date: Mon, 17 Oct 2022 16:00:14 -0300 Subject: [PATCH] Finalizado --- src/App.js | 46 ++++++++++++++++++++++- src/Components/PokemonCard/PokemonCard.js | 16 ++++---- 2 files changed, 54 insertions(+), 8 deletions(-) diff --git a/src/App.js b/src/App.js index f9e7bb7..acf84ae 100644 --- a/src/App.js +++ b/src/App.js @@ -24,13 +24,57 @@ function App() { id: 0 }) + const [pokemon1, setPokemon1] = useState({ + name: "Bulbasaur", + type: "grass", + evolved: true, + weight: 6.9, + color: 'green', + image: 'https://archives.bulbagarden.net/media/upload/2/21/001Bulbasaur.png', + id: 1 + }) + + const Evoluir = () => { + const novoPokemon = { + ...pokemon, + color: `red` + } + setPokemon(novoPokemon) + } + + const Evoluir1 = () => { + const novoPokemon1 = { + ...pokemon1, + color: `red` + } + setPokemon1(novoPokemon1) + } + + + // Para fazer seus próximos pokemons, crie novos estados! return ( <> {/* Aqui neste componente, passe as props. Lembre-se que também é possivel passar a função de setState via props! */} - + + + {/* Crie aqui seus próximos pokemons! */} diff --git a/src/Components/PokemonCard/PokemonCard.js b/src/Components/PokemonCard/PokemonCard.js index ec0ba5d..2314b8a 100644 --- a/src/Components/PokemonCard/PokemonCard.js +++ b/src/Components/PokemonCard/PokemonCard.js @@ -5,18 +5,20 @@ import {Card, PokemonName, PokemonType, EvolveButton} from './styles' const PokemonCard = (props) => { - const evoluirPokemon = () => { + const evoluirPokemon = () => { + console.log("Cliquei no botão de evoluir") } return ( - - {`Pokemon`}/ - {} - {} -

{}kg

+ + {`Pokemon`}/ + {props.name} + {props.type} +

{props.weight}kg

+ - evoluirPokemon()}>Evoluir! + Evoluir!
) }