diff options
Diffstat (limited to 'packages/merchant-backoffice-ui/src/components/form/InputPaytoForm.tsx')
-rw-r--r-- | packages/merchant-backoffice-ui/src/components/form/InputPaytoForm.tsx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/packages/merchant-backoffice-ui/src/components/form/InputPaytoForm.tsx b/packages/merchant-backoffice-ui/src/components/form/InputPaytoForm.tsx index 68f79bc35..3cd36a6e0 100644 --- a/packages/merchant-backoffice-ui/src/components/form/InputPaytoForm.tsx +++ b/packages/merchant-backoffice-ui/src/components/form/InputPaytoForm.tsx @@ -171,7 +171,7 @@ export function InputPaytoForm<T>({ label, tooltip, }: Props<keyof T>): VNode { - const { value: paytos, onChange } = useField<T>(name); + const { value: paytos, onChange, required } = useField<T>(name); const [value, valueHandler] = useState<Partial<Entity>>(defaultTarget); @@ -198,7 +198,10 @@ export function InputPaytoForm<T>({ const paytoURL = !url ? "" : url.href; const errors: FormErrors<Entity> = { - target: value.target === noTargetValue ? i18n.str`required` : undefined, + target: + value.target === noTargetValue && !paytos.length + ? i18n.str`required` + : undefined, path1: !value.path1 ? i18n.str`required` : value.target === "iban" @@ -368,6 +371,11 @@ export function InputPaytoForm<T>({ </div> ))} {!paytos.length && i18n.str`No accounts yet.`} + {required && ( + <span class="icon has-text-danger is-right"> + <i class="mdi mdi-alert" /> + </span> + )} </div> </div> |