Last active
May 11, 2017 18:06
-
-
Save domyen/f7b44b15e6e0d607878920e3fa5e5e0f to your computer and use it in GitHub Desktop.
CommentList.js (GOOD)
Raw
CommentList.js
This file contains 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
Show hidden characters
import React from 'react'; | |
export default function CommentList({comments}) { | |
return ( | |
<div className="commentList"> | |
{comments.map(({text, author: {name, avatar, url}}) => ( | |
<div className="commentItem"> | |
<div className="avatar"><img src={avatar} /></div> | |
<div className="message"> | |
<span className="author"><a href={url}>{name}</a></span> | |
<span>{text}</span> | |
</div> | |
</div> | |
))} | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment