Improve comments component

This commit is contained in:
riggraz
2019-09-20 18:43:24 +02:00
parent 0b88d58094
commit 38345f9c42
9 changed files with 64 additions and 14 deletions

View File

@@ -20,6 +20,8 @@ interface Props {
handleToggleCommentReply(): void;
handleCommentReplyBodyChange(e: FormEvent): void;
handleSubmitComment(body: string, parentId: number): void;
isLoggedIn: boolean;
}
const Comment = ({
@@ -34,6 +36,8 @@ const Comment = ({
handleToggleCommentReply,
handleCommentReplyBodyChange,
handleSubmitComment,
isLoggedIn,
}: Props) => (
<div className="comment">
<div className="commentHeader">
@@ -52,8 +56,11 @@ const Comment = ({
<NewComment
body={reply.body}
parentId={id}
isSubmitting={reply.isSubmitting}
handleChange={handleCommentReplyBodyChange}
handleSubmit={handleSubmitComment}
isLoggedIn={isLoggedIn}
/>
:
null