@opexa/portal-components 0.0.599 → 0.0.601

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.
@@ -1,4 +1,4 @@
1
1
  import type { KYCDefaultProps } from './KYCDefault';
2
2
  import type { KYCSumsubProps } from './KYCSumsub';
3
3
  export type KYCProps = KYCDefaultProps | KYCSumsubProps;
4
- export declare function KYC(props: KYCProps): import("react/jsx-runtime").JSX.Element | null;
4
+ export declare function KYC(props: KYCProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import dynamic from 'next/dynamic';
4
- import { useShallow } from 'zustand/shallow';
5
- import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
6
4
  const KYCDefault = dynamic(() => import('./KYCDefault/index.js').then((m) => m.KYCDefault), {
7
5
  ssr: false,
8
6
  loading: () => null,
@@ -12,10 +10,10 @@ const KYCSumsub = dynamic(() => import('./KYCSumsub.js').then((m) => m.KYCSumsub
12
10
  loading: () => null,
13
11
  });
14
12
  export function KYC(props) {
15
- const touched = useGlobalStore(useShallow((ctx) => ctx.kyc['~touched']));
16
- if (!touched)
17
- return null;
18
- if (props.provider === 'sumsub')
13
+ if (props.provider === 'sumsub') {
19
14
  return _jsx(KYCSumsub, { ...props });
20
- return _jsx(KYCDefault, { ...props });
15
+ }
16
+ else {
17
+ return _jsx(KYCDefault, { ...props });
18
+ }
21
19
  }
@@ -1,3 +1,3 @@
1
1
  import type { KYCReminderProps } from './KYCReminder.lazy';
2
- export declare function KYCReminder(props: KYCReminderProps): import("react/jsx-runtime").JSX.Element | undefined;
2
+ export declare function KYCReminder(props: KYCReminderProps): import("react/jsx-runtime").JSX.Element;
3
3
  export type { KYCReminderProps };
@@ -1,14 +1,10 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import dynamic from 'next/dynamic';
4
- import { useShallow } from 'zustand/shallow';
5
- import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
6
4
  const Component = dynamic(() => import('./KYCReminder.lazy.js').then((m) => m.KYCReminder), {
7
5
  ssr: false,
8
6
  loading: () => null,
9
7
  });
10
8
  export function KYCReminder(props) {
11
- const touched = useGlobalStore(useShallow((ctx) => ctx.kycReminder['~touched']));
12
- if (touched)
13
- return _jsx(Component, { ...props });
9
+ return _jsx(Component, { ...props });
14
10
  }
@@ -18,6 +18,7 @@ import { Dialog } from '../../ui/Dialog/index.js';
18
18
  import { Portal } from '../../ui/Portal/index.js';
19
19
  export function KYCReminder(props) {
20
20
  const router = useRouter();
21
+ const featureFlag = useFeatureFlag();
21
22
  const globalStore = useGlobalStore(useShallow((ctx) => ({
22
23
  kyc: ctx.kyc,
23
24
  kycReminder: ctx.kycReminder,
@@ -32,12 +33,11 @@ export function KYCReminder(props) {
32
33
  router.replace('/');
33
34
  },
34
35
  });
35
- const featureFlag = useFeatureFlag();
36
36
  const { data: session, isLoading: sessionLoading } = useSessionQuery();
37
37
  const { data: account, isLoading: accountLoading } = useAccountQuery();
38
- const isVerificationLocked = account?.status === 'VERIFICATION_LOCKED';
39
38
  const isPending = account?.verificationStatus === 'PENDING';
40
39
  const isNotVerified = account?.verificationStatus === 'UNVERIFIED';
40
+ const isVerificationLocked = account?.status === 'VERIFICATION_LOCKED';
41
41
  const daysFromCreationToNow = useMemo(() => {
42
42
  if (!account?.dateTimeCreated)
43
43
  return 0;
@@ -45,38 +45,41 @@ export function KYCReminder(props) {
45
45
  const now = new Date();
46
46
  return differenceInCalendarDays(now, creationDate);
47
47
  }, [account?.dateTimeCreated]);
48
- const isSessionReady = !sessionLoading && session?.status === 'authenticated';
49
48
  const isAccountReady = !accountLoading;
49
+ const isSessionReady = !sessionLoading && session?.status === 'authenticated';
50
50
  const isKYCReminderOpen = globalStore.kycReminder.open && !globalStore.kyc.open;
51
51
  const isResponsibleGamingReminderClosed = !globalStore.responsibleGamingReminder.open;
52
- const isKYCStateRelevant = isNotVerified ||
53
- ((isPending || isVerificationLocked) && featureFlag.enabled);
52
+ const isKYCStateRelevant = isNotVerified
53
+ ? true
54
+ : !featureFlag.enabled
55
+ ? false
56
+ : isPending || isVerificationLocked;
54
57
  return (_jsx(Dialog.Root, { open: isSessionReady &&
55
58
  isAccountReady &&
56
59
  isKYCReminderOpen &&
57
60
  isKYCStateRelevant &&
58
61
  isResponsibleGamingReminderClosed, onOpenChange: (details) => {
59
62
  globalStore.kycReminder.setOpen(details.open);
60
- }, 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: [isVerificationLocked &&
63
+ }, 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: [featureFlag.enabled &&
61
64
  !isPending &&
62
- featureFlag.enabled &&
63
- isNotVerified && (_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 ??
65
+ isNotVerified &&
66
+ 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 ??
64
67
  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) => (_jsx("div", { className: "mt-6 space-y-lg", children: _jsx(Button, { onClick: () => {
65
68
  api.setOpen(false);
66
69
  globalStore.kyc.setOpen(true);
67
- }, children: "Complete KYC" }) })) })] })), isNotVerified &&
70
+ }, children: "Complete KYC" }) })) })] })), featureFlag.enabled &&
71
+ isNotVerified &&
68
72
  daysFromCreationToNow <= 3 &&
