May 2018
Intermediate to advanced
470 pages
13h 54m
English
The FollowGrid component will take a list of users as props, display the avatars of the users with their names, and link to each user's profile. We can add this component as desired to the Profile view to display followings or followers.
mern-social/client/user/FollowGrid.js:
class FollowGrid extends Component { render() { const {classes} = this.props return (<div className={classes.root}> <GridList cellHeight={160} className={classes.gridList} cols={4}> {this.props.people.map((person, i) => { return <GridListTile style={{'height':120}} key={i}> <Link to={"/user/" + person._id}> <Avatar src={'/api/users/photo/'+person._id} className= {classes.bigAvatar}/> <Typography className={classes.tileText}>{person.name} </Typography> ...Read now
Unlock full access