April 2020
Intermediate to advanced
716 pages
18h 55m
English
The FollowGrid component will take a list of users as props, display the avatars of the users with their names, and link them to each user's own profile. We can add this component to the Profile view to display followings or followers. The FollowGrid component is defined as follows.
mern-social/client/user/FollowGrid.js:
export default function FollowGrid (props) { const classes = useStyles() return (<div className={classes.root}> <GridList cellHeight={160} className={classes.gridList} cols={4}> {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}> ...