diff --git a/README.md b/README.md index 4a8eae5..dc6d3dc 100644 --- a/README.md +++ b/README.md @@ -35,8 +35,40 @@ Las credenciales de acceso del usuario dummy son: 8. Opción de filtrar los pokémon por tipo. 9. Animaciones de transición entre vista principal y vista de detalles. +## Screenshots + +### Mobile + +- Vista principal +![](https://i.imgur.com/Llyfq00.jpg) +- Vista de favoritos +![](https://i.imgur.com/ZjzRJCY.jpg) +- Vista detalles +![](https://i.imgur.com/u5du2Fv.png) +- Filtros +![](https://i.imgur.com/0WYrI0P.jpg) +- Busqueda +![](https://i.imgur.com/Dswji41.jpg) + +### Desktop + +- Vista principal +![](https://i.imgur.com/vdmUEvp.png) +- Vista de favoritos +![](https://i.imgur.com/bqMVe7O.png) +- Vista detalles +![](https://i.imgur.com/iNjLuQ2.png) +- Filtros +![](https://i.imgur.com/fa7f1pe.png) +- Busqueda +![](https://i.imgur.com/v246OmG.png) + ## Prospectos - Agregar más información a la vista detalles. - Convertirla en PWA. + +## Creditos + +Iconos de tipo de pokemon tomados de [duiker101](https://github.com/duiker101/pokemon-type-svg-icons) \ No newline at end of file diff --git a/public/manifest.json b/public/manifest.json index 080d6c7..1af7c9b 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,19 +1,19 @@ { - "short_name": "React App", - "name": "Create React App Sample", + "short_name": "Pokedata", + "name": "Pokedata", "icons": [ { - "src": "favicon.ico", + "src": "pokeball.ico", "sizes": "64x64 32x32 24x24 16x16", "type": "image/x-icon" }, { - "src": "logo192.png", + "src": "pokeball.png", "type": "image/png", "sizes": "192x192" }, { - "src": "logo512.png", + "src": "pokeball.png", "type": "image/png", "sizes": "512x512" } diff --git a/public/pokeball.ico b/public/pokeball.ico new file mode 100644 index 0000000..5a18ce0 Binary files /dev/null and b/public/pokeball.ico differ diff --git a/public/pokeball.png b/public/pokeball.png new file mode 100644 index 0000000..5a18ce0 Binary files /dev/null and b/public/pokeball.png differ diff --git a/src/components/pages/login.jsx b/src/components/pages/login.jsx index b5e96e2..b1f5b34 100644 --- a/src/components/pages/login.jsx +++ b/src/components/pages/login.jsx @@ -74,7 +74,7 @@ export default function SignIn({state, dispatch}) { required fullWidth id="email" - label="e-mail" + label="Username" name="email" autoFocus /> diff --git a/src/components/pokedetails.jsx b/src/components/pokedetails.jsx index 003a40e..74b227e 100644 --- a/src/components/pokedetails.jsx +++ b/src/components/pokedetails.jsx @@ -107,7 +107,7 @@ function Pokedetails({ pokemon, dispatch }) { ["Spd", Number(pokemon.stats[5].base_stat), `color: ${typeTwoColor}`, null], ]; const options = { - chartArea: { width: "70%" }, + chartArea: {left:"30%", top:"100px", width: "50%", height:"300px" }, isStacked: true, hAxis: { minValue: 0, @@ -169,11 +169,11 @@ function Pokedetails({ pokemon, dispatch }) { image={pokemon && pokemon.sprites.other["official-artwork"].front_default} alt="pokemon" /> - - + + {upperFirstLetter(pokemon.name)} - + #{id} @@ -193,16 +193,12 @@ function Pokedetails({ pokemon, dispatch }) { } + chartType="BarChart" + // width="8%" + // height="55%" + data={data} + options={options} + /> diff --git a/src/components/pokelist.jsx b/src/components/pokelist.jsx index 2177ed3..1293f0a 100644 --- a/src/components/pokelist.jsx +++ b/src/components/pokelist.jsx @@ -91,24 +91,59 @@ function Pokelist({ favs, data, page, pageSize, dispatch }) { return str.charAt(0).toUpperCase() + str.slice(1); } function handleClick(e) { - const id = e.currentTarget.value + const id = e.currentTarget.alt //console.log('id', id) navigateTo(`/${id}`); } return (
{pageData && pageData.map((pokemon, i) => { + + let typeOneColor + let typeTwoColor + + if (pokemon.pokemon_v2_pokemontypes.length === 2) { + typeOneColor = typeColors[String(pokemon.pokemon_v2_pokemontypes[0].pokemon_v2_type.name)] + typeTwoColor = typeColors[String(pokemon.pokemon_v2_pokemontypes[1].pokemon_v2_type.name)] + } else { + typeOneColor = typeColors[String(pokemon.pokemon_v2_pokemontypes[0].pokemon_v2_type.name)] + typeTwoColor = typeColors[String(pokemon.pokemon_v2_pokemontypes[0].pokemon_v2_type.name)] + } + return (
- + handleClick(e)} + sx={{ + height: '250px', + align: 'center', + margin: '0px', + padding: '0px', + border: '0px', + objectFit: 'contain', + backgroundImage: `linear-gradient(to right, ${typeTwoColor + '30'}, ${typeOneColor + '30'})`// {typeOneColor} + }} /> + + {pokemon.pokemon_v2_pokemontypes.map((type_, i) => { + const type_name = String(type_.pokemon_v2_type.name) + // console.log('TYPE IS', type_name) + const TypeComponent = typeComponents[type_name]; + return (} + label={type_name} + key={"type" + i} + />) + } + ) + } + {upperFirstLetter(pokemon.name)} + {(() => { + if (favs.includes(pokemon.id)) { + return dispatch({ type: 'setFav', value: pokemon.id })} /> + } else { + return dispatch({ type: 'setFav', value: pokemon.id })} /> + } + })()} #{pokemon.id} - - {pokemon.pokemon_v2_pokemontypes.map((type_, i) => { - const type_name = String(type_.pokemon_v2_type.name) - // console.log('TYPE IS', type_name) - const TypeComponent = typeComponents[type_name]; - return (} - label={type_name} - key={"type" + i} - />) - } - ) - } - - handleClick(e)}> Details - + */} - - + + + {(() => { + if (favs.includes(pokemon.id)) { + return dispatch({ type: 'setFav', value: pokemon.id })} /> + } else { + return dispatch({ type: 'setFav', value: pokemon.id })} /> + } + })()} {upperFirstLetter(pokemon.name)} - + + {pokemon.pokemon_v2_pokemontypes.map((type_, i) => { const type_name = String(type_.pokemon_v2_type.name) //console.log('TYPE IS', type_name) const TypeComponent = typeComponents[type_name]; - return (} label={type_name} key={"type" + i} @@ -188,29 +227,17 @@ function Pokelist({ favs, data, page, pageSize, dispatch }) { ) } - - {(() => { - if (favs.includes(pokemon.id)) { - return dispatch({ type: 'setFav', value: pokemon.id })} /> - } else { - return dispatch({ type: 'setFav', value: pokemon.id })} /> - } - })()} - - + handleClick(e)} />