diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-09-22 19:34:01 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-10-24 12:23:48 +0200 |
| commit | a6ff5eee45215effb3344cb5d631a27a7c0369aa (patch) | |
| tree | 5051747acf72318b4fc5c18d603e3757fbefdfdb /src/components/templates | |
| parent | 651ea4fc992e77d2f36b3c68f8e7a70644246067 (diff) | |
refactor(components): rewrite form components
Diffstat (limited to 'src/components/templates')
| -rw-r--r-- | src/components/templates/page/page-layout.tsx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/components/templates/page/page-layout.tsx b/src/components/templates/page/page-layout.tsx index 3c6ff17..72bfd3f 100644 --- a/src/components/templates/page/page-layout.tsx +++ b/src/components/templates/page/page-layout.tsx @@ -126,11 +126,11 @@ export const PageLayout: FC<PageLayoutProps> = ({ const saveComment: CommentFormProps['saveComment'] = async (data, reset) => { if (!id) throw new Error('Page id missing. Cannot save comment.'); - const { comment: commentBody, email, name, parentId, website } = data; + const { author, comment: commentBody, email, parentId, website } = data; const commentData: SendCommentInput = { - author: name, + author, authorEmail: email, - authorUrl: website || '', + authorUrl: website ?? '', clientMutationId: 'contact', commentOn: id, content: commentBody, @@ -248,13 +248,13 @@ export const PageLayout: FC<PageLayoutProps> = ({ comments={comments} depth={2} Notice={ - isReplyRef.current === true && ( + isReplyRef.current === true && statusMessage ? ( <Notice className={styles.notice} kind={status} message={statusMessage} /> - ) + ) : null } saveComment={saveComment} /> @@ -275,13 +275,13 @@ export const PageLayout: FC<PageLayoutProps> = ({ title={commentFormTitle} titleAlignment="center" Notice={ - isReplyRef.current === false && ( + isReplyRef.current === false && statusMessage ? ( <Notice className={styles.notice} kind={status} message={statusMessage} /> - ) + ) : null } /> </section> |
