Skip to content

Commit 0ca1cdb

Browse files
committed
Add comments counter to comments.js file
1 parent 58136c4 commit 0ca1cdb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/modules/render/comments.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import API from '../data';
2+
import counter from '../counter'
23

34
const modal = document.getElementById('modal-comment');
45

@@ -69,6 +70,8 @@ const commentModal = (meal) => {
6970
if (data === 'No comments available for this meal') {
7071
commentUl.innerHTML = `<li class="no-comments">${`${data}. Add a new comment`}</li>`;
7172
} else {
73+
let commentCounter = counter.comments(data);
74+
allCommentsTitle.innerText = `All Comments(${commentCounter})`;
7275
data.forEach((userComment) => {
7376
displayComments(commentUl, userComment);
7477
});

0 commit comments

Comments
 (0)