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/CommentForm/CommentForm.tsx | 53 +++++++++++++++++++----------- src/components/ContactForm/ContactForm.tsx | 53 +++++++++++++++++++----------- src/components/Form/Form.module.scss | 12 ------- src/components/Form/Input/Input.tsx | 19 +++++------ src/components/Form/TextArea/TextArea.tsx | 13 ++------ 5 files changed, 78 insertions(+), 72 deletions(-) (limited to 'src') diff --git a/src/components/CommentForm/CommentForm.tsx b/src/components/CommentForm/CommentForm.tsx index 762bb75..3539311 100644 --- a/src/components/CommentForm/CommentForm.tsx +++ b/src/components/CommentForm/CommentForm.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 Notice from '@components/Notice/Notice'; import Spinner from '@components/Spinner/Spinner'; import { createComment } from '@services/graphql/mutations'; @@ -106,6 +106,34 @@ const CommentForm = ( isReply ? styles['wrapper--reply'] : '' }`; + const getLabel = ( + body: string, + htmlFor: string, + required: boolean = false + ) => { + return