diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-02-25 19:17:09 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-02-25 19:17:09 +0100 |
| commit | e26d821f738525477472e631d170d9ed218c1603 (patch) | |
| tree | 70ec0c29d003d462de6926f1faa09354e3ff6d90 /src/components/ContactForm | |
| parent | cb4764f8670f67627c407591c89b8d3637c190a7 (diff) | |
chore: combine input/textarea/select in a single component
Diffstat (limited to 'src/components/ContactForm')
| -rw-r--r-- | src/components/ContactForm/ContactForm.tsx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/components/ContactForm/ContactForm.tsx b/src/components/ContactForm/ContactForm.tsx index d0e5ebe..48772a0 100644 --- a/src/components/ContactForm/ContactForm.tsx +++ b/src/components/ContactForm/ContactForm.tsx @@ -1,5 +1,5 @@ import { ButtonSubmit } from '@components/Buttons'; -import { Form, FormItem, Input, Label, TextArea } from '@components/Form'; +import { Field, Form, FormItem, Label } from '@components/FormElements'; import { sendMail } from '@services/graphql/mutations'; import { settings } from '@utils/config'; import { FormEvent, useState } from 'react'; @@ -115,26 +115,28 @@ const ContactForm = () => { <> <Form submitHandler={submitHandler}> <FormItem> - <Input + <Field id="contact-name" name="name" value={name} setValue={setName} + required={true} label={getLabel(nameLabelBody, 'contact-name', true)} /> </FormItem> <FormItem> - <Input + <Field id="contact-email" - type="email" + kind="email" name="email" value={email} setValue={setEmail} + required={true} label={getLabel(emailLabelBody, 'contact-email', true)} /> </FormItem> <FormItem> - <Input + <Field id="contact-subject" name="subject" value={subject} @@ -143,11 +145,13 @@ const ContactForm = () => { /> </FormItem> <FormItem> - <TextArea + <Field id="contact-message" + kind="textarea" name="message" value={message} setValue={setMessage} + required={true} label={getLabel(messageLabelBody, 'contact-message', true)} /> </FormItem> |
