Add br instead of hr for last element

This commit is contained in:
Zhao-Andy 2018-04-27 17:30:05 -04:00
parent 70e0329f5a
commit a9f28e8092
2 changed files with 4 additions and 3 deletions

View file

@ -66,8 +66,8 @@ class SidebarWidget extends Component {
}
render() {
const users = this.state.suggestedUsers.map(user => (
<SidebarUser key={user.id} user={user} followUser={this.followUser} />
const users = this.state.suggestedUsers.map((user, index) => (
<SidebarUser key={user.id} user={user} followUser={this.followUser} index={index} />
));
return (
<div className="widget-suggested-follows-container" id="widget-00001">

View file

@ -32,7 +32,7 @@ class SidebarUser extends Component {
{this.props.user.following ? '✓ FOLLOWING' : '+ FOLLOW'}
</button>
</div>
<hr />
{this.props.index === 2 ? <br /> : <hr />}
</div>
);
}
@ -41,6 +41,7 @@ class SidebarUser extends Component {
SidebarUser.propTypes = {
followUser: PropTypes.func.isRequired,
user: PropTypes.object.isRequired,
index: PropTypes.number.isRequired,
};
export default SidebarUser;