69
73
  daysFromCreationToNow >= 1 &&
70
- !isVerificationLocked &&
71
- featureFlag.enabled && (_jsxs(_Fragment, { children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _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: "JUST A FRIENDLY REMINDER" }), _jsxs("p", { className: `mt-xs text-sm text-text-tertiary-600 ${props.descriptionBgColor}`, children: ["Please complete your KYC information within", ' ', _jsx("span", { className: "font-semibold text-[#FF0000]", children: "3 days" }), ' ', "to avoid temporary lock on your account."] }), _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 ??
74
+ !isVerificationLocked && (_jsxs(_Fragment, { children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _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: "JUST A FRIENDLY REMINDER" }), _jsxs("p", { className: `mt-xs text-sm text-text-tertiary-600 ${props.descriptionBgColor}`, children: ["Please complete your KYC information within", ' ', _jsx("span", { className: "font-semibold text-[#FF0000]", children: "3 days" }), ' ', "to avoid temporary lock on your account."] }), _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 ??
72
75
  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) => (_jsx("div", { className: "mt-6 space-y-lg", children: _jsx(Button, { onClick: () => {
73
76
  api.setOpen(false);
74
77
  globalStore.kyc.setOpen(true);
75
- }, children: "Complete KYC" }) })) })] })] })), isNotVerified &&
76
- (!isVerificationLocked || !featureFlag.enabled) && (_jsxs(_Fragment, { children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto w-fit rounded-full bg-bg-primary p-2", children: _jsx(FileCheck02Icon, { className: "text-[#FEDF89]" }) }), _jsx("h2", { className: `mt-4 font-semibold text-lg ${props.titleBgColor}`, children: "Personal Verification" }), _jsxs("p", { className: `mt-xs text-sm text-text-tertiary-600 ${props.descriptionBgColor}`, children: ["All new users are required to complete identity verification to access the full range of ", props.siteName, ' ', "services, including withdrawals."] }), _jsx(Dialog.Context, { children: (api) => (_jsxs("div", { className: "mt-3xl space-y-lg", children: [_jsx(Button, { onClick: () => {
78
+ }, children: "Complete KYC" }) })) })] })] })), ((isNotVerified && !isVerificationLocked) ||
79
+ (isNotVerified && !featureFlag.enabled)) && (_jsxs(_Fragment, { children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto w-fit rounded-full bg-bg-primary p-2", children: _jsx(FileCheck02Icon, { className: "text-[#FEDF89]" }) }), _jsx("h2", { className: `mt-4 font-semibold text-lg ${props.titleBgColor}`, children: "Personal Verification" }), _jsxs("p", { className: `mt-xs text-sm text-text-tertiary-600 ${props.descriptionBgColor}`, children: ["All new users are required to complete identity verification to access the full range of ", props.siteName, " services, including withdrawals."] }), _jsx(Dialog.Context, { children: (api) => (_jsxs("div", { className: "mt-3xl space-y-lg", children: [_jsx(Button, { onClick: () => {
77
80
  api.setOpen(false);
78
81
  globalStore.kyc.setOpen(true);
79
- }, children: "Verify Now" }), _jsx(Button, { type: "button", variant: "outline", fullWidth: true, onClick: () => api.setOpen(false), children: "Do it later" })] })) })] })] })), isPending && isVerificationLocked && featureFlag.enabled && (_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 is verification-locked. 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, { onClick: () => {
82
+ }, children: "Verify Now" }), _jsx(Button, { type: "button", variant: "outline", fullWidth: true, onClick: () => api.setOpen(false), children: "Do it later" })] })) })] })] })), featureFlag.enabled && isPending && isVerificationLocked && (_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 is verification-locked. 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, { onClick: () => {
80
83
  signOutMutation.mutate();
81
84
  globalStore.account.setOpen(false);
82
85
  globalStore.account__mobile.setOpen(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.599",
3
+ "version": "0.0.601",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",