summaryrefslogtreecommitdiffstats
path: root/src/components/Form/TextArea
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-02-25 18:02:55 +0100
committerArmand Philippot <git@armandphilippot.com>2022-02-25 18:13:49 +0100
commitcb4764f8670f67627c407591c89b8d3637c190a7 (patch)
treebc95737e6d7f3ccca1b40c469591c5687327ddeb /src/components/Form/TextArea
parent774d5b4c538d93889bf743b6cd7d01a85f8715e6 (diff)
refactor: replace label elements with Label component
Diffstat (limited to 'src/components/Form/TextArea')
-rw-r--r--src/components/Form/TextArea/TextArea.tsx13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/components/Form/TextArea/TextArea.tsx b/src/components/Form/TextArea/TextArea.tsx
index e1e7e0f..b8894ab 100644
--- a/src/components/Form/TextArea/TextArea.tsx
+++ b/src/components/Form/TextArea/TextArea.tsx
@@ -1,4 +1,4 @@
-import { ChangeEvent, SetStateAction } from 'react';
+import { ChangeEvent, ReactElement, SetStateAction } from 'react';
import styles from '../Form.module.scss';
const TextArea = ({
@@ -6,15 +6,13 @@ const TextArea = ({
name,
value,
setValue,
- required = false,
label,
}: {
id: string;
name: string;
value: string;
setValue: (value: SetStateAction<string>) => void;
- required?: boolean;
- label?: string;
+ label?: ReactElement;
}) => {
const updateValue = (e: ChangeEvent<HTMLTextAreaElement>) => {
setValue(e.target.value);
@@ -22,12 +20,7 @@ const TextArea = ({
return (
<>
- {label && (
- <label htmlFor={id} className={styles.label}>
- {label}
- {required && <span className={styles.required}> *</span>}
- </label>
- )}
+ {label}
<textarea
id={id}
name={name}