New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Leaderboard API functionality #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
STATUS: CHANGES REQUIRED 鈾伙笍 鈾伙笍
Hi @Nicolaswg,
Good job so far!
鉁旓笍 Nice idea with the video in README
鉁旓笍 Good idea with the creation of new game on page reload - makes UI look neat.
鉁旓笍 Use of arrow functions
However, there are some issues that you still need to work on to go to the next project but you are almost there!
Required Changes 鈾伙笍
Check the comments under the review.
Cheers and Happy coding!馃憦馃憦馃憦
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.
As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.
@@ -1,18 +1,16 @@ | |||
# LeaderBoard-Project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- In your README documentation, kindly include instructions on how users can set up your app locally.
- Also include commands on how to install packages (
npm install
) and run the app (npm start
ornpm run build
). This can be of great help to users
import Score from './scores.js'; | ||
|
||
const AddScore = () => { | ||
const name = document.getElementById('name'); | ||
const score = document.getElementById('score'); | ||
const index = Score.scoreList.length + 1; | ||
if (name.value === '' || score.value === '') { | ||
return null; | ||
} | ||
const newList = new Score(name.value, score.value, index); | ||
Score.scoreList.push(newList); | ||
name.value = ''; | ||
score.value = ''; | ||
return Score.scoreList.length; | ||
}; | ||
|
||
const Render = () => { | ||
const leaderBox = document.querySelector('.leaderboard-box'); | ||
if (Score.scoreList.length === 0) { | ||
leaderBox.innerHTML = 'No new Score Added'; | ||
} else { | ||
let html = ''; | ||
Score.scoreList.forEach((score) => { | ||
html += `<li class="score"><p class="name">${score.name}: ${score.score}</p></li>`; | ||
}); | ||
leaderBox.innerHTML = html; | ||
} | ||
return Score.scoreList.length; | ||
}; | ||
|
||
export { AddScore, Render }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh.. sorry for that I did not check it 馃槩. Thanks for your feedback 馃憤
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
STATUS: APROVED 馃煝 馃憦
Hello @Nicolaswg,
Your project is complete! There is nothing else to say other than... Great job 馃憦
Congratulations! 馃帀
Now you can merge this branch and move on 馃
HAPPY CODING AND GOOD LUCK WITH THE COMMING ONES 馃 馃崁
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.
Main point
馃
Change Made 鉁忥笍