fix up comments logic for displaying
This commit is contained in:
parent
25e536bf7e
commit
221787eba4
1 changed files with 14 additions and 15 deletions
|
@ -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}>
|
||||
|
|
Reference in a new issue