aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/paths/admin/create/CreatePage.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/admin/create/CreatePage.tsx')
-rw-r--r--packages/merchant-backoffice-ui/src/paths/admin/create/CreatePage.tsx39
1 files changed, 38 insertions, 1 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/admin/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/admin/create/CreatePage.tsx
index bf5f5d7c9..0ef1f1270 100644
--- a/packages/merchant-backoffice-ui/src/paths/admin/create/CreatePage.tsx
+++ b/packages/merchant-backoffice-ui/src/paths/admin/create/CreatePage.tsx
@@ -48,6 +48,7 @@ function with_defaults(id?: string): Partial<Entity> {
return {
id,
payto_uris: [],
+ user_type: "business",
default_pay_delay: { d_us: 2 * 1000 * 60 * 60 * 1000 }, // two hours
default_wire_fee_amortization: 1,
default_wire_transfer_delay: { d_us: 1000 * 2 * 60 * 60 * 24 * 1000 }, // two days
@@ -69,6 +70,11 @@ export function CreatePage({ onCreate, onBack, forceId }: Props): VNode {
? i18n.str`is not valid`
: undefined,
name: !value.name ? i18n.str`required` : undefined,
+ user_type: !value.user_type
+ ? i18n.str`required`
+ : value.user_type !== "business" && value.user_type !== "individual"
+ ? i18n.str`should be business or individual`
+ : undefined,
payto_uris:
!value.payto_uris || !value.payto_uris.length
? i18n.str`required`
@@ -174,7 +180,13 @@ export function CreatePage({ onCreate, onBack, forceId }: Props): VNode {
<div class="level-item has-text-centered">
<h1 class="title">
<button
- class="button is-danger has-tooltip-bottom"
+ class={
+ !isTokenSet
+ ? "button is-danger has-tooltip-bottom"
+ : !value.auth_token
+ ? "button has-tooltip-bottom"
+ : "button is-info has-tooltip-bottom"
+ }
data-tooltip={i18n.str`change authorization configuration`}
onClick={() => updateIsTokenDialogActive(true)}
>
@@ -188,6 +200,31 @@ export function CreatePage({ onCreate, onBack, forceId }: Props): VNode {
</h1>
</div>
</div>
+ <div class="level">
+ <div class="level-item has-text-centered">
+ {!isTokenSet ? (
+ <p class="is-size-6">
+ <i18n.Translate>
+ Access token is not yet configured. This instance can't be
+ created.
+ </i18n.Translate>
+ </p>
+ ) : value.auth_token === undefined ? (
+ <p class="is-size-6">
+ <i18n.Translate>
+ No access token. Authorization must be handled externally.
+ </i18n.Translate>
+ </p>
+ ) : (
+ <p class="is-size-6">
+ <i18n.Translate>
+ Access token is set. Authorization is handled by the
+ merchant backend.
+ </i18n.Translate>
+ </p>
+ )}
+ </div>
+ </div>
</div>
</section>