Conversation
| updateMessage: false, | ||
| }; | ||
|
|
||
There was a problem hiding this comment.
Trailing spaces not allowed no-trailing-spaces
| }; | ||
|
|
||
| case ProfileAction.FETCH_FOLLOWERS: | ||
| console.log(action.followerCount); |
There was a problem hiding this comment.
Expected indentation of 6 spaces but found 4 indent
Unexpected console statement no-console
| return axios.put( | ||
| `${configUrls.root}/profile/${user.username}/edit/`, | ||
| { profile: { name: name, user_bio: bio } }, | ||
| config) |
There was a problem hiding this comment.
Expected a newline before ')' function-paren-newline
| return axios.put('http://127.0.0.1:8000/api/profile/Kyppy/edit/', { profile: { name: name, user_bio: bio } }) | ||
| return axios.put( | ||
| `${configUrls.root}/profile/${user.username}/edit/`, | ||
| { profile: { name: name, user_bio: bio } }, |
There was a problem hiding this comment.
Expected property shorthand object-shorthand
| export const fetchName = currentUserProf => (dispatch) => { | ||
| return axios.get( | ||
| `${configUrls.root}/profiles/${currentUserProf}/`, | ||
| config) |
There was a problem hiding this comment.
Expected a newline before ')' function-paren-newline
| }; | ||
|
|
||
| export const getFollowings = () => { | ||
| return (dispatch) => { |
There was a problem hiding this comment.
Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style
| }; | ||
| }; | ||
|
|
||
| export const getFollowings = () => { |
There was a problem hiding this comment.
Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style
| }; | ||
|
|
||
| export const getFollowers = () => { | ||
| return (dispatch) => { |
There was a problem hiding this comment.
Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style
| }; | ||
| }; | ||
|
|
||
| export const getFollowers = () => { |
There was a problem hiding this comment.
Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style
| }; | ||
|
|
||
| export const unFollow = (userName) => { | ||
| return (dispatch) => { |
There was a problem hiding this comment.
Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style
| }; | ||
| }; | ||
|
|
||
| export const unFollow = (userName) => { |
There was a problem hiding this comment.
Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style
| }; | ||
|
|
||
| export const checkFollow = (userName) => { | ||
| return (dispatch) => { |
There was a problem hiding this comment.
Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style
| }; | ||
| }; | ||
|
|
||
| export const checkFollow = (userName) => { |
There was a problem hiding this comment.
Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style
| }; | ||
|
|
||
| export const follow = (userName) => { | ||
| return (dispatch) => { |
There was a problem hiding this comment.
Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style
| headers: authHeader(), | ||
| }; | ||
|
|
||
| export const follow = (userName) => { |
There was a problem hiding this comment.
Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style
| this.props.fetchFollowers(); | ||
| const { | ||
| fetchName, | ||
| fetchBio, |
There was a problem hiding this comment.
'fetchBio' is already declared in the upper scope no-shadow
'fetchBio' is missing in props validation react/prop-types
| this.props.fetchFollows(); | ||
| this.props.fetchFollowers(); | ||
| const { | ||
| fetchName, |
There was a problem hiding this comment.
'fetchName' is already declared in the upper scope no-shadow
'fetchName' is missing in props validation react/prop-types
| profileprops: state.profile, | ||
| }); | ||
|
|
||
| export default connect(mapStateToProps)(ConnectedSocialFollowing); No newline at end of file |
There was a problem hiding this comment.
Newline required at end of file but not found eol-last
|
|
||
| componentWillReceiveProps(nextProps) { | ||
| // this.props.getFollowers(this.props.userName); | ||
| this.setState({ followers: nextProps.profileprops.followers }); |
There was a problem hiding this comment.
'profileprops' is missing in props validation react/prop-types
'profileprops.followers' is missing in props validation react/prop-types
| } | ||
|
|
||
| componentDidMount() { | ||
| this.setState({ followers: this.props.followers }); |
There was a problem hiding this comment.
'followers' is missing in props validation react/prop-types
Do not use setState in componentDidMount react/no-did-mount-set-state
| import React, { Component } from 'react'; | ||
| import { connect } from 'react-redux'; | ||
|
|
||
| export class ConnectedSocialFollowing extends Component { |
There was a problem hiding this comment.
Block must not be padded by blank lines padded-blocks
| const userName = userData.username; | ||
| this.props.resetProfileUpdate(); | ||
| this.props.history.push('/profile'); | ||
| this.props.history.push(`/profile/${userName}`); |
There was a problem hiding this comment.
'history' is missing in props validation react/prop-types
'history.push' is missing in props validation react/prop-types
| </h3> | ||
| <h5 className="text-primary"> | ||
| @{secondName || "Username"} | ||
| @{userName || "Username"} |
There was a problem hiding this comment.
Strings must use singlequote quotes
| const userDetails = authUser(); | ||
|
|
||
| const NameTag = ({firstName, secondName}) => ( | ||
| const NameTag = ({ firstName, userName, followers }) => ( |
There was a problem hiding this comment.
'firstName' is missing in props validation react/prop-types
'followers' is missing in props validation react/prop-types
'userName' is missing in props validation react/prop-types
| const { | ||
| fetchName, | ||
| fetchBio, | ||
| } = this.props |
| followers: state.follows.followers, | ||
| }); | ||
|
|
||
| const mapDispatchToProps = (dispatch) => { |
There was a problem hiding this comment.
Unexpected block statement surrounding arrow body; parenthesize the returned value and move it immediately after the => arrow-body-style
| <ul className="list-group list-group-flush"> | ||
| { followers && followers.map((follower) => { | ||
| return ( | ||
| <Link to={`/profile/${follower}`}> |
There was a problem hiding this comment.
The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md jsx-a11y/anchor-is-valid
| <div className="col-lg-8 col-md-8 col-sm-12 p-0"> | ||
| <h2 className="text-center mb-4 sticky-top bg-white p-2">Followers</h2> | ||
| <ul className="list-group list-group-flush"> | ||
| { followers && followers.map((follower) => { |
There was a problem hiding this comment.
Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style
|
|
||
| componentDidMount() { | ||
| const { | ||
| getFollowers, |
There was a problem hiding this comment.
'getFollowers' is already declared in the upper scope no-shadow
'getFollowers' is missing in props validation react/prop-types
| checkFollow: userName => dispatch(checkFollow(userName)), | ||
| fetchFollowers: userName => dispatch(fetchFollowers(userName)), | ||
| }); | ||
| export default connect(mapStateToProps, mapDispatchToProps)(FollowButton) No newline at end of file |
There was a problem hiding this comment.
Missing semicolon semi
Newline required at end of file but not found eol-last
| userName: PropTypes.string, | ||
| }; | ||
|
|
||
| const mapStateToProps = (state, ownProps) => ({ |
There was a problem hiding this comment.
Trailing spaces not allowed no-trailing-spaces
| follow: PropTypes.func, | ||
| unFollow: PropTypes.func, | ||
| followStatus: PropTypes.bool, | ||
| userName: PropTypes.string, |
There was a problem hiding this comment.
propType "userName" is not required, but has no corresponding defaultProp declaration react/require-default-props
| FollowButton.propTypes = { | ||
| follow: PropTypes.func, | ||
| unFollow: PropTypes.func, | ||
| followStatus: PropTypes.bool, |
There was a problem hiding this comment.
'followStatus' PropType is defined but prop is never used react/no-unused-prop-types
propType "followStatus" is not required, but has no corresponding defaultProp declaration react/require-default-props
|
|
||
| FollowButton.propTypes = { | ||
| follow: PropTypes.func, | ||
| unFollow: PropTypes.func, |
There was a problem hiding this comment.
propType "unFollow" is not required, but has no corresponding defaultProp declaration react/require-default-props
| } | ||
|
|
||
| FollowButton.propTypes = { | ||
| follow: PropTypes.func, |
There was a problem hiding this comment.
propType "follow" is not required, but has no corresponding defaultProp declaration react/require-default-props
| } | ||
|
|
||
| handleClick = () => { | ||
| const { follow, unFollow } = this.props; |
There was a problem hiding this comment.
'follow' is already declared in the upper scope no-shadow
'unFollow' is already declared in the upper scope no-shadow
|
|
||
| componentWillReceiveProps() { | ||
| this.setState({ | ||
| followStatus: this.props.checkFollowResponse, |
There was a problem hiding this comment.
'checkFollowResponse' is missing in props validation react/prop-types
|
|
||
| componentDidMount() { | ||
| this.props.checkFollow(this.props.userName.userName); | ||
| this.props.fetchFollowers(this.props.userName.userName) |
There was a problem hiding this comment.
'fetchFollowers' is missing in props validation react/prop-types
Missing semicolon semi
| } | ||
|
|
||
| componentDidMount() { | ||
| this.props.checkFollow(this.props.userName.userName); |
There was a problem hiding this comment.
'checkFollow' is missing in props validation react/prop-types
| import { follow, unFollow, checkFollow } from '../../store/actions/followActions'; | ||
| import { fetchFollowers } from '../../store/actions/profileActions'; | ||
|
|
||
| export class FollowButton extends Component { |
There was a problem hiding this comment.
Block must not be padded by blank lines padded-blocks
What does this PR do?
Description of Tasks to be completed?
How should this be manually tested?
npm installnpm starthttp://localhost:3000/articles/ryanwire or http://localhost:3000/articles/ivanCabbage and try following the two profiles
What are the relevant Pivotal Tracker Stories?
https://www.pivotaltracker.com/n/projects/2321086/stories/164829334