fix: mobile form ui and parse phone number bug

This commit is contained in:
Christel Westerberg
2024-07-17 09:38:30 +02:00
parent 09b1d322a7
commit da74babef9
6 changed files with 87 additions and 42 deletions

View File

@@ -61,41 +61,47 @@ export default function Form({ user }: EditFormProps) {
})
return (
<>
<Header>
<hgroup>
<Title as="h4" color="red" level="h1" textTransform="capitalize">
{formatMessage({ id: "Welcome" })}
</Title>
<Title as="h4" color="burgundy" level="h2" textTransform="capitalize">
{user.name}
</Title>
</hgroup>
<div className={styles.btns}>
<Button asChild intent="secondary" size="small" theme="base">
<Link href={profile[lang]}>
{formatMessage({ id: "Discard changes" })}
</Link>
</Button>
<Button
disabled={
!methods.formState.isValid || methods.formState.isSubmitting
}
form={formId}
intent="primary"
size="small"
theme="base"
type="submit"
>
{formatMessage({ id: "Save" })}
</Button>
</div>
</Header>
<section className={styles.container}>
<hgroup className={styles.title}>
<Title as="h4" color="red" level="h1" textTransform="capitalize">
{formatMessage({ id: "Welcome" })}
</Title>
<Title as="h4" color="burgundy" level="h2" textTransform="capitalize">
{user.name}
</Title>
</hgroup>
<div className={styles.btnContainer}>
<Button
asChild
intent="secondary"
size="small"
theme="base"
className={styles.btn}
>
<Link href={profile[lang]}>
{formatMessage({ id: "Discard changes" })}
</Link>
</Button>
<Button
disabled={
!methods.formState.isValid || methods.formState.isSubmitting
}
className={styles.btn}
form={formId}
intent="primary"
size="small"
theme="base"
type="submit"
>
{formatMessage({ id: "Save" })}
</Button>
</div>
<form action={formAction} className={styles.form} id={formId}>
<FormProvider {...methods}>
<FormContent />
</FormProvider>
</form>
</>
</section>
)
}