@opexa/portal-components 0.0.749 → 0.0.751

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,10 +37,10 @@ export const useCreateGCashDepositMutation = (config) => {
37
37
  });
38
38
  }, {
39
39
  until(res) {
40
- return !!res?.checkoutUrl;
40
+ return (!!res?.checkoutUrl || !!res?.error || res?.status === 'FAILED');
41
41
  },
42
42
  interval: 1000,
43
- maxAttempt: 5,
43
+ maxAttempt: 20,
44
44
  });
45
45
  const res = await poll();
46
46
  if (!res?.checkoutUrl) {
@@ -37,10 +37,10 @@ export const useCreateGCashWebpayDepositMutation = (config) => {
37
37
  });
38
38
  }, {
39
39
  until(res) {
40
- return !!res?.checkoutUrl;
40
+ return (!!res?.checkoutUrl || !!res?.error || res?.status === 'FAILED');
41
41
  },
42
42
  interval: 1000,
43
- maxAttempt: 5,
43
+ maxAttempt: 20,
44
44
  });
45
45
  const res = await poll();
46
46
  if (!res?.checkoutUrl) {
@@ -37,10 +37,10 @@ export const useCreateMayaDepositMutation = (config) => {
37
37
  });
38
38
  }, {
39
39
  until(res) {
40
- return !!res?.checkoutUrl;
40
+ return (!!res?.checkoutUrl || !!res?.error || res?.status === 'FAILED');
41
41
  },
42
42
  interval: 1000,
43
- maxAttempt: 5,
43
+ maxAttempt: 20,
44
44
  });
45
45
  const res = await poll();
46
46
  if (!res?.checkoutUrl) {
@@ -37,10 +37,10 @@ export const useCreatePisoPayDepositMutation = (config) => {
37
37
  });
38
38
  }, {
39
39
  until(res) {
40
- return !!res?.checkoutUrl;
40
+ return (!!res?.checkoutUrl || !!res?.error || res?.status === 'FAILED');
41
41
  },
42
42
  interval: 1000,
43
- maxAttempt: 5,
43
+ maxAttempt: 20,
44
44
  });
45
45
  const res = await poll();
46
46
  if (!res?.checkoutUrl) {
@@ -8,7 +8,6 @@ import { z } from 'zod';
8
8
  import { useShallow } from 'zustand/shallow';
9
9
  import { useAvailablePromosQuery } from '../../../../client/hooks/useAvailablePromosQuery.js';
10
10
  import { useCreateGCashDepositMutation } from '../../../../client/hooks/useCreateGCashDepositMutation.js';
11
- import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
12
11
  import { useDepositsCountQuery } from '../../../../client/hooks/useDepositsCountQuery.js';
13
12
  import { useDisclosure } from '../../../../client/hooks/useDisclosure.js';
14
13
  import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
@@ -46,36 +45,12 @@ export function GCashDeposit() {
46
45
  onSuccess(data) {
47
46
  invariant(data.checkoutUrl);
48
47
  window.open(data.checkoutUrl, '_blank', 'noopener,noreferrer');
49
- form.reset();
50
- disclosure.setOpen(false);
48
+ setStatus('success');
51
49
  },
52
50
  onError() {
53
- disclosure.setOpen(true);
54
51
  setStatus('failed');
55
52
  },
56
53
  });
57
- const depositQuery = useDepositQuery(createDepositMutation.data?.id, {
58
- enabled: createDepositMutation.data != null,
59
- refetchInterval(ctx) {
60
- if (ctx.state.data?.status === 'CANCELLED' ||
61
- ctx.state.data?.status === 'CONFIRMED') {
62
- return false;
63
- }
64
- else {
65
- return 2500;
66
- }
67
- },
68
- });
69
- useEffect(() => {
70
- if (depositQuery.data?.status === 'CANCELLED') {
71
- disclosure.setOpen(true);
72
- setStatus('failed');
73
- }
74
- else if (depositQuery.data?.status === 'CONFIRMED') {
75
- disclosure.setOpen(true);
76
- setStatus('success');
77
- }
78
- }, [depositQuery.data?.status, disclosure]);
79
54
  const depositsCountQuery = useDepositsCountQuery();
80
55
  const depositsCount = depositsCountQuery.data ?? 0;
81
56
  const paymentSettingsQuery = usePaymentSettingsQuery();
@@ -149,7 +124,6 @@ export function GCashDeposit() {
149
124
  }
150
125
  }, [form, minimumAmount]);
151
126
  return (_jsxs("form", { onSubmit: form.handleSubmit(async (data) => {
152
- //handle new kyc process
153
127
  if (verificationStatus === 'PENDING' ||
154
128
  verificationStatus === 'UNVERIFIED' ||
155
129
  verificationStatus === 'REJECTED' ||
@@ -177,6 +151,10 @@ export function GCashDeposit() {
177
151
  globalStore.depositWithdrawal.setPromo(null);
178
152
  }, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: createDepositMutation.isPending, children: "Deposit" }), depositWithdrawalProps.hasPrivacyPolicyAndTermsOfUse && (_jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["By depositing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] })), _jsx(AlertDialog.Root, { open: disclosure.open, onOpenChange: (details) => {
179
153
  disclosure.setOpen(details.open);
154
+ if (!details.open) {
155
+ setStatus('waiting');
156
+ form.reset();
157
+ }
180
158
  }, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "size-12 text-text-brand-primary-600" })), status === 'success' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-success-secondary text-text-featured-icon-light-success", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-error-secondary text-text-featured-icon-light-error", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Deposit', status === 'success' && 'Deposit Successful', status === 'failed' && 'Deposit Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
181
159
  "We're verifying your account and amount. Please hold a moment.", status === 'success' && (_jsxs(_Fragment, { children: ["Your deposit has been successfully processed. ", _jsx("br", {}), " If you are not redirected automatically, click", ' ', !!createDepositMutation.data?.checkoutUrl && (_jsx("a", { href: createDepositMutation.data?.checkoutUrl, target: "_blank", rel: "noopener noreferrer", className: "text-text-brand underline underline-offset-2", children: "here" })), "."] })), status === 'failed' &&
182
160
  'Something went wrong while processing your deposit. Please try again or contact support.'] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
@@ -8,7 +8,6 @@ import { z } from 'zod';
8
8
  import { useShallow } from 'zustand/shallow';
9
9
  import { useAvailablePromosQuery } from '../../../../client/hooks/useAvailablePromosQuery.js';
10
10
  import { useCreateGCashWebpayDepositMutation } from '../../../../client/hooks/useCreateGCashWebpayDepositMutation.js';
11
- import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
12
11
  import { useDepositsCountQuery } from '../../../../client/hooks/useDepositsCountQuery.js';
13
12
  import { useDisclosure } from '../../../../client/hooks/useDisclosure.js';
14
13
  import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
@@ -46,36 +45,12 @@ export function GCashWebpayDeposit() {
46
45
  onSuccess(data) {
47
46
  invariant(data.checkoutUrl);
48
47
  window.open(data.checkoutUrl, '_blank', 'noopener,noreferrer');
49
- form.reset();
50
- disclosure.setOpen(false);
48
+ setStatus('success');
51
49
  },
52
50
  onError() {
53
- disclosure.setOpen(true);
54
51
  setStatus('failed');
55
52
  },
56
53
  });
57
- const depositQuery = useDepositQuery(createDepositMutation.data?.id, {
58
- enabled: createDepositMutation.data != null,
59
- refetchInterval(ctx) {
60
- if (ctx.state.data?.status === 'CANCELLED' ||
61
- ctx.state.data?.status === 'CONFIRMED') {
62
- return false;
63
- }
64
- else {
65
- return 2500;
66
- }
67
- },
68
- });
69
- useEffect(() => {
70
- if (depositQuery.data?.status === 'CANCELLED') {
71
- disclosure.setOpen(true);
72
- setStatus('failed');
73
- }
74
- else if (depositQuery.data?.status === 'CONFIRMED') {
75
- disclosure.setOpen(true);
76
- setStatus('success');
77
- }
78
- }, [depositQuery.data?.status, disclosure]);
79
54
  const depositsCountQuery = useDepositsCountQuery();
80
55
  const depositsCount = depositsCountQuery.data ?? 0;
81
56
  const paymentSettingsQuery = usePaymentSettingsQuery();
@@ -149,7 +124,6 @@ export function GCashWebpayDeposit() {
149
124
  }
150
125
  }, [form, minimumAmount]);
151
126
  return (_jsxs("form", { onSubmit: form.handleSubmit(async (data) => {
152
- //handle new kyc process
153
127
  if (verificationStatus === 'PENDING' ||
154
128
  verificationStatus === 'UNVERIFIED' ||
155
129
  verificationStatus === 'REJECTED' ||
@@ -179,6 +153,10 @@ export function GCashWebpayDeposit() {
179
153
  globalStore.depositWithdrawal.setPromo(null);
180
154
  }, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: createDepositMutation.isPending, children: "Deposit" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["By depositing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: disclosure.open, onOpenChange: (details) => {
181
155
  disclosure.setOpen(details.open);
156
+ if (!details.open) {
157
+ setStatus('waiting');
158
+ form.reset();
159
+ }
182
160
  }, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "size-12 text-text-brand-primary-600" })), status === 'success' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-success-secondary text-text-featured-icon-light-success", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-error-secondary text-text-featured-icon-light-error", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Deposit', status === 'success' && 'Deposit Successful', status === 'failed' && 'Deposit Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
183
161
  "We're verifying your account and amount. Please hold a moment.", status === 'success' && (_jsxs(_Fragment, { children: ["Your deposit has been successfully processed. ", _jsx("br", {}), " If you are not redirected automatically, click", ' ', !!createDepositMutation.data?.checkoutUrl && (_jsx("a", { href: createDepositMutation.data?.checkoutUrl, target: "_blank", rel: "noopener noreferrer", className: "text-text-brand underline underline-offset-2", children: "here" })), "."] })), status === 'failed' &&
184
162
  'Something went wrong while processing your deposit. Please try again or contact support.'] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
@@ -8,7 +8,6 @@ import { z } from 'zod';
8
8
  import { useShallow } from 'zustand/shallow';
9
9
  import { useAvailablePromosQuery } from '../../../../client/hooks/useAvailablePromosQuery.js';
10
10
  import { useCreateMayaDepositMutation } from '../../../../client/hooks/useCreateMayaDepositMutation.js';
11
- import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
12
11
  import { useDepositsCountQuery } from '../../../../client/hooks/useDepositsCountQuery.js';
13
12
  import { useDisclosure } from '../../../../client/hooks/useDisclosure.js';
14
13
  import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
@@ -46,36 +45,12 @@ export function MayaDeposit() {
46
45
  onSuccess(data) {
47
46
  invariant(data.checkoutUrl);
48
47
  window.open(data.checkoutUrl, '_blank', 'noopener,noreferrer');
49
- form.reset();
50
- disclosure.setOpen(false);
48
+ setStatus('success');
51
49
  },
52
50
  onError() {
53
- disclosure.setOpen(true);
54
51
  setStatus('failed');
55
52
  },
56
53
  });
57
- const depositQuery = useDepositQuery(createDepositMutation.data?.id, {
58
- enabled: createDepositMutation.data != null,
59
- refetchInterval(ctx) {
60
- if (ctx.state.data?.status === 'CANCELLED' ||
61
- ctx.state.data?.status === 'CONFIRMED') {
62
- return false;
63
- }
64
- else {
65
- return 2500;
66
- }
67
- },
68
- });
69
- useEffect(() => {
70
- if (depositQuery.data?.status === 'CANCELLED') {
71
- disclosure.setOpen(true);
72
- setStatus('failed');
73
- }
74
- else if (depositQuery.data?.status === 'CONFIRMED') {
75
- disclosure.setOpen(true);
76
- setStatus('success');
77
- }
78
- }, [depositQuery.data?.status, disclosure]);
79
54
  const depositsCountQuery = useDepositsCountQuery();
80
55
  const depositsCount = depositsCountQuery.data ?? 0;
81
56
  const paymentSettingsQuery = usePaymentSettingsQuery();
@@ -149,7 +124,6 @@ export function MayaDeposit() {
149
124
  }
150
125
  }, [form, minimumAmount]);
151
126
  return (_jsxs("form", { onSubmit: form.handleSubmit(async (data) => {
152
- //handle new kyc process
153
127
  if (verificationStatus === 'PENDING' ||
154
128
  verificationStatus === 'UNVERIFIED' ||
155
129
  verificationStatus === 'REJECTED' ||
@@ -177,6 +151,10 @@ export function MayaDeposit() {
177
151
  globalStore.depositWithdrawal.setPromo(null);
178
152
  }, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: createDepositMutation.isPending, children: "Deposit" }), depositWithdrawalProps.hasPrivacyPolicyAndTermsOfUse && (_jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["By depositing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] })), _jsx(AlertDialog.Root, { open: disclosure.open, onOpenChange: (details) => {
179
153
  disclosure.setOpen(details.open);
154
+ if (!details.open) {
155
+ setStatus('waiting');
156
+ form.reset();
157
+ }
180
158
  }, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "size-12 text-text-brand-primary-600" })), status === 'success' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-success-secondary text-text-featured-icon-light-success", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-error-secondary text-text-featured-icon-light-error", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Deposit', status === 'success' && 'Deposit Successful', status === 'failed' && 'Deposit Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
181
159
  "We're verifying your account and amount. Please hold a moment.", status === 'success' && (_jsxs(_Fragment, { children: ["Your deposit has been successfully processed. ", _jsx("br", {}), " If you are not redirected automatically, click", ' ', !!createDepositMutation.data?.checkoutUrl && (_jsx("a", { href: createDepositMutation.data?.checkoutUrl, target: "_blank", rel: "noopener noreferrer", className: "text-text-brand underline underline-offset-2", children: "here" })), "."] })), status === 'failed' &&
182
160
  'Something went wrong while processing your deposit. Please try again or contact support.'] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
@@ -9,7 +9,6 @@ import { z } from 'zod';
9
9
  import { useShallow } from 'zustand/shallow';
10
10
  import { useAvailablePromosQuery } from '../../../../client/hooks/useAvailablePromosQuery.js';
11
11
  import { useCreatePisoPayDepositMutation } from '../../../../client/hooks/useCreatePisoPayDepositMutation.js';
12
- import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
13
12
  import { useDepositsCountQuery } from '../../../../client/hooks/useDepositsCountQuery.js';
14
13
  import { useDisclosure } from '../../../../client/hooks/useDisclosure.js';
15
14
  import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
@@ -45,36 +44,12 @@ export function PisoPayDeposit() {
45
44
  onSuccess(data) {
46
45
  invariant(data.checkoutUrl);
47
46
  window.open(data.checkoutUrl, '_blank', 'noopener,noreferrer');
48
- form.reset();
49
- disclosure.setOpen(false);
47
+ setStatus('success');
50
48
  },
51
49
  onError() {
52
- disclosure.setOpen(true);
53
50
  setStatus('failed');
54
51
  },
55
52
  });
56
- const depositQuery = useDepositQuery(createDepositMutation.data?.id, {
57
- enabled: createDepositMutation.data != null,
58
- refetchInterval(ctx) {
59
- if (ctx.state.data?.status === 'CANCELLED' ||
60
- ctx.state.data?.status === 'CONFIRMED') {
61
- return false;
62
- }
63
- else {
64
- return 2500;
65
- }
66
- },
67
- });
68
- useEffect(() => {
69
- if (depositQuery.data?.status === 'CANCELLED') {
70
- disclosure.setOpen(true);
71
- setStatus('failed');
72
- }
73
- else if (depositQuery.data?.status === 'CONFIRMED') {
74
- disclosure.setOpen(true);
75
- setStatus('success');
76
- }
77
- }, [depositQuery.data?.status, disclosure]);
78
53
  const depositsCountQuery = useDepositsCountQuery();
79
54
  const depositsCount = depositsCountQuery.data ?? 0;
80
55
  const paymentSettingsQuery = usePaymentSettingsQuery();
@@ -155,7 +130,6 @@ export function PisoPayDeposit() {
155
130
  }
156
131
  }, [form, minimumAmount]);
157
132
  return (_jsxs("form", { onSubmit: form.handleSubmit(async (data) => {
158
- //handle new kyc process
159
133
  if (verificationStatus === 'PENDING' ||
160
134
  verificationStatus === 'UNVERIFIED' ||
161
135
  verificationStatus === 'REJECTED' ||
@@ -189,6 +163,10 @@ export function PisoPayDeposit() {
189
163
  globalStore.depositWithdrawal.setPromo(null);
190
164
  }, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: createDepositMutation.isPending, children: "Deposit" }), depositWithdrawalProps.hasPrivacyPolicyAndTermsOfUse && (_jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["By depositing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] })), _jsx(AlertDialog.Root, { open: disclosure.open, onOpenChange: (details) => {
191
165
  disclosure.setOpen(details.open);
166
+ if (!details.open) {
167
+ setStatus('waiting');
168
+ form.reset();
169
+ }
192
170
  }, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "size-12 text-text-brand-primary-600" })), status === 'success' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-success-secondary text-text-featured-icon-light-success", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-error-secondary text-text-featured-icon-light-error", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Deposit', status === 'success' && 'Deposit Successful', status === 'failed' && 'Deposit Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
193
171
  "We're verifying your account and amount. Please hold a moment.", status === 'success' && (_jsxs(_Fragment, { children: ["Your deposit has been successfully processed. ", _jsx("br", {}), " If you are not redirected automatically, click", ' ', !!createDepositMutation.data?.checkoutUrl && (_jsx("a", { href: createDepositMutation.data?.checkoutUrl, target: "_blank", rel: "noopener noreferrer", className: "text-text-brand underline underline-offset-2", children: "here" })), "."] })), status === 'failed' &&
194
172
  'Something went wrong while processing your deposit. Please try again or contact support.'] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
@@ -11,7 +11,9 @@ export function KycOpenOnHomeMount(props) {
11
11
  const isVerificationLocked = account?.status === 'VERIFICATION_LOCKED';
12
12
  const isPending = account?.verificationStatus === 'PENDING';
13
13
  const isRejected = verification?.status === 'REJECTED';
14
- const isUnverified = verification?.status === 'UNVERIFIED' || 'UNVERIFIED'; //add default value on null return
14
+ const isUnverified = verification === null ||
15
+ verification?.status === 'UNVERIFIED' ||
16
+ verification?.status === 'CREATED'; //add default value on null return
15
17
  const isKycCompleted = account?.verified ||
16
18
  verification?.sumsubVerified ||
17
19
  verification?.status === 'APPROVED' ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.749",
3
+ "version": "0.0.751",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",