Added AuthorBio on single post #225

Merged
merged 5 commits into from Jan 8, 2017

Projects

None yet

3 participants

@nil1511
Collaborator
nil1511 commented Jan 7, 2017

No description provided.

@nil1511 nil1511 self-assigned this Jan 7, 2017
@adcpm adcpm temporarily deployed to busy6-pr-225 Jan 7, 2017 Inactive
@nil1511 nil1511 temporarily deployed to busy6-pr-225 Jan 7, 2017 Inactive
@nil1511 nil1511 temporarily deployed to busy6-pr-225 Jan 7, 2017 Inactive
@adcpm adcpm temporarily deployed to busy6-pr-225 Jan 8, 2017 Inactive
@p0o

Thank you! Some thoughts on my side.

src/post/AuthorBio.js
+ ({ auth, userProfile }) => ({ auth, following: userProfile.following }),
+ dispatch => bindActionCreators({ followUser, unfollowUser, getFollowing }, dispatch)
+)
+
@p0o
p0o Jan 8, 2017 Collaborator

better to not leave an empty line after any HoC, these are not separated parts.

src/post/AuthorBio.js
+ }
+
+ componentDidMount() {
+ const loggedInUser = this.props.auth.user.name;
@p0o
p0o Jan 8, 2017 Collaborator

const loggedInUser = this.props.auth.user ? this.props.auth.user.name : '';

+ try {
+ author.json_metadata = JSON.parse(result[0].json_metadata);
+ } catch (e) {
+ author.json_metadata = {};
@p0o
p0o Jan 8, 2017 Collaborator

better to throw an error on catch:

throw new Error(`Error parsing jsonMetadata for user ${username}`);
@nil1511
Collaborator
nil1511 commented Jan 8, 2017

@p0o Thanks. I have made the changes accordingly.

@adcpm adcpm merged commit e50ca14 into dev Jan 8, 2017
@adcpm adcpm deleted the AuthorBio branch Jan 8, 2017
@nil1511 nil1511 removed the waiting-review label Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment