@opexa/portal-components 0.0.556 → 0.0.558

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.
@@ -49,14 +49,12 @@ export const useAccountQuery = (config) => {
49
49
  refetchOnReconnect: true,
50
50
  refetchOnWindowFocus: true,
51
51
  refetchInterval: (query) => {
52
- if (!featureFlag.enabled)
53
- return false;
54
52
  const data = query.state.data;
55
- if (data?.status === "ACTIVE" &&
56
- data?.verificationStatus === "VERIFIED") {
57
- return false;
53
+ if (data?.status === "VERIFICATION_LOCKED" &&
54
+ data?.verificationStatus === "PENDING") {
55
+ return 1500;
58
56
  }
59
- return 1500;
57
+ return false;
60
58
  },
61
59
  });
62
60
  return query;
@@ -22,7 +22,7 @@ export function DisclaimerV3(props) {
22
22
  globalStore.responsibleGaming.accepted) ||
23
23
  true;
24
24
  const [showWarning, setShowWarning] = useState(false);
25
- return (_jsx(Dialog.Root, { open: disclaimer.open, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: "flex h-full scrollbar:h-2 scrollbar:w-2 w-full flex-col items-start gap-y-4 overflow-y-auto scrollbar-thumb:rounded-full scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent p-3xl lg:mx-auto lg:h-auto lg:max-h-[85vh] lg:w-[400px] lg:rounded-xl", children: [_jsx("div", { className: "mx-auto h-auto max-w-[120px]", children: _jsx(Image, { src: props.logo, alt: `${props.siteName} logo`, width: 200, height: 100, className: "h-full w-full object-cover", draggable: false, unoptimized: true }) }), _jsx("div", { className: "w-full text-center font-semibold text-3xl", children: "Notice" }), _jsx("div", { className: "text-sm", children: "By entering this website, you acknowledge and confirm:" }), _jsx("div", { className: "w-full grow", children: _jsxs(Dialog.Description, { className: "space-y-4 text-sm", children: [_jsxs("ul", { className: "space-y-1.5 text-left", children: [_jsxs("li", { className: "flex gap-4", children: [_jsx(Circle, {}), "You are 21 years old and above."] }), _jsxs("li", { className: "flex gap-4", children: [_jsx(Circle, {}), "You are not a government official, or employee connected directly with the operation of the Government or any of its agencies, member of the Armed Forces of the Philippines including the Army, Navy, Air Force, or the Philippine National Police."] }), _jsxs("li", { className: "flex gap-4", children: [_jsx(Circle, {}), "You are not included in the PAGCOR's National Database Restricted Persons (NDRP)."] }), _jsxs("li", { className: "flex gap-4", children: [_jsx(Circle, {}), "Funds or credits in the account of player who is found ineligible to play shall mean forfeiture of said funds/credits in favor of the Government."] }), _jsxs("li", { className: "flex gap-4", children: [_jsx(Circle, {}), "You are prohibited from playing in open and public spaces."] }), _jsxs("li", { className: "flex items-start gap-4", children: [_jsx(Circle, {}), _jsxs("label", { htmlFor: "termsAndConditions", children: ["You agree and read the ", props.siteName, ' ', _jsx("button", { type: "button", className: "text-brand-400 underline underline-offset-2", onClick: () => {
25
+ return (_jsx(Dialog.Root, { open: disclaimer.open, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: "flex h-full scrollbar:h-2 scrollbar:w-2 w-full flex-col items-start gap-y-4 overflow-y-auto scrollbar-thumb:rounded-full scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent p-3xl lg:mx-auto lg:h-auto lg:max-h-[90vh] lg:w-[400px] lg:rounded-xl", children: [_jsx("div", { className: "mx-auto h-auto max-w-[120px]", children: _jsx(Image, { src: props.logo, alt: `${props.siteName} logo`, width: 200, height: 100, className: "h-full w-full object-cover", draggable: false, unoptimized: true }) }), _jsx("div", { className: "w-full text-center font-semibold text-3xl", children: "Notice" }), _jsx("div", { className: "text-sm", children: "By entering this website, you acknowledge and confirm:" }), _jsx("div", { className: "w-full grow", children: _jsxs(Dialog.Description, { className: "space-y-4 text-sm", children: [_jsxs("ul", { className: "space-y-1.5 text-left", children: [_jsxs("li", { className: "flex gap-4", children: [_jsx(Circle, {}), "You are 21 years old and above."] }), _jsxs("li", { className: "flex gap-4", children: [_jsx(Circle, {}), "You are not a government official, or employee connected directly with the operation of the Government or any of its agencies, member of the Armed Forces of the Philippines including the Army, Navy, Air Force, or the Philippine National Police."] }), _jsxs("li", { className: "flex gap-4", children: [_jsx(Circle, {}), "You are not a Gaming Employment License (GEL) holder."] }), _jsxs("li", { className: "flex gap-4", children: [_jsx(Circle, {}), "You are not included in the PAGCOR's National Database Restricted Persons (NDRP)."] }), _jsxs("li", { className: "flex gap-4", children: [_jsx(Circle, {}), "Funds or credits in the account of player who is found ineligible to play shall mean forfeiture of said funds/credits in favor of the Government."] }), _jsxs("li", { className: "flex gap-4", children: [_jsx(Circle, {}), "You are prohibited from playing in open and public spaces."] }), _jsxs("li", { className: "flex items-start gap-4", children: [_jsx(Circle, {}), _jsxs("label", { htmlFor: "termsAndConditions", children: ["You agree and read the ", props.siteName, ' ', _jsx("button", { type: "button", className: "text-brand-400 underline underline-offset-2", onClick: () => {
26
26
  globalStore.termsOfUse.setOpen(true);
27
27
  globalStore.termsOfUse.setNext('DISCLAIMER');
28
28
  disclaimer.close();
@@ -117,5 +117,6 @@ export function IdentityVerification() {
117
117
  });
118
118
  } }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-6", disabled: createPending || updatePending, children: "Continue" }), kyc.isSkippable && (_jsx(Button, { variant: "outline", colorScheme: "gray", className: "mt-lg", onClick: () => {
119
119
  globalStore.kyc.setOpen(false);
120
+ globalStore.kycReminder.setOpen(true);
120
121
  }, children: "Skip for now" }))] })] }));
121
122
  }
@@ -124,6 +124,7 @@ export function PersonalInformation() {
124
124
  }, disabled: !permanentAddress, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.Label, { children: "Use permanent address as current address" }), _jsx(Checkbox.HiddenInput, {})] }), _jsxs(Field.Root, { className: "mt-2xl", invalid: !!form.formState.errors.sourceOfIncome, children: [_jsx(Field.Label, { children: "Source of income" }), _jsx(Field.Input, { placeholder: "Enter your source of income", ...form.register('sourceOfIncome') }), _jsx(Field.ErrorText, { children: form.formState.errors.sourceOfIncome?.message })] }), _jsxs(Field.Root, { className: "mt-2xl", invalid: !!form.formState.errors.natureOfWork, children: [_jsx(Field.Label, { children: "Nature of Work" }), _jsx(Field.Input, { placeholder: "Enter your nature of work", ...form.register('natureOfWork') }), _jsx(Field.ErrorText, { children: form.formState.errors.natureOfWork?.message })] }), _jsxs(Field.Root, { className: "mt-2xl", invalid: !!form.formState.errors.placeOfBirth, children: [_jsx(Field.Label, { children: "Place of birth" }), _jsx(Field.Input, { placeholder: "Enter your place of birth", ...form.register('placeOfBirth') }), _jsx(Field.ErrorText, { children: form.formState.errors.placeOfBirth?.message })] }), _jsxs(Field.Root, { className: "mt-2xl", invalid: !!form.formState.errors.nationality, children: [_jsx(Field.Label, { children: "Nationality" }), _jsx(Field.Input, { placeholder: "Enter your nationality", ...form.register('nationality') }), _jsx(Field.ErrorText, { children: form.formState.errors.nationality?.message })] }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: updateMemberVerificationMutation.isPending ||
125
125
  createMemberVerificationMutation.isPending, children: "Continue" }), kyc.isSkippable && (_jsx(Button, { variant: "outline", colorScheme: "gray", className: "mt-lg", onClick: () => {
126
126
  globalStore.kyc.setOpen(false);
127
+ globalStore.kycReminder.setOpen(true);
127
128
  }, disabled: updateMemberVerificationMutation.isPending ||
128
129
  createMemberVerificationMutation.isPending, children: "Skip for now" }))] })] }));
129
130
  }
@@ -4,13 +4,16 @@ import { useEffect } from 'react';
4
4
  import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
5
5
  import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
6
6
  import { useMemberVerificationQuery } from '../../client/hooks/useMemberVerificationQuery.js';
7
+ import { useFeatureFlag } from '../../client/hooks/useFeatureFlag.js';
7
8
  export function KycOpenOnHomeMount(props) {
9
+ const featureFlag = useFeatureFlag();
8
10
  const setkycReminderOpen = useGlobalStore((s) => s.kycReminder.setOpen);
9
11
  const setkycOpen = useGlobalStore((s) => s.kyc.setOpen);
10
12
  const pathname = usePathname();
11
13
  const { data: verification, isLoading: verificationLoading } = useMemberVerificationQuery();
12
14
  const { data: account, isLoading: accountLoading } = useAccountQuery();
13
15
  const isVerificationLocked = account?.status === 'VERIFICATION_LOCKED';
16
+ const isPending = account?.verificationStatus === 'PENDING';
14
17
  const hasntSubmittedCompliantDocs = account?.verified ||
15
18
  verification?.sumsubVerified ||
16
19
  verification?.status === 'APPROVED' ||
@@ -35,6 +38,11 @@ export function KycOpenOnHomeMount(props) {
35
38
  !verification?.address;
36
39
  useEffect(() => {
37
40
  if (pathname === '/' && !verificationLoading && !accountLoading) {
41
+ // Handle pending case with feature flag
42
+ if (isPending && featureFlag.enabled) {
43
+ setkycOpen(false);
44
+ setkycReminderOpen(true);
45
+ }
38
46
  if (hasntSubmittedCompliantDocs || hasntCompletedKYC) {
39
47
  if (props.isSkippable) {
40
48
  setkycReminderOpen(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.556",
3
+ "version": "0.0.558",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",