From 05a7ed215b27cf5c4f77d5115037febff4b141fc Mon Sep 17 00:00:00 2001 From: IRBorisov <8611739+IRBorisov@users.noreply.github.com> Date: Thu, 10 Aug 2023 14:13:34 +0300 Subject: [PATCH] Improve input customization --- .../src/components/Common/TextArea.tsx | 33 +++++++------------ .../src/components/Common/TextInput.tsx | 9 +++-- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/rsconcept/frontend/src/components/Common/TextArea.tsx b/rsconcept/frontend/src/components/Common/TextArea.tsx index fc84493c..ec8ceed8 100644 --- a/rsconcept/frontend/src/components/Common/TextArea.tsx +++ b/rsconcept/frontend/src/components/Common/TextArea.tsx @@ -1,24 +1,20 @@ +import { TextareaHTMLAttributes } from 'react'; + import Label from './Label'; -interface TextAreaProps { - id: string +interface TextAreaProps +extends Omit, 'className'> { label: string - required?: boolean - disabled?: boolean - spellCheck?: boolean - placeholder?: string widthClass?: string - rows?: number - value?: string | ReadonlyArray | number | undefined; - onChange?: (event: React.ChangeEvent) => void - onFocus?: () => void + colorClass?: string } function TextArea({ - id, label, placeholder, - required, spellCheck, disabled, - widthClass = 'w-full', rows = 4, value, - onChange, onFocus + id, label, required, + widthClass = 'w-full', + colorClass = 'colorClass', + rows = 4, + ...props }: TextAreaProps) { return (
@@ -28,15 +24,10 @@ function TextArea({ htmlFor={id} />