Skip to Content
Full-Stack React Projects - Second Edition
book

Full-Stack React Projects - Second Edition

by Shama Hoque
April 2020
Intermediate to advanced
716 pages
18h 55m
English
Packt Publishing
Content preview from Full-Stack React Projects - Second Edition

Making a FollowGrid component

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}> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Full-Stack React Projects

Full-Stack React Projects

Shama Hoque
React Native - The Practical Guide

React Native - The Practical Guide

Academind by Maximilian Schwarzmüller GmbH

Publisher Resources

ISBN: 9781839215414Supplemental Content