Skip to content

100% complete#13

Open
jamesmcallister wants to merge 9 commits into
constructorlabs:masterfrom
jamesmcallister:master
Open

100% complete#13
jamesmcallister wants to merge 9 commits into
constructorlabs:masterfrom
jamesmcallister:master

Conversation

@jamesmcallister
Copy link
Copy Markdown

No description provided.

import { SingleArticle } from "./singleArticle";

export const ArticleList = ({ articles, title }) => (
<React.Fragment>
Copy link
Copy Markdown
Contributor

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} />)}
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Comment thread src/index.js
);
}, 30000);
}
// fetchClick(event) {
Copy link
Copy Markdown
Contributor

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

Comment thread src/index.js
<button type="submit">Submit me</button>
</form> */}
<article className="article__list">
{this.state.loading
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice

Comment thread src/newsApi.js
@@ -0,0 +1,32 @@
const apiKey = "e3f2c5f01b3a456eb81a95a2f0e85fc2";
Copy link
Copy Markdown
Contributor

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

Comment thread src/newsApi.js
.then(response => response.json())
.then(data => ({
title: "Top Headlines - USA",
articles: data.articles.filter(data => data.urlToImage)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice bit of filtering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants