Skip to content

Commit

Permalink
Fix :: updated the image url
Browse files Browse the repository at this point in the history
  • Loading branch information
PreethiSakar7 committed Dec 14, 2021
1 parent d017132 commit 1629bff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/components/card/Card.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ function PokeCard(props) {
</span>
</div>
<div className="card-image">
<img src={`https://pokeres.bastionbot.org/images/pokemon/${props.poke.id}.png`} alt="pokeman"></img>
{/* <img src={`https://pokeres.bastionbot.org/images/pokemon/${props.poke.id}.png`} alt="pokeman"></img> */}
<img src={`https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/${props.poke.id}.png`} alt={props.poke.name}></img>
</div>
<div className="card-footer" onClick={onPokemonSelected}>
<div className="card-footer-name">{props.poke.name}</div>
Expand Down
8 changes: 5 additions & 3 deletions src/components/card/card.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
.card-image img{
width: 200px;
height: 200px;
width: 120px;
height: 100px;
margin: 0 auto;
}

.card {
width: 230px;
width: 180px;
margin: 20px 10px;
height: 100%;
}
Expand All @@ -18,6 +19,7 @@

.card-image{
padding: 10px;
display: flex;
}

.card-footer{
Expand Down
2 changes: 1 addition & 1 deletion src/pages/main/MianPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function MainPage() {
const getAllPokeman = async () => {
let localPokemonList = JSON.parse(localStorage.getItem('pokemonList'));
if (!localPokemonList) {
const url = 'https://pokeapi.co/api/v2/pokemon/?offset=0&limit=1000';
const url = 'https://pokeapi.co/api/v2/pokemon/?offset=0&limit=100';
const response = await fetch(url);
const jsonRes = await response.json();
jsonRes.results.forEach( type => {
Expand Down

0 comments on commit 1629bff

Please sign in to comment.