```
update Add development environment configuration, I18n support, route adjustments, and various hooks refactoring ```
This commit is contained in:
@@ -7,7 +7,23 @@ interface CustomFieldProps {
|
||||
label: string;
|
||||
required: boolean;
|
||||
input: {
|
||||
props: { type: string; placeholder: string };
|
||||
props: {
|
||||
type:
|
||||
| 'date'
|
||||
| 'email'
|
||||
| 'number'
|
||||
| 'password'
|
||||
| 'search'
|
||||
| 'tel'
|
||||
| 'text'
|
||||
| 'url'
|
||||
| 'time'
|
||||
| 'week'
|
||||
| 'month'
|
||||
| 'datetime-local';
|
||||
placeholder: string;
|
||||
//
|
||||
};
|
||||
state: {
|
||||
value: string;
|
||||
reset: (newValue: any) => void;
|
||||
@@ -20,8 +36,8 @@ interface CustomFieldProps {
|
||||
}
|
||||
|
||||
function CustomField({ field, errors }: CustomFieldProps): React.JSX.Element {
|
||||
const error = errors && errors.filter((e) => e.id === field.id)[0];
|
||||
const errorMessage = error && errors.filter((e) => e.id === field.id)[0].message;
|
||||
const error = errors && errors.filter((e: { id: string }) => e.id === field.id)[0];
|
||||
const errorMessage = error && errors.filter((e: { id: string }) => e.id === field.id)[0].message;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -30,7 +46,12 @@ function CustomField({ field, errors }: CustomFieldProps): React.JSX.Element {
|
||||
{field.label}
|
||||
{error && <p className="animate__animated animate__bounceIn">{errorMessage}</p>}
|
||||
</IonLabel>
|
||||
<IonInput className={styles.customInput} {...field.input.props} {...field.input.state} />
|
||||
<IonInput
|
||||
className={styles.customInput}
|
||||
{...field.input.state}
|
||||
{...field.input.props}
|
||||
//
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
Reference in New Issue
Block a user