@opexa/portal-components 0.1.15 → 0.1.16
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.
- package/dist/components/KYC/KYCDefault/PersonalInformation.js +2 -3
- package/dist/components/KYC/KYCNonPagCor/IdentityVerification.js +2 -0
- package/dist/components/KYC/KYCReminder.lazy.d.ts +2 -1
- package/dist/components/KYC/KYCReminder.lazy.js +30 -3
- package/dist/components/KYC/KycOpenOnHomeMount.d.ts +2 -1
- package/dist/components/KYC/KycOpenOnHomeMount.js +7 -7
- package/package.json +1 -1
|
@@ -166,9 +166,7 @@ export function PersonalInformation() {
|
|
|
166
166
|
kyc.setDone(true);
|
|
167
167
|
globalStore.kyc.setOpen(false);
|
|
168
168
|
globalStore.kycAccountVerificationRequired.setOpen(false);
|
|
169
|
-
|
|
170
|
-
globalStore.kycReminder.setOpen(true);
|
|
171
|
-
}
|
|
169
|
+
globalStore.kycReminder.setOpen(true);
|
|
172
170
|
if (globalStore.firstTimeSignUp) {
|
|
173
171
|
globalStore.disclaimer.setOpen(true);
|
|
174
172
|
globalStore.setFirstTimeSignUp(false);
|
|
@@ -198,6 +196,7 @@ export function PersonalInformation() {
|
|
|
198
196
|
kyc.setDone(true);
|
|
199
197
|
globalStore.kyc.setOpen(false);
|
|
200
198
|
globalStore.kycAccountVerificationRequired.setOpen(false);
|
|
199
|
+
globalStore.kycReminder.setOpen(true);
|
|
201
200
|
toaster.success({
|
|
202
201
|
title: 'Success',
|
|
203
202
|
description: 'Personal information has been set successfully.',
|
|
@@ -60,6 +60,7 @@ export function IdentityVerification() {
|
|
|
60
60
|
queryClient.invalidateQueries({ queryKey: getAccountQueryKey() });
|
|
61
61
|
kyc.setDone(true);
|
|
62
62
|
globalStore.kyc.setOpen(false);
|
|
63
|
+
globalStore.kycReminder.setOpen(true);
|
|
63
64
|
},
|
|
64
65
|
onError: (error) => {
|
|
65
66
|
toaster.error({
|
|
@@ -86,6 +87,7 @@ export function IdentityVerification() {
|
|
|
86
87
|
queryClient.invalidateQueries({ queryKey: getAccountQueryKey() });
|
|
87
88
|
kyc.setDone(true);
|
|
88
89
|
globalStore.kyc.setOpen(false);
|
|
90
|
+
globalStore.kycReminder.setOpen(true);
|
|
89
91
|
},
|
|
90
92
|
onError: (error) => {
|
|
91
93
|
toaster.error({
|
|
@@ -4,6 +4,7 @@ export interface KYCReminderProps {
|
|
|
4
4
|
logo: ImageProps['src'];
|
|
5
5
|
titleBgColor?: string;
|
|
6
6
|
descriptionBgColor?: string;
|
|
7
|
+
enablePendingKycReminder?: boolean;
|
|
7
8
|
responsibleGamingLogo?: {
|
|
8
9
|
styles: string;
|
|
9
10
|
logo: ImageProps['src'];
|
|
@@ -13,4 +14,4 @@ export interface KYCReminderProps {
|
|
|
13
14
|
logo: ImageProps['src'];
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
|
-
export declare function KYCReminder(props: KYCReminderProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function KYCReminder({ enablePendingKycReminder, ...props }: KYCReminderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -22,7 +22,7 @@ import { Dialog } from '../../ui/Dialog/index.js';
|
|
|
22
22
|
import { Portal } from '../../ui/Portal/index.js';
|
|
23
23
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
24
24
|
import { getSessionQueryKey } from '../../utils/queryKeys.js';
|
|
25
|
-
export function KYCReminder(props) {
|
|
25
|
+
export function KYCReminder({ enablePendingKycReminder = false, ...props }) {
|
|
26
26
|
const router = useRouter();
|
|
27
27
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
28
28
|
kyc: ctx.kyc,
|
|
@@ -72,13 +72,19 @@ export function KYCReminder(props) {
|
|
|
72
72
|
}, [account?.dateTimeCreated]);
|
|
73
73
|
const isAccountReady = !accountLoading;
|
|
74
74
|
const isSessionReady = !sessionLoading && session?.status === 'authenticated';
|
|
75
|
-
const isKYCReminderOpen = (globalStore.kycReminder.open ||
|
|
75
|
+
const isKYCReminderOpen = (globalStore.kycReminder.open ||
|
|
76
|
+
isVerificationLocked ||
|
|
77
|
+
(enablePendingKycReminder && isPending)) &&
|
|
76
78
|
!globalStore.kyc.open &&
|
|
77
79
|
!globalStore.kycVerificationRequired.open;
|
|
78
80
|
const isDisclaimerClosed = !globalStore.disclaimer.open && !globalStore.termsOfUse.open;
|
|
81
|
+
const isPendingKycRelevant = isPending &&
|
|
82
|
+
(isVerificationLocked ||
|
|
83
|
+
enablePendingKycReminder ||
|
|
84
|
+
globalStore.kycReminder.open);
|
|
79
85
|
const isKYCStateRelevant = isNotVerified ||
|
|
80
86
|
isRejected ||
|
|
81
|
-
|
|
87
|
+
isPendingKycRelevant ||
|
|
82
88
|
(isNotVerified && isVerificationLocked);
|
|
83
89
|
return (_jsx(Dialog.Root, { open: isSessionReady &&
|
|
84
90
|
isAccountReady &&
|
|
@@ -166,5 +172,26 @@ export function KYCReminder(props) {
|
|
|
166
172
|
globalStore.account.setOpen(false);
|
|
167
173
|
globalStore.account__mobile.setOpen(false);
|
|
168
174
|
router.push('/');
|
|
175
|
+
}, children: "Log Out" }) })] })), isPending &&
|
|
176
|
+
!isVerificationLocked &&
|
|
177
|
+
(enablePendingKycReminder || globalStore.kycReminder.open) && (_jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto mb-4 w-fit rounded-full bg-bg-primary p-2", children: _jsx(Image, { src: props.logo, alt: `${props.siteName} logo`, width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }) }), _jsx("h2", { className: `mt-4 font-semibold text-lg ${props.titleBgColor}`, children: "VERIFICATION IN PROGRESS" }), _jsx("p", { className: `mt-xs text-sm text-text-tertiary-600 ${props.descriptionBgColor}`, children: "Your account verification is currently under review. Please wait for approval to regain full access to this platform." }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-3xl", children: [_jsx(Image, { src: props.pagcorLogo?.logo ?? pagcorLogo, alt: "PAGCOR logo", height: 88, width: 88, className: `h-[88px] w-auto shrink-0 ${props.pagcorLogo?.styles ?? ''}`, draggable: false, unoptimized: true }), _jsx(Image, { src: props.responsibleGamingLogo?.logo ?? responsibleGamingLogo, alt: "Responsible Gaming logo", height: 50, width: 186, className: `h-[50px] w-auto shrink-0 ${props.responsibleGamingLogo?.styles ?? ''}`, draggable: false, unoptimized: true })] }), _jsx("div", { className: "mt-6 space-y-lg", children: _jsx(Button, { className: "bg-transparent text-text-brand-primary-600", onClick: async () => {
|
|
178
|
+
if (Capacitor.isNativePlatform()) {
|
|
179
|
+
const session = await getQueryClient().fetchQuery({
|
|
180
|
+
queryKey: getSessionQueryKey(),
|
|
181
|
+
queryFn: async () => getSession(),
|
|
182
|
+
});
|
|
183
|
+
invariant(session.status === 'authenticated');
|
|
184
|
+
await unregisterFCMDevice({
|
|
185
|
+
type: ['IOS', 'ANDROID'],
|
|
186
|
+
}, {
|
|
187
|
+
headers: {
|
|
188
|
+
Authorization: `Bearer ${session.token}`,
|
|
189
|
+
},
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
signOutMutation.mutate();
|
|
193
|
+
globalStore.account.setOpen(false);
|
|
194
|
+
globalStore.account__mobile.setOpen(false);
|
|
195
|
+
router.push('/');
|
|
169
196
|
}, children: "Log Out" }) })] }))] }) })] }) }));
|
|
170
197
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export interface KycOpenOnHomeMountProps {
|
|
2
2
|
isSkippable?: boolean;
|
|
3
3
|
bypassKycCheck?: boolean;
|
|
4
|
+
enablePendingKycReminder?: boolean;
|
|
4
5
|
}
|
|
5
|
-
export declare function KycOpenOnHomeMount(
|
|
6
|
+
export declare function KycOpenOnHomeMount({ isSkippable, bypassKycCheck, enablePendingKycReminder, }: KycOpenOnHomeMountProps): null;
|
|
@@ -3,7 +3,7 @@ import { useEffect } from 'react';
|
|
|
3
3
|
import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
|
|
4
4
|
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
5
5
|
import { useMemberVerificationQuery } from '../../client/hooks/useMemberVerificationQuery.js';
|
|
6
|
-
export function KycOpenOnHomeMount(
|
|
6
|
+
export function KycOpenOnHomeMount({ isSkippable, bypassKycCheck, enablePendingKycReminder = false, }) {
|
|
7
7
|
const setkycReminderOpen = useGlobalStore((s) => s.kycReminder.setOpen);
|
|
8
8
|
const setkycOpen = useGlobalStore((s) => s.kyc.setOpen);
|
|
9
9
|
const setkycAccountVerificationRequired = useGlobalStore((s) => s.kycAccountVerificationRequired.setOpen);
|
|
@@ -27,11 +27,11 @@ export function KycOpenOnHomeMount(props) {
|
|
|
27
27
|
account?.verificationStatus === 'VERIFIED';
|
|
28
28
|
useEffect(() => {
|
|
29
29
|
// If bypass is enabled, do nothing.
|
|
30
|
-
if (
|
|
30
|
+
if (bypassKycCheck) {
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
if (!verificationLoading && !accountLoading && !isSignUpOpen) {
|
|
34
|
-
const shouldShowReminder = Boolean(
|
|
34
|
+
const shouldShowReminder = Boolean(isSkippable) && !isVerificationLocked;
|
|
35
35
|
const hasSeenKycModal = sessionStorage.getItem('hasSeenKycModal');
|
|
36
36
|
const isFirstVisit = !hasSeenKycModal;
|
|
37
37
|
if (isKycCompleted) {
|
|
@@ -43,11 +43,10 @@ export function KycOpenOnHomeMount(props) {
|
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
// If a resubmission is already pending review, do not re-open KYC.
|
|
46
|
-
// Optionally show the reminder if the account is verification-locked.
|
|
47
46
|
if (isPending) {
|
|
48
47
|
setkycOpen(false);
|
|
49
48
|
setkycAccountVerificationRequired(false);
|
|
50
|
-
setkycReminderOpen(isVerificationLocked);
|
|
49
|
+
setkycReminderOpen(isVerificationLocked || enablePendingKycReminder);
|
|
51
50
|
return;
|
|
52
51
|
}
|
|
53
52
|
// Handle rejected verification status
|
|
@@ -100,8 +99,9 @@ export function KycOpenOnHomeMount(props) {
|
|
|
100
99
|
isRejected,
|
|
101
100
|
isUnverified,
|
|
102
101
|
isKycCompleted,
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
isSkippable,
|
|
103
|
+
bypassKycCheck,
|
|
104
|
+
enablePendingKycReminder,
|
|
105
105
|
]);
|
|
106
106
|
return null;
|
|
107
107
|
}
|