update Add development environment configuration, I18n support, route adjustments, and various hooks refactoring
```
This commit is contained in:
2025-05-16 17:47:05 +08:00
parent 6b917c9fb9
commit 49189a532e
28 changed files with 274 additions and 559 deletions

View File

@@ -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>
</>
);