From 180a0a0cfb3ff3a0a51ad15f5c3412f8ae19232e Mon Sep 17 00:00:00 2001 From: Asara Date: Wed, 29 Jan 2020 22:18:32 -0500 Subject: [PATCH] Some formatting --- src/components/PostList.js | 82 +++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/src/components/PostList.js b/src/components/PostList.js index 450a449..24e8805 100644 --- a/src/components/PostList.js +++ b/src/components/PostList.js @@ -7,52 +7,52 @@ import { Link } from 'react-router-dom'; class PostList extends React.Component { - componentDidMount() { - this.props.fetchPosts(); - } - renderList() { - const {posts} = this.props - const postKeys = Object.keys(posts.entities) - return postKeys.map(id => { - const post = posts.entities[id] - return ( -
-
-
-

{post.title}

-

By {post.author}

-

Posted {post.time_published}

-
- -
-
-
-
- ); - }).reverse(); - } - - - render () { - return ( -
-

Blog Posts

-
- {this.renderList()} -
+ componentDidMount() { + this.props.fetchPosts(); + } + renderList() { + const {posts} = this.props + const postKeys = Object.keys(posts.entities) + return postKeys.map(id => { + const post = posts.entities[id] + return ( +
+
+
+

{post.title}

+

By {post.author}

+

Posted {post.time_published}

+
+ +
- ); - } +
+
+ ); + }).reverse(); + } + + + render () { + return ( +
+

Blog Posts

+
+ {this.renderList()} +
+
+ ); + } } const mapStateToProps = (state) => { - return { - posts: state.posts, - slug: state.slug - }; + return { + posts: state.posts, + slug: state.slug + }; } export default connect( - mapStateToProps, - { fetchPosts } + mapStateToProps, + { fetchPosts } )(PostList);