1
0
Fork 0

fix up comments logic for displaying

This commit is contained in:
Amarpreet Minhas 2020-01-29 20:56:22 -05:00
parent 25e536bf7e
commit 221787eba4

View file

@ -18,26 +18,25 @@ class Post extends React.Component {
.then(() => this.setState({isLoading: false}))
}
renderComments() {
//if (comments.length) {
//return comments.map(comment => {
// return (
// <div className="item" key={comment.id}>
// <div className="content">
// <div className="markdown-body">
// <ReactMarkdown source={comment.content} />
// </div>
// </div>
// </div>
// );
//});
//}
renderComments(comments) {
if (comments) {
return comments.map(comment => {
return (
<div className="item" key={comment.id}>
<div className="content">
<div className="markdown-body">
<ReactMarkdown source={comment.content} />
</div>
</div>
</div>
);
});
}
}
renderPost() {
const {posts} = this.props
const post = posts.entities[posts.currentId]
console.log(post)
return(
<div className="container">
<div className="item" key={post.id}>