diff options
author | Sebastian <sebasjm@gmail.com> | 2023-11-22 15:20:06 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-11-22 15:20:29 -0300 |
commit | 305c513c2bcc2b25fe57cf0ed9723781944f9f3f (patch) | |
tree | 2022b093f6bed0bfd74c257168033b206850e2b0 /packages/demobank-ui/src/pages/admin/AccountForm.tsx | |
parent | 33c0267b37eecf44dc9f04e124eb44d27cba700c (diff) | |
download | wallet-core-305c513c2bcc2b25fe57cf0ed9723781944f9f3f.tar.xz |
more cashout ui
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} |