Skip to content

Commit bc300f6

Browse files
committed
Fix errors
1 parent 33faa6a commit bc300f6

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import './style.css';
2-
import { displayShows } from './modules/homepage';
3-
import showsCount from './modules/count';
2+
import displayShows from './modules/homepage';
43
import './modules/comment_handler.js';
54
import './modules/comments-button_handler.js';
65

76
displayShows();
8-
showsCount();

src/modules/homepage.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ const tvShows = ['La Casa de Papel', '1899', 'Dark', 'Stranger Things', 'Squid G
77

88
const show = [];
99

10+
const showsCount = async () => {
11+
const shows = document.querySelectorAll('.article').length;
12+
const addCount = document.querySelector('.count-shows');
13+
addCount.innerHTML = `Top binge-worthy shows (${shows})`;
14+
};
15+
1016
export const showInfo = async () => {
1117
for (let i = 0; i < tvShows.length; i += 1) {
1218
/*eslint-disable */
@@ -62,7 +68,7 @@ const displayShows = async () => {
6268
container.innerHTML = '';
6369
for (let i = 0; i < show.length; i += 1) {
6470
container.innerHTML += `
65-
<article>
71+
<article class="article">
6672
<img src=${show[i].image.medium}>
6773
<div class="title" id="${show[i].id}">
6874
<h2>${show[i].name}</h2>
@@ -76,6 +82,7 @@ const displayShows = async () => {
7682
`;
7783
}
7884
likeBtn();
85+
showsCount();
7986
};
8087

81-
export { showInfo, displayShows };
88+
export default displayShows;

0 commit comments

Comments
 (0)