Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JonahKayizzi committed Oct 21, 2022
1 parent c87292a commit 4a86139
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 43 deletions.
2 changes: 1 addition & 1 deletion __mocks__/noHTMLelement.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default () => {
'container',
'container',
'',
xx
xx,
);

return containerSection;
Expand Down
2 changes: 1 addition & 1 deletion __mocks__/singleHTMLelement.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default () => {
'container',
'container',
'',
xx
xx,
);
createHTMLelement('li', 'item', 'item', '', containerList);
return containerList;
Expand Down
2 changes: 1 addition & 1 deletion __mocks__/tenHTMLelements.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default () => {
'container',
'container',
'',
xx
xx,
);
for (let i = 1; i <= 10; i += 1) {
createHTMLelement('li', 'item', 'item', '', containerList);
Expand Down
3 changes: 0 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Icon from './assets/img/pokemon.png';
import displayPokemons from './modules/displayPokemons.js';
import PopUp from './modules/popUp.js';
import countItems from './modules/countItems.js';
import singleHTMLelement from '../__mocks__/singleHTMLelement.js';

const logoDiv = document.getElementById('logo');
const pokemonsContainer = document.querySelector('.pokemons-container');
Expand All @@ -21,8 +20,6 @@ window.onload = () => {
setTimeout(() => {
pokemonCounter.innerHTML = `(${countItems(pokemonsContainer)})`;
}, 2000);

console.log(singleHTMLelement());
};

pokemonsContainer.addEventListener('click', (e) => {
Expand Down
16 changes: 8 additions & 8 deletions src/modules/displayPokemons.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import postLikes from './postLikes.js';
export default async () => {
const pokemonsContainer = document.querySelector('.pokemons-container');
const response = await fetch(
'https://pokeapi.co/api/v2/pokemon?limit=6&offset=888'
'https://pokeapi.co/api/v2/pokemon?limit=6&offset=888',
);
const result = await response.json();
result.results.forEach((pokemon) => {
Expand All @@ -15,15 +15,15 @@ export default async () => {
'pokemon-summary flex-col',
'pokemon-summary',
'',
pokemonsContainer
pokemonsContainer,
);

const pokemonImage = createHTMLElement(
'div',
'pokemon-image',
'pokemon-image',
'',
pokemonSummary
pokemonSummary,
);
pokemonImage.style.background = `url("https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/${pokemonId}.png") 50% 0 no-repeat`;
pokemonImage.style.backgroundSize = 'contain';
Expand All @@ -33,23 +33,23 @@ export default async () => {
'name-container flex-row',
'name-container',
'',
pokemonSummary
pokemonSummary,
);

createHTMLElement(
'p',
'pokemon-name',
'pokemon-name',
`${pokemon.name}`,
nameContainer
nameContainer,
);

const likeIcon = createHTMLElement(
'i',
'icons fa fa-heart-o',
'fa fa-heart-o',
'',
nameContainer
nameContainer,
);
likeIcon.ariaHidden = true;

Expand All @@ -58,7 +58,7 @@ export default async () => {
'likes-number',
'likes-number',
'',
pokemonSummary
pokemonSummary,
);

getLikes(pokemonId).then((value) => {
Expand All @@ -70,7 +70,7 @@ export default async () => {
'comments',
`${pokemonId}`,
'Comments',
pokemonSummary
pokemonSummary,
);

likeIcon.addEventListener('click', () => {
Expand Down
27 changes: 0 additions & 27 deletions src/modules/index.test.js

This file was deleted.

9 changes: 7 additions & 2 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ body {
padding: 0;
background-color: #3864a8;
align-items: center;
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande',
'Lucida Sans Unicode', Verdana, sans-serif;
font-family:
'Lucida Sans',
'Lucida Sans Regular',
'Lucida Grande',
'Lucida Sans Unicode',
Verdana,
sans-serif;
}

.flex-col {
Expand Down

0 comments on commit 4a86139

Please sign in to comment.