Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Youtube in React: make single comment dynamic
export function Comment(props) {
if (!props.comment) {
return <div/>;
}
const topLevelComment = props.comment.snippet.topLevelComment;
const {authorProfileImageUrl, authorDisplayName, textOriginal} = topLevelComment.snippet;
const likeCount = topLevelComment.snippet.likeCount;
return (
<div className='comment'>
<Image className='user-image' src={authorProfileImageUrl} circular />
<div>
<div className='user-name'>{authorDisplayName}</div>
<span>{textOriginal}</span>
<div className='comment-actions'>
<Rating likeCount={likeCount}/> <Button size='mini' compact>REPLY</Button>
</div>
</div>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.