-
Notifications
You must be signed in to change notification settings - Fork 34
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
100% complete #13
base: master
Are you sure you want to change the base?
100% complete #13
Conversation
import { SingleArticle } from "./singleArticle"; | ||
|
||
export const ArticleList = ({ articles, title }) => ( | ||
<React.Fragment> |
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
export const ArticleList = ({ articles, title }) => ( | ||
<React.Fragment> | ||
<h1 className="articleList__title"> {title} </h1> | ||
{articles.map((data, i) => <SingleArticle key={i} {...data} />)} |
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.
using index as key might cause weird bugs
<p className="article__description">{description}</p> | ||
<div className="article__publishedAt"> | ||
Posted | ||
{" " + distanceInWordsToNow(publishedAt)} ago |
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
); | ||
}, 30000); | ||
} | ||
// fetchClick(event) { |
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.
Avoid committing commented out code
<button type="submit">Submit me</button> | ||
</form> */} | ||
<article className="article__list"> | ||
{this.state.loading |
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.
very nice
@@ -0,0 +1,32 @@ | |||
const apiKey = "e3f2c5f01b3a456eb81a95a2f0e85fc2"; |
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.
like how the key is broken out into own variable
.then(response => response.json()) | ||
.then(data => ({ | ||
title: "Top Headlines - USA", | ||
articles: data.articles.filter(data => data.urlToImage) |
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 bit of filtering
No description provided.