diff --git a/02-pokemon/src/components/PokeCard.jsx b/02-pokemon/src/components/PokeCard.jsx index c659833..2acf791 100644 --- a/02-pokemon/src/components/PokeCard.jsx +++ b/02-pokemon/src/components/PokeCard.jsx @@ -10,7 +10,7 @@ export function PokeCard({key,pokemon}){ if(pokemon.types[1]){ color2 = pokemon.types[1]["type"]["name"] } - //let total=pokemon.stats.reduce((total,stat) =>{return total+stat["base_stat"]},0) + let total=pokemon.stats.reduce((total,stat) =>{return total+stat["base_stat"]},0) return(
@@ -28,6 +28,7 @@ export function PokeCard({key,pokemon}){
{pokemon.name.toUpperCase()}:
+

Total: {total}

diff --git a/02-pokemon/src/components/PokeFull.jsx b/02-pokemon/src/components/PokeFull.jsx index c1f981e..dcf5b4b 100644 --- a/02-pokemon/src/components/PokeFull.jsx +++ b/02-pokemon/src/components/PokeFull.jsx @@ -12,12 +12,9 @@ export function PokeFull({pokemon}){ } let evos=["Bulvasaur","Ivysaur","Venosaur"] const pokeid=(pokemon.id>99?(pokemon.id>999?pokemon.id:"0"+pokemon.id):(pokemon.id>9?"00"+pokemon.id:"000"+pokemon.id)) - let color1=pokemon.types[0]["type"]["name"] + const color1=pokemon.types[0]["type"]["name"] let color2=pokemon.types[0]["type"]["name"] - let total=0 - for (let i=0;i<6;i++){ - total+=pokemon.stats[i]["base_stat"] - } + const total=pokemon.stats.reduce((total,stat) =>{return total+stat["base_stat"]},0) if(pokemon.types[1]){ color2=pokemon.types[1]["type"]["name"] } @@ -41,11 +38,9 @@ export function PokeFull({pokemon}){
Habilidades:
-
    - {pokemon.abilities.map(element => { - return
  1. {element["ability"]["name"]}
  2. - })} -
+
    {pokemon.abilities.map(element => { + return
  1. {element["ability"]["name"]}
  2. + })}

Estadísticas totales: {total} puntos

Cadena evolutiva:
@@ -58,7 +53,7 @@ export function PokeFull({pokemon}){
-
+

Nº{pokeid}: {pokemon.species.name.toUpperCase()}

@@ -72,11 +67,9 @@ export function PokeFull({pokemon}){

Descripción:

{pokemon.name.toUpperCase()} should have a description here; sadly, I don't know where it's description is, so don't expect this to work...

Lista de movimientos:

- +