mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Added basic replies
This commit is contained in:
parent
f498811321
commit
3ce42c05f6
2 changed files with 18 additions and 1 deletions
|
@ -6,6 +6,7 @@ import Like from './Like';
|
|||
// import Reply from './Reply';
|
||||
import More from './More';
|
||||
import EditForm from './EditForm';
|
||||
import Replies from './Replies';
|
||||
|
||||
class Comment extends React.Component {
|
||||
static contextType = AppContext;
|
||||
|
@ -67,9 +68,13 @@ class Comment extends React.Component {
|
|||
<div className="ml-14 mb-2.5 pr-4 font-sans leading-normal dark:text-neutral-300">
|
||||
<p dangerouslySetInnerHTML={html} className="whitespace-pre-wrap"></p>
|
||||
</div>
|
||||
|
||||
<div className="ml-14 flex gap-5">
|
||||
<Like comment={comment} />
|
||||
|
||||
{comment.replies && comment.replies.length > 0 && <Replies replies={comment.replies} />}
|
||||
{/* <Reply comment={comment} /> */}
|
||||
|
||||
<More comment={comment} show={this.hasMoreContextMenu} toggleEdit={this.toggleEditMode} />
|
||||
</div>
|
||||
</div>
|
||||
|
@ -78,5 +83,5 @@ class Comment extends React.Component {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export default Comment;
|
||||
|
|
12
apps/comments-ui/src/components/Replies.js
Normal file
12
apps/comments-ui/src/components/Replies.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
import Comment from './Comment';
|
||||
|
||||
const Replies = (props) => {
|
||||
return (
|
||||
<div>
|
||||
{console.log(props.replies)}
|
||||
{props.replies.map((reply => <Comment comment={reply} key={reply.id} />))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Replies;
|
Loading…
Reference in a new issue