@opexa/portal-components 0.0.685 → 0.0.686
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/KYCReminder.lazy.js +67 -6
- package/dist/components/KYC/KycOpenOnHomeMount.js +54 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Carousel/Carousel.d.ts +45 -45
- package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +90 -90
- package/dist/ui/Menu/menu.recipe.d.ts +5 -5
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +55 -55
- package/dist/ui/Popover/popover.recipe.d.ts +5 -5
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/Banner/Banner.client.d.ts +0 -12
- package/dist/components/Banner/Banner.client.js +0 -49
- package/dist/components/DigitainLauncher/Loading.d.ts +0 -1
- package/dist/components/DigitainLauncher/Loading.js +0 -5
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +0 -184
- package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +0 -184
- package/dist/components/KYC/BasicInformation.d.ts +0 -1
- package/dist/components/KYC/BasicInformation.js +0 -101
- package/dist/components/KYC/IdentityVerification.d.ts +0 -1
- package/dist/components/KYC/IdentityVerification.js +0 -120
- package/dist/components/KYC/Indicator.d.ts +0 -1
- package/dist/components/KYC/Indicator.js +0 -8
- package/dist/components/KYC/KYC.lazy.d.ts +0 -6
- package/dist/components/KYC/KYC.lazy.js +0 -45
- package/dist/components/KYC/KYCContext.d.ts +0 -6
- package/dist/components/KYC/KYCContext.js +0 -2
- package/dist/components/KYC/KYCDefault/BasicInformation.d.ts +0 -1
- package/dist/components/KYC/KYCDefault/BasicInformation.js +0 -101
- package/dist/components/KYC/KYCVerificationStatus.d.ts +0 -1
- package/dist/components/KYC/KYCVerificationStatus.js +0 -10
- package/dist/components/KYC/KYCVerificationStatus.lazy.d.ts +0 -1
- package/dist/components/KYC/KYCVerificationStatus.lazy.js +0 -36
- package/dist/components/KYC/PersonalInformation.d.ts +0 -1
- package/dist/components/KYC/PersonalInformation.js +0 -122
- package/dist/components/KYC/useKYC.d.ts +0 -25
- package/dist/components/KYC/useKYC.js +0 -38
- package/dist/components/PortalProvider/AndroidOnlyComponents.d.ts +0 -1
- package/dist/components/PortalProvider/AndroidOnlyComponents.js +0 -12
- package/dist/components/PortalProvider/CXDTokenObserver.d.ts +0 -1
- package/dist/components/PortalProvider/CXDTokenObserver.js +0 -30
- package/dist/components/PortalProvider/LinkGoogleAccountObserver.d.ts +0 -1
- package/dist/components/PortalProvider/LinkGoogleAccountObserver.js +0 -29
- package/dist/components/SessionWatcher/SessionWatcher.d.ts +0 -1
- package/dist/components/SessionWatcher/SessionWatcher.js +0 -20
- package/dist/components/SessionWatcher/index.d.ts +0 -1
- package/dist/components/SessionWatcher/index.js +0 -1
- package/dist/components/SignIn/utils.d.ts +0 -8
- package/dist/components/SignIn/utils.js +0 -26
- package/dist/constants/Branches.d.ts +0 -2
- package/dist/constants/Branches.js +0 -42
- package/dist/images/responsible-gaming-yellow.png +0 -0
- package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +0 -4
- package/dist/third-parties/FacebookPixel/FacebookPixel.js +0 -4
- package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
- package/dist/third-parties/FacebookPixel/api.js +0 -1
- package/dist/third-parties/FacebookPixel/index.d.ts +0 -1
- package/dist/third-parties/FacebookPixel/index.js +0 -1
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +0 -4
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +0 -4
- package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
- package/dist/third-parties/GoogleRecaptcha/api.js +0 -1
- package/dist/third-parties/GoogleRecaptcha/index.d.ts +0 -1
- package/dist/third-parties/GoogleRecaptcha/index.js +0 -1
- package/dist/third-parties/index.d.ts +0 -2
- package/dist/third-parties/index.js +0 -2
|
@@ -17,6 +17,12 @@ import { Button } from '../../ui/Button/index.js';
|
|
|
17
17
|
import { Dialog } from '../../ui/Dialog/index.js';
|
|
18
18
|
import { Portal } from '../../ui/Portal/index.js';
|
|
19
19
|
export function KYCReminder(props) {
|
|
20
|
+
console.log('[KYCReminder] Component rendered with props:', {
|
|
21
|
+
siteName: props.siteName,
|
|
22
|
+
hasLogo: !!props.logo,
|
|
23
|
+
hasTitleBgColor: !!props.titleBgColor,
|
|
24
|
+
hasDescriptionBgColor: !!props.descriptionBgColor
|
|
25
|
+
});
|
|
20
26
|
const router = useRouter();
|
|
21
27
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
22
28
|
kyc: ctx.kyc,
|
|
@@ -44,9 +50,22 @@ export function KYCReminder(props) {
|
|
|
44
50
|
});
|
|
45
51
|
const { data: session, isLoading: sessionLoading } = useSessionQuery();
|
|
46
52
|
const { data: account, isLoading: accountLoading } = useAccountQuery();
|
|
53
|
+
console.log('[KYCReminder] Query states:', {
|
|
54
|
+
sessionLoading,
|
|
55
|
+
accountLoading,
|
|
56
|
+
sessionStatus: session?.status,
|
|
57
|
+
hasAccount: !!account
|
|
58
|
+
});
|
|
47
59
|
const isPending = account?.verificationStatus === 'PENDING';
|
|
48
60
|
const isNotVerified = account?.verificationStatus === 'UNVERIFIED';
|
|
49
61
|
const isVerificationLocked = account?.status === 'VERIFICATION_LOCKED';
|
|
62
|
+
console.log('[KYCReminder] Account verification states:', {
|
|
63
|
+
verificationStatus: account?.verificationStatus,
|
|
64
|
+
accountStatus: account?.status,
|
|
65
|
+
isPending,
|
|
66
|
+
isNotVerified,
|
|
67
|
+
isVerificationLocked
|
|
68
|
+
});
|
|
50
69
|
const daysFromCreationToNow = useMemo(() => {
|
|
51
70
|
if (!account?.dateTimeCreated)
|
|
52
71
|
return 0;
|
|
@@ -54,6 +73,12 @@ export function KYCReminder(props) {
|
|
|
54
73
|
const now = new Date();
|
|
55
74
|
return differenceInCalendarDays(now, creationDate);
|
|
56
75
|
}, [account?.dateTimeCreated]);
|
|
76
|
+
console.log('[KYCReminder] Account timing:', {
|
|
77
|
+
dateTimeCreated: account?.dateTimeCreated,
|
|
78
|
+
daysFromCreationToNow,
|
|
79
|
+
isWithin3Days: daysFromCreationToNow <= 3,
|
|
80
|
+
isAfter1Day: daysFromCreationToNow > 1
|
|
81
|
+
});
|
|
57
82
|
const isAccountReady = !accountLoading;
|
|
58
83
|
const isSessionReady = !sessionLoading && session?.status === 'authenticated';
|
|
59
84
|
const isKYCReminderOpen = globalStore.kycReminder.open && !globalStore.kyc.open;
|
|
@@ -61,13 +86,49 @@ export function KYCReminder(props) {
|
|
|
61
86
|
const isKYCStateRelevant = isNotVerified ||
|
|
62
87
|
(isPending && isVerificationLocked) ||
|
|
63
88
|
(isNotVerified && isVerificationLocked);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
89
|
+
console.log('[KYCReminder] Global store states:', {
|
|
90
|
+
kycReminderOpen: globalStore.kycReminder.open,
|
|
91
|
+
kycOpen: globalStore.kyc.open,
|
|
92
|
+
responsibleGamingReminderOpen: globalStore.responsibleGamingReminder.open,
|
|
93
|
+
isKYCReminderOpen,
|
|
94
|
+
isResponsibleGamingReminderClosed
|
|
95
|
+
});
|
|
96
|
+
console.log('[KYCReminder] Ready states:', {
|
|
97
|
+
isAccountReady,
|
|
98
|
+
isSessionReady,
|
|
99
|
+
isKYCStateRelevant
|
|
100
|
+
});
|
|
101
|
+
const shouldModalOpen = isSessionReady &&
|
|
102
|
+
isAccountReady &&
|
|
103
|
+
isKYCReminderOpen &&
|
|
104
|
+
isKYCStateRelevant &&
|
|
105
|
+
isResponsibleGamingReminderClosed;
|
|
106
|
+
console.log('[KYCReminder] Final modal decision:', {
|
|
107
|
+
shouldModalOpen,
|
|
108
|
+
conditions: {
|
|
109
|
+
isSessionReady,
|
|
110
|
+
isAccountReady,
|
|
111
|
+
isKYCReminderOpen,
|
|
112
|
+
isKYCStateRelevant,
|
|
113
|
+
isResponsibleGamingReminderClosed
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
return (_jsx(Dialog.Root, { open: shouldModalOpen, onOpenChange: (details) => {
|
|
117
|
+
console.log('[KYCReminder] Dialog open change:', details);
|
|
69
118
|
globalStore.kycReminder.setOpen(details.open);
|
|
70
|
-
}, closeOnEscape: false, closeOnInteractOutside: false, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "mx-auto h-fit max-w-[calc(100dvw-1rem)] overflow-y-auto rounded-lg bg-bg-primary lg:max-w-[400px]", children: [
|
|
119
|
+
}, closeOnEscape: false, closeOnInteractOutside: false, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "mx-auto h-fit max-w-[calc(100dvw-1rem)] overflow-y-auto rounded-lg bg-bg-primary lg:max-w-[400px]", children: [(() => {
|
|
120
|
+
const condition1 = !isPending && isNotVerified && isVerificationLocked;
|
|
121
|
+
const condition2 = isNotVerified && daysFromCreationToNow <= 3 && daysFromCreationToNow > 1 && !isVerificationLocked;
|
|
122
|
+
const condition3 = isNotVerified && !isVerificationLocked && !(daysFromCreationToNow <= 3 && daysFromCreationToNow > 1);
|
|
123
|
+
const condition4 = isPending && isVerificationLocked;
|
|
124
|
+
console.log('[KYCReminder] Modal variant conditions:', {
|
|
125
|
+
condition1_TemporarilyLocked: condition1,
|
|
126
|
+
condition2_FriendlyReminder: condition2,
|
|
127
|
+
condition3_PersonalVerification: condition3,
|
|
128
|
+
condition4_VerificationInProgress: condition4
|
|
129
|
+
});
|
|
130
|
+
return null;
|
|
131
|
+
})(), !isPending && isNotVerified && isVerificationLocked && (_jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto mb-4 w-fit rounded-full 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: "Temporarily Locked" }), _jsx("p", { className: `mt-xs text-sm text-text-tertiary-600 ${props.descriptionBgColor}`, children: "Your account has been locked due to incomplete verification. Please complete your verification to restore full access." }), _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(Dialog.Context, { children: (api) => (_jsxs("div", { className: "mt-6 space-y-lg", children: [_jsx(Button, { onClick: () => {
|
|
71
132
|
api.setOpen(false);
|
|
72
133
|
globalStore.kyc.setOpen(true);
|
|
73
134
|
}, children: "Complete KYC" }), ' ', _jsx(Button, { className: "bg-transparent text-text-brand-primary-600", onClick: () => {
|
|
@@ -4,12 +4,42 @@ 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
6
|
export function KycOpenOnHomeMount(props) {
|
|
7
|
+
console.log('[KycOpenOnHomeMount] Component mounted with props:', props);
|
|
7
8
|
const setkycReminderOpen = useGlobalStore((s) => s.kycReminder.setOpen);
|
|
8
9
|
const setkycOpen = useGlobalStore((s) => s.kyc.setOpen);
|
|
9
10
|
const { data: verification, isLoading: verificationLoading } = useMemberVerificationQuery();
|
|
10
11
|
const { data: account, isLoading: accountLoading } = useAccountQuery();
|
|
12
|
+
console.log('[KycOpenOnHomeMount] Query states:', {
|
|
13
|
+
verificationLoading,
|
|
14
|
+
accountLoading,
|
|
15
|
+
hasVerificationData: !!verification,
|
|
16
|
+
hasAccountData: !!account
|
|
17
|
+
});
|
|
11
18
|
const isVerificationLocked = account?.status === 'VERIFICATION_LOCKED';
|
|
12
19
|
const isPending = account?.verificationStatus === 'PENDING';
|
|
20
|
+
console.log('[KycOpenOnHomeMount] Account status:', {
|
|
21
|
+
accountStatus: account?.status,
|
|
22
|
+
verificationStatus: account?.verificationStatus,
|
|
23
|
+
isVerificationLocked,
|
|
24
|
+
isPending,
|
|
25
|
+
verified: account?.verified
|
|
26
|
+
});
|
|
27
|
+
console.log('[KycOpenOnHomeMount] Verification data:', {
|
|
28
|
+
sumsubVerified: verification?.sumsubVerified,
|
|
29
|
+
status: verification?.status,
|
|
30
|
+
nationality: !!verification?.nationality,
|
|
31
|
+
natureOfWork: !!verification?.natureOfWork,
|
|
32
|
+
sourceOfIncome: !!verification?.sourceOfIncome,
|
|
33
|
+
permanentAddress: !!verification?.permanentAddress,
|
|
34
|
+
placeOfBirth: !!verification?.placeOfBirth,
|
|
35
|
+
address: !!verification?.address,
|
|
36
|
+
selfieImage: !!verification?.selfieImage,
|
|
37
|
+
idFrontImage: !!verification?.idFrontImage
|
|
38
|
+
});
|
|
39
|
+
console.log('[KycOpenOnHomeMount] Account KYC data:', {
|
|
40
|
+
realName: !!account?.realName,
|
|
41
|
+
birthDay: !!account?.birthDay
|
|
42
|
+
});
|
|
13
43
|
const hasntSubmittedCompliantDocs = account?.verified ||
|
|
14
44
|
verification?.sumsubVerified ||
|
|
15
45
|
verification?.status === 'APPROVED' ||
|
|
@@ -32,30 +62,53 @@ export function KycOpenOnHomeMount(props) {
|
|
|
32
62
|
!verification?.permanentAddress ||
|
|
33
63
|
!verification?.placeOfBirth ||
|
|
34
64
|
!verification?.address;
|
|
65
|
+
console.log('[KycOpenOnHomeMount] KYC status calculations:', {
|
|
66
|
+
hasntSubmittedCompliantDocs,
|
|
67
|
+
hasntCompletedKYC,
|
|
68
|
+
isSkippable: props.isSkippable
|
|
69
|
+
});
|
|
35
70
|
useEffect(() => {
|
|
36
|
-
console.log(
|
|
71
|
+
console.log('[KycOpenOnHomeMount] useEffect triggered');
|
|
72
|
+
console.log('[KycOpenOnHomeMount] Current state:', {
|
|
73
|
+
hasntSubmittedCompliantDocs,
|
|
74
|
+
hasntCompletedKYC,
|
|
75
|
+
verificationLoading,
|
|
76
|
+
accountLoading,
|
|
77
|
+
isPending,
|
|
78
|
+
isVerificationLocked,
|
|
79
|
+
isSkippable: props.isSkippable
|
|
80
|
+
});
|
|
37
81
|
if (!verificationLoading && !accountLoading) {
|
|
82
|
+
console.log('[KycOpenOnHomeMount] Queries loaded, processing logic...');
|
|
38
83
|
// Handle pending case with feature flag
|
|
39
84
|
if (isPending) {
|
|
85
|
+
console.log('[KycOpenOnHomeMount] Account is pending - closing KYC modal, opening reminder');
|
|
40
86
|
setkycOpen(false);
|
|
41
87
|
setkycReminderOpen(true);
|
|
42
88
|
}
|
|
43
89
|
if (hasntSubmittedCompliantDocs || hasntCompletedKYC) {
|
|
44
90
|
if (props.isSkippable) {
|
|
91
|
+
console.log('[KycOpenOnHomeMount] KYC incomplete but skippable - opening reminder');
|
|
45
92
|
setkycReminderOpen(true);
|
|
46
93
|
}
|
|
47
94
|
else {
|
|
95
|
+
console.log('[KycOpenOnHomeMount] KYC incomplete and not skippable - opening KYC modal');
|
|
48
96
|
setkycOpen(true);
|
|
49
97
|
}
|
|
50
98
|
}
|
|
51
99
|
else if ((!hasntSubmittedCompliantDocs && hasntCompletedKYC) ||
|
|
52
100
|
isVerificationLocked) {
|
|
101
|
+
console.log('[KycOpenOnHomeMount] Partial completion or verification locked - opening reminder');
|
|
53
102
|
setkycReminderOpen(true);
|
|
54
103
|
}
|
|
55
104
|
else {
|
|
105
|
+
console.log('[KycOpenOnHomeMount] KYC complete - closing reminder');
|
|
56
106
|
setkycReminderOpen(false);
|
|
57
107
|
}
|
|
58
108
|
}
|
|
109
|
+
else {
|
|
110
|
+
console.log('[KycOpenOnHomeMount] Still loading queries, skipping logic');
|
|
111
|
+
}
|
|
59
112
|
}, [
|
|
60
113
|
setkycReminderOpen,
|
|
61
114
|
setkycOpen,
|