-
Notifications
You must be signed in to change notification settings - Fork 34
Mel: Responsive News Reader #22
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
|
||
| <div class="container"> | ||
| <main> | ||
| <nav class="news--filter"> |
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.
Class name should be written using __ since it indicates an element rather than modifier
|
|
||
| function displayDataOnPage(newsStories) { | ||
| const newsArray = newsStories.articles; | ||
| console.log(newsStories.articles); |
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 are quite a few consol.logs left in. Once you are happy with the functionality, it's best to remove them to keep console output clean
| newsitem.source.name !== null | ||
| ? `<span class="${newsitem.source.name}"></span>` | ||
| : ""; | ||
| const url = newsitem.url !== null ? `${newsitem.url}` : "#"; |
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.
nice
| : ""; | ||
|
|
||
| return ` | ||
| <a href="${url}" class="news--article-link"> |
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.
Some indentation here would make HTML easier to read
|
|
||
| return redcardCheckbox.forEach(item => { | ||
| item.addEventListener("change", function(event) { | ||
| event.target.checked |
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.
This would be cleaner written as event.target.parentNode.style.backgroundColor = event.target.checked ? "red" :""
| const defaultArray = ["daily-mail", "mirror", "metro"]; | ||
|
|
||
| // create an array from object using key values | ||
| let publicationArray = Object.keys(publicationList); |
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.
if variables will not be re-assigned to in future they should be declared using const
| input.addEventListener("change", function(event) { | ||
| // new assigned value to match object key | ||
| // assign object value if checked is true | ||
| if (event.target.checked === true) { |
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.
This could be shortened to publicationList[event.target.value] = event.target.checked
|
It would be great to see a README which explains what the projects, how it works, what it does etc. This could be useful if you want to show your projects with potential employers. It could also be a n opportunity to highlight any stretch goals |
|
Also, if the javascript-workings js files are not needed any more, they can be deleted so they don't clog up source control |
Still working on click event for checkbox added to each article to change article (parentNode) style.