diff options
Diffstat (limited to 'packages/demobank-ui/src/pages/admin/AccountForm.tsx')
-rw-r--r-- | packages/demobank-ui/src/pages/admin/AccountForm.tsx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/packages/demobank-ui/src/pages/admin/AccountForm.tsx b/packages/demobank-ui/src/pages/admin/AccountForm.tsx index 5d8e3797a..b38d40012 100644 --- a/packages/demobank-ui/src/pages/admin/AccountForm.tsx +++ b/packages/demobank-ui/src/pages/admin/AccountForm.tsx @@ -61,12 +61,12 @@ export function AccountForm({ : validateIBAN(parsed.iban, i18n)) as PaytoString, contact_data: undefinedIfEmpty({ email: !newForm.contact_data?.email - ? i18n.str`required` + ? undefined : !EMAIL_REGEX.test(newForm.contact_data.email) ? i18n.str`it should be an email` : undefined, phone: !newForm.contact_data?.phone - ? i18n.str`required` + ? undefined : !newForm.contact_data.phone.startsWith("+") ? i18n.str`should start with +` : !REGEX_JUST_NUMBERS_REGEX.test(newForm.contact_data.phone) @@ -152,7 +152,7 @@ export function AccountForm({ name="name" data-error={!!errors?.name && form.name !== undefined} id="name" - disabled={purpose !== "create"} + disabled={purpose === "show"} value={form.name ?? ""} onChange={(e) => { form.name = e.currentTarget.value; @@ -189,7 +189,7 @@ export function AccountForm({ name="email" id="email" data-error={!!errors?.contact_data?.email && form.contact_data?.email !== undefined} - disabled={purpose !== "create"} + disabled={purpose === "show"} value={form.contact_data?.email ?? ""} onChange={(e) => { if (form.contact_data) { @@ -273,7 +273,11 @@ export function AccountForm({ <i18n.Translate>account number where the money is going to be sent when doing cashouts</i18n.Translate> </p> </div> - + <div class="sm:col-span-5"> + <pre> + {JSON.stringify(errors, undefined, 2)} + </pre> + </div> </div> </div> {children} |