Created
November 13, 2021 16:18
-
-
Save hieptl/8d3d6dcdfe4c1eb343192821d0833716 to your computer and use it in GitHub Desktop.
User.js - Discord Clone
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const User = (props) => { | |
const { user, onItemClicked } = props; | |
const selectUser = (user) => () => { | |
onItemClicked(user); | |
}; | |
return ( | |
<div className="add-friend__list-item" onClick={selectUser(user)}> | |
<div className="add-friend__list-item-left"> | |
<img src={user.avatar} alt={user.fullname} /> | |
<span>{user.fullname}</span> | |
</div> | |
</div> | |
); | |
}; | |
export default User; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment