GitHub tracker Emma Högberg#76
Conversation
| fetch(URL_REPO, options) | ||
| .then(res => res.json()) | ||
| .then(data => { | ||
| console.log('data:', data) |
There was a problem hiding this comment.
Remove the console.log if it's not neccessary 😃
| console.log('project reponame:', reponame) | ||
|
|
||
| //Get url to each repo | ||
| let projectUrl = project.html_url |
There was a problem hiding this comment.
You may consider to use const, if the variables are not reassigned later. It provide clear readibility and you can recieve an error alert if you re-use the same variable name by chance later
| const displayLink = (netlifyUrl, reponame) => { | ||
|
|
||
| document.getElementById(`website-${reponame}`).innerHTML = ` | ||
| <a href="${netlifyUrl}" target="_blank"> | ||
| <button class="outlined-button">visit website</button> | ||
| </a> | ||
| ` |
There was a problem hiding this comment.
This is such a smart manner to save and display the link. I will definitely learn this from you
| if (comment.user.login !== username) { | ||
| document.getElementById(`comments-${reponame}`).innerHTML = ` | ||
| <p> | ||
| <span class="bold-text">Reviewed by:</span> | ||
| <a class="nav-link" href="${data[0].user.html_url}"> ${data[0].user.login}</a> | ||
| </p> | ||
| ` | ||
| document.getElementById(`comments-btn-${reponame}`).innerHTML = ` | ||
| <button class="filled-button" id="click-${reponame}">comments 💬</button> | ||
| ` | ||
| commentsArray.push(comment.body) | ||
| document.getElementById(`click-${reponame}`).addEventListener('click', () => { | ||
| commentsArray.forEach(item => { | ||
| modalWrapper.style.display = 'block' | ||
|
|
||
| document.getElementById('modal').innerHTML += ` | ||
| <p><span class="bold-text modal-header">Comment from ${data[0].user.login}</span></p> | ||
| <p class="modal-text">${item}</p> | ||
| <br> | ||
| ` |
There was a problem hiding this comment.
It would be nice to add an else in this case to announce visitor that there is no comment. In term of user experience, I believe that it will be helpful to save them from searching and questioning about where to find the comment for this project
| 7px 7px 20px 0px #0002, | ||
| 4px 4px 5px 0px #0001; |
There was a problem hiding this comment.
The box shadow color can be a bit lighter to make it more soothing 😃
sk-phan
left a comment
There was a problem hiding this comment.
Hi Emma,
Sorry for the late review. In general, you code are well written, and I like how you approach different methods in Javascript. I have added some comments, hopefully it can help 😄
https://emma-github-tracker.netlify.app/