diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-01-07 16:34:55 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-01-07 19:04:13 +0100 |
| commit | a385d89dfd6312f2255d1343cea3f63375ce5b39 (patch) | |
| tree | cad32cfd21e188eb1c145d0fda173da7f353b591 /src/components/CommentForm/CommentForm.tsx | |
| parent | 8efb9219116a6c665d1059d3218c9405c616e404 (diff) | |
chore: improve comment section
I also adjust styles for all forms and primary buttons.
Diffstat (limited to 'src/components/CommentForm/CommentForm.tsx')
| -rw-r--r-- | src/components/CommentForm/CommentForm.tsx | 96 |
1 files changed, 51 insertions, 45 deletions
diff --git a/src/components/CommentForm/CommentForm.tsx b/src/components/CommentForm/CommentForm.tsx index b2d538f..ea02306 100644 --- a/src/components/CommentForm/CommentForm.tsx +++ b/src/components/CommentForm/CommentForm.tsx @@ -4,6 +4,7 @@ import Notice from '@components/Notice/Notice'; import { t } from '@lingui/macro'; import { createComment } from '@services/graphql/mutations'; import { useState } from 'react'; +import styles from './CommentForm.module.scss'; const CommentForm = ({ articleId, @@ -57,51 +58,56 @@ const CommentForm = ({ }; return ( - <Form submitHandler={submitHandler}> - <FormItem> - <Input - id="commenter-name" - name="commenter-name" - label={t`Name`} - required={true} - value={name} - setValue={setName} - /> - </FormItem> - <FormItem> - <Input - id="commenter-email" - name="commenter-email" - label={t`Email`} - required={true} - value={email} - setValue={setEmail} - /> - </FormItem> - <FormItem> - <Input - id="commenter-website" - name="commenter-website" - label={t`Website`} - value={website} - setValue={setWebsite} - /> - </FormItem> - <FormItem> - <TextArea - id="commenter-message" - name="commenter-message" - label={t`Comment`} - value={message} - setValue={setMessage} - required={true} - /> - </FormItem> - <ButtonSubmit>{t`Send`}</ButtonSubmit> - {isSuccess && !isApproved && ( - <Notice type="success">{t`Thanks for your comment! It is now awaiting moderation.`}</Notice> - )} - </Form> + <div className={styles.wrapper}> + <h2 className={styles.title}>{t`Leave a comment`}</h2> + <Form submitHandler={submitHandler}> + <FormItem> + <Input + id="commenter-name" + name="commenter-name" + label={t`Name`} + required={true} + value={name} + setValue={setName} + /> + </FormItem> + <FormItem> + <Input + id="commenter-email" + name="commenter-email" + label={t`Email`} + required={true} + value={email} + setValue={setEmail} + /> + </FormItem> + <FormItem> + <Input + id="commenter-website" + name="commenter-website" + label={t`Website`} + value={website} + setValue={setWebsite} + /> + </FormItem> + <FormItem> + <TextArea + id="commenter-message" + name="commenter-message" + label={t`Comment`} + value={message} + setValue={setMessage} + required={true} + /> + </FormItem> + <FormItem> + <ButtonSubmit>{t`Send`}</ButtonSubmit> + </FormItem> + {isSuccess && !isApproved && ( + <Notice type="success">{t`Thanks for your comment! It is now awaiting moderation.`}</Notice> + )} + </Form> + </div> ); }; |
