fix: update form
This commit is contained in:
@@ -13,6 +13,8 @@ type TextAreaProps = {
|
||||
children?: ReactNode;
|
||||
variant?: 'default' | 'ghost';
|
||||
fullWidth?: boolean;
|
||||
error?: string | boolean;
|
||||
errorTextColor?: string;
|
||||
} & DetailedHTMLProps<
|
||||
TextareaHTMLAttributes<HTMLTextAreaElement>,
|
||||
HTMLTextAreaElement
|
||||
@@ -24,6 +26,8 @@ const TextArea = forwardRef(function TextArea(
|
||||
children,
|
||||
variant = 'default',
|
||||
fullWidth = false,
|
||||
error = false,
|
||||
errorTextColor,
|
||||
...props
|
||||
}: TextAreaProps,
|
||||
ref: Ref<HTMLTextAreaElement>,
|
||||
@@ -33,10 +37,20 @@ const TextArea = forwardRef(function TextArea(
|
||||
<textarea
|
||||
{...props}
|
||||
ref={ref}
|
||||
className={clsx(className, s.Area, s['Area_' + variant])}
|
||||
className={clsx(
|
||||
className,
|
||||
s.Area,
|
||||
s['Area_' + variant],
|
||||
error && s.Area_error,
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
</textarea>
|
||||
{error && (
|
||||
<span className={s.Error} style={{ color: errorTextColor }}>
|
||||
{error}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user