Conversation
Forgot a critical file!
Created 'displayPage' function and moved event listener into main.
| .then(response => response.json()) | ||
| .then(data => { | ||
| repoDiv.innerHTML = ''; | ||
| let repository = data.name; |
There was a problem hiding this comment.
Always use const instead of let when the value doesn't change.
|
|
||
| } | ||
|
|
||
| function displayContrib(contributor, contributions, avatar) { |
There was a problem hiding this comment.
Nice splitting up in functions!
| padding: 5px; | ||
| } | ||
|
|
||
| .badge { |
There was a problem hiding this comment.
This doesn't work well when there are more than 100 contributions, don't forget to test with larger amounts of data!
|
|
||
| function displayContrib(contributor, contributions, avatar) { | ||
| let eachPersonUl = createAndAppend('ul', contribDiv) | ||
| createAndAppend('IMG', eachPersonUl, { src: avatar, width: "42", id: 'avatar' }) |
There was a problem hiding this comment.
You shouldn't add img elements as a direct child inside ul/ol. Only li is allowed, so you should wrap the img inside of an li.
| function displayContrib(contributor, contributions, avatar) { | ||
| let eachPersonUl = createAndAppend('ul', contribDiv) | ||
| createAndAppend('IMG', eachPersonUl, { src: avatar, width: "42", id: 'avatar' }) | ||
| createAndAppend('li', eachPersonUl, { class: "badge", id: 'contbadge', text: `${contributions}` }) |
There was a problem hiding this comment.
Id-attributes must be unique on the entire page, here and on the line above you add multiple elements with the same id. You should use class attribute instead (classes can be used on multiple places in the document).
homework/week-2/newStyle.css
Outdated
| color: #444; | ||
| } | ||
|
|
||
| #contributorsDiv.li { |
There was a problem hiding this comment.
This doesn't do anything; you're trying to style an element with the id contributorsDiv and the class li. It never exists in your app.
homework/week-2/newStyle.css
Outdated
| margin: 20px; | ||
| } | ||
|
|
||
| /* #contributionNumber { |
There was a problem hiding this comment.
Don't leave commented out code, remove it instead! (Easier to read and change later)
Fixed a bug that was causing the select element to replicate every time the page reloaded. Also upperCased everything so it's actually alphabetical
Still haven't figured out how the classes work
Think all is working but api 403 so can't check for a little while.
Checked to make sure this was actually working and removed some unused css.

No description provided.