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 +++++++++++++++++++----------- 1 file changed, 33 insertions(+), 20 deletions(-) (limited to 'src/components/CommentForm/CommentForm.tsx') 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