diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-05-15 17:45:41 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-05-15 19:06:42 +0200 |
| commit | c95cce04393080a52a54191cff7be8fec68af4b0 (patch) | |
| tree | 1022bc574c8fc8e657be922b26c1cf16cbfd9071 /src/components/organisms/layout/comment.tsx | |
| parent | 235fe67d770f83131c9ec10b99012319440db690 (diff) | |
chore: add Article pages
Diffstat (limited to 'src/components/organisms/layout/comment.tsx')
| -rw-r--r-- | src/components/organisms/layout/comment.tsx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/components/organisms/layout/comment.tsx b/src/components/organisms/layout/comment.tsx index 248efc2..6df393b 100644 --- a/src/components/organisms/layout/comment.tsx +++ b/src/components/organisms/layout/comment.tsx @@ -25,7 +25,7 @@ export type CommentAuthor = { url?: string; }; -export type CommentProps = { +export type CommentProps = Pick<CommentFormProps, 'Notice' | 'saveComment'> & { /** * The comment author data. */ @@ -50,10 +50,6 @@ export type CommentProps = { * The comment date and time separated with a space. */ publication: string; - /** - * A callback function to save comment form data. - */ - saveComment: CommentFormProps['saveComment']; }; /** @@ -66,6 +62,7 @@ const Comment: FC<CommentProps> = ({ canReply = true, content, id, + Notice, parentId, publication, saveComment, @@ -169,7 +166,10 @@ const Comment: FC<CommentProps> = ({ className={styles.date} groupClassName={styles.date__item} /> - <div className={styles.body}>{content}</div> + <div + className={styles.body} + dangerouslySetInnerHTML={{ __html: content }} + /> <footer className={styles.footer}> {canReply && ( <Button kind="tertiary" onClick={() => setIsReplying(!isReplying)}> @@ -180,6 +180,8 @@ const Comment: FC<CommentProps> = ({ </article> {isReplying && ( <CommentForm + Notice={Notice} + parentId={id as number} saveComment={saveComment} title={formTitle} className={`${styles.wrapper} ${styles['wrapper--form']}`} |
