From 7d5b1448aaf38a55553ec5e0c3de6f7d63234b5c Mon Sep 17 00:00:00 2001 From: William Correa Date: Fri, 19 Apr 2024 19:39:07 -0300 Subject: [PATCH] fix: review formInput inheritance --- frontend/view/components/form/FormInput.tsx | 4 ++-- frontend/view/components/form/FormPassword.tsx | 2 +- frontend/view/components/form/FormText.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/view/components/form/FormInput.tsx b/frontend/view/components/form/FormInput.tsx index 9fb5211..7944690 100644 --- a/frontend/view/components/form/FormInput.tsx +++ b/frontend/view/components/form/FormInput.tsx @@ -12,7 +12,7 @@ export function FormInput (props: FormInputProps) { placeholder, description, fieldValue, - } = useFormComponent(props) + } = useFormComponent(props) const { type = 'text' } = props @@ -30,7 +30,7 @@ export function FormInput (props: FormInputProps) { id={fieldId} name={fieldName} placeholder={placeholder} - value={fieldValue} + value={fieldValue as string | number} onChange={onChange} /> {description && ({description})} diff --git a/frontend/view/components/form/FormPassword.tsx b/frontend/view/components/form/FormPassword.tsx index 0ec12af..405f58f 100644 --- a/frontend/view/components/form/FormPassword.tsx +++ b/frontend/view/components/form/FormPassword.tsx @@ -2,5 +2,5 @@ import { FormFieldProps } from './index.ts' import { FormInput } from './FormInput.tsx' export function FormPassword (props: FormFieldProps) { - return FormInput({ ...props, type: 'password' }) + return FormInput({ ...props, type: 'password' }) } diff --git a/frontend/view/components/form/FormText.tsx b/frontend/view/components/form/FormText.tsx index 8a1a7bf..8b3977f 100644 --- a/frontend/view/components/form/FormText.tsx +++ b/frontend/view/components/form/FormText.tsx @@ -2,5 +2,5 @@ import { FormFieldProps } from './index.ts' import { FormInput } from './FormInput.tsx' export function FormText (props: FormFieldProps) { - return FormInput({ ...props, type: 'text' }) + return FormInput({ ...props, type: 'text' }) }