From cb4764f8670f67627c407591c89b8d3637c190a7 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 25 Feb 2022 18:02:55 +0100 Subject: refactor: replace label elements with Label component --- src/components/ContactForm/ContactForm.tsx | 53 +++++++++++++++++++----------- 1 file changed, 33 insertions(+), 20 deletions(-) (limited to 'src/components/ContactForm/ContactForm.tsx') diff --git a/src/components/ContactForm/ContactForm.tsx b/src/components/ContactForm/ContactForm.tsx index 6ab1e2b..d0e5ebe 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, TextArea } from '@components/Form'; +import { Form, FormItem, Input, Label, TextArea } from '@components/Form'; import { sendMail } from '@services/graphql/mutations'; import { settings } from '@utils/config'; import { FormEvent, useState } from 'react'; @@ -83,6 +83,34 @@ const ContactForm = () => { ); }; + const getLabel = ( + body: string, + htmlFor: string, + required: boolean = false + ) => { + return