@opexa/portal-components 0.0.946 → 0.0.948

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.
@@ -80,6 +80,7 @@ export interface GlobalStore {
80
80
  sidebar__mobile: PopupStore;
81
81
  kyc: PopupStore;
82
82
  kycReminder: PopupStore;
83
+ kycReview: PopupStore;
83
84
  spotBonus: PopupStore;
84
85
  registerBiometrics: PopupStore;
85
86
  termsAndConditions: TermsAndConditionsStore;
@@ -226,6 +226,19 @@ export const useGlobalStore = create()(devtools(subscribeWithSelector((set) => (
226
226
  },
227
227
  '~touched': false,
228
228
  },
229
+ kycReview: {
230
+ open: false,
231
+ setOpen(open) {
232
+ set((prev) => ({
233
+ kycReview: {
234
+ ...prev.kycReview,
235
+ open,
236
+ '~touched': true,
237
+ },
238
+ }));
239
+ },
240
+ '~touched': false,
241
+ },
229
242
  sidebar: {
230
243
  open: true,
231
244
  setOpen(open) {
@@ -30,12 +30,12 @@ export function DisclaimerV3(props) {
30
30
  const isAuthenticated = sessionQuery.data?.status === 'authenticated';
31
31
  const checked = globalStore.termsOfUse.accepted && globalStore.responsibleGaming.accepted;
32
32
  const [showWarning, setShowWarning] = useState(false);
33
- 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, { "aria-label": `${props.siteName} Player Disclaimer`, "aria-labelledby": "disclaimer-title", "aria-describedby": "disclaimer-description", className: twMerge('flex h-full scrollbar:h-2 scrollbar:w-2 w-full flex-col items-start 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-[500px] 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 }) }), _jsxs("div", { className: "my-4 grid w-full grid-cols-2 items-center justify-center gap-3xl", children: [_jsx(Image, { src: props.pagcorLogo ?? pagcorLogo, alt: "PAGCOR logo", height: 50, width: 186, className: "mx-auto h-[43px] w-auto shrink-0 object-contain", draggable: false, unoptimized: true }), _jsx(Image, { src: props.responsibleGamingLogo ?? responsibleGamingLogo, alt: "Responsible Gaming logo", height: 50, width: 186, className: "mx-auto h-[50px] w-auto shrink-0", draggable: false, unoptimized: true })] }), _jsx("div", { className: "w-full text-center font-semibold text-2xl uppercase", id: "disclaimer-title", children: "Notice" }), _jsx("div", { className: "mb-1 text-sm text-text-secondary-700", id: "disclaimer-description", 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", "aria-label": "Restricted persons list", children: [_jsxs("li", { className: "flex gap-4 text-text-placeholder", children: [_jsx(Circle, {}), "You are 21 years old and above."] }), _jsxs("li", { className: "flex gap-4 text-text-placeholder", 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 Nationa Police."] }), _jsxs("li", { className: "flex gap-4 text-text-placeholder", children: [_jsx(Circle, {}), "You are not included in the PAGCOR's National Database Restricted Persons (NDRP)."] }), _jsxs("li", { className: "flex gap-4 text-text-placeholder", 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(Checkbox.Root, { checked: checked, onCheckedChange: (e) => {
33
+ 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, { "aria-label": `${props.siteName} Player Disclaimer`, "aria-labelledby": "disclaimer-title", "aria-describedby": "disclaimer-description", className: twMerge('flex h-full scrollbar:h-2 scrollbar:w-2 w-full flex-col items-start 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-[500px] 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 }) }), _jsxs("div", { className: "my-4 grid w-full grid-cols-2 items-center justify-center gap-3xl", children: [_jsx(Image, { src: props.pagcorLogo ?? pagcorLogo, alt: "PAGCOR logo", height: 50, width: 186, className: "mx-auto h-[43px] w-auto shrink-0 object-contain", draggable: false, unoptimized: true }), _jsx(Image, { src: props.responsibleGamingLogo ?? responsibleGamingLogo, alt: "Responsible Gaming logo", height: 50, width: 186, className: "mx-auto h-[50px] w-auto shrink-0", draggable: false, unoptimized: true })] }), _jsx("div", { className: "w-full text-center font-semibold text-2xl uppercase", id: "disclaimer-title", children: "Notice" }), _jsx("div", { className: "mb-1 text-sm text-text-secondary-700 mt-2", id: "disclaimer-description", children: "By entering this website, you acknowledge and confirm:" }), _jsx("div", { className: "w-full grow mt-4", children: _jsxs(Dialog.Description, { className: "space-y-4 text-sm", children: [_jsxs("ul", { className: "space-y-1.5 text-left", "aria-label": "Restricted persons list", children: [_jsxs("li", { className: "flex gap-4 text-text-placeholder", children: [_jsx(Circle, {}), "You are 21 years old and above."] }), _jsxs("li", { className: "flex gap-4 text-text-placeholder", 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 Nationa Police."] }), _jsxs("li", { className: "flex gap-4 text-text-placeholder", children: [_jsx(Circle, {}), "You are not included in the PAGCOR's National Database Restricted Persons (NDRP)."] }), _jsxs("li", { className: "flex gap-4 text-text-placeholder", 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 text-text-placeholder", children: [_jsx(Circle, {}), "You are prohibited from playing in open and public places."] }), _jsxs(Checkbox.Root, { checked: checked, onCheckedChange: (e) => {
34
34
  if (e.checked === 'indeterminate')
35
35
  return;
36
36
  globalStore.termsOfUse.setAccepted(e.checked);
37
37
  globalStore.responsibleGaming.setAccepted(e.checked);
38
- }, className: "pt-2.5 pb-2 text-sm", children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["You agree and read the", ' ', _jsx("button", { type: "button", className: "text-brand-400 underline underline-offset-2", onClick: () => {
38
+ }, className: "pt-2.5 pb-2 text-sm", colorScheme: "neutral", children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["You agree and read the", ' ', _jsx("button", { type: "button", className: "text-brand-400 underline underline-offset-2", onClick: () => {
39
39
  globalStore.termsOfUse.setOpen(true);
40
40
  globalStore.termsOfUse.setNext('DISCLAIMER');
41
41
  disclaimer.close();
@@ -5,5 +5,6 @@ export interface KYCDefaultProps extends KYCReminderProps {
5
5
  logo: ImageProps['src'];
6
6
  isSkippable?: boolean;
7
7
  requireMobileNumber?: boolean;
8
+ hasKYCReviewPromo?: boolean;
8
9
  }
9
10
  export declare function KYCDefault(props: KYCDefaultProps): import("react/jsx-runtime").JSX.Element;
@@ -7,6 +7,7 @@ import { useSessionQuery } from '../../../client/hooks/useSessionQuery.js';
7
7
  import { Dialog } from '../../../ui/Dialog/index.js';
8
8
  import { Portal } from '../../../ui/Portal/index.js';
9
9
  import { KYCReminder } from '../KYCReminder.js';
10
+ import { KYCReview } from '../KYCReview.js';
10
11
  import { IdentityVerification } from './IdentityVerification.js';
11
12
  import { Indicator } from './Indicator.js';
12
13
  import { KYCDefaultContext } from './KYCDefaultContext.js';
@@ -18,7 +19,7 @@ export function KYCDefault(props) {
18
19
  kycReminder: ctx.kycReminder,
19
20
  responsibleGamingReminder: ctx.responsibleGamingReminder,
20
21
  })));
21
- const kyc = useKYCDefault(props?.isSkippable ?? false);
22
+ const kyc = useKYCDefault(props?.isSkippable ?? false, props?.hasKYCReviewPromo ?? false);
22
23
  const { isLoading: sessionLoading } = useSessionQuery();
23
24
  const accountQuery = useAccountQuery();
24
25
  const account = accountQuery.data;
@@ -28,5 +29,5 @@ export function KYCDefault(props) {
28
29
  : baseCondition;
29
30
  return (_jsxs(_Fragment, { children: [_jsx(KYCDefaultContext, { value: kyc, children: _jsx(Dialog.Root, { open: isDialogOpen, onOpenChange: (details) => {
30
31
  globalStore.kyc.setOpen(details.open);
31
- }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: kyc.reset, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { className: "fixed top-[57px] overflow-hidden", children: _jsx(Dialog.Content, { className: "mx-auto h-full w-full overflow-y-auto bg-bg-primary-alt md:max-h-[95vh] lg:w-fit", children: _jsxs("div", { className: "mt-[calc(var(--safe-area-inset-top)*3)] flex h-dvh w-full flex-col overflow-y-auto p-3xl sm:h-fit lg:w-[400px]", children: [_jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto mb-5 block h-7.5 w-auto", draggable: false }), _jsx(Indicator, {}), kyc.step === 1 && _jsx(IdentityVerification, {}), kyc.step === 2 && _jsx(PersonalInformation, {})] }) }) })] }) }) }), _jsx(KYCReminder, { ...props })] }));
32
+ }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: kyc.reset, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { className: "fixed top-[57px] overflow-hidden", children: _jsx(Dialog.Content, { className: "mx-auto h-full w-full overflow-y-auto bg-bg-primary-alt md:max-h-[95vh] lg:w-fit", children: _jsxs("div", { className: "mt-[calc(var(--safe-area-inset-top)*3)] flex h-dvh w-full flex-col overflow-y-auto p-3xl sm:h-fit lg:w-[400px]", children: [_jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto mb-5 block h-7.5 w-auto", draggable: false }), _jsx(Indicator, {}), kyc.step === 1 && _jsx(IdentityVerification, {}), kyc.step === 2 && _jsx(PersonalInformation, {})] }) }) })] }) }) }), _jsx(KYCReminder, { ...props }), _jsx(KYCReview, {})] }));
32
33
  }
@@ -37,6 +37,7 @@ export function PersonalInformation() {
37
37
  const globalStore = useGlobalStore(useShallow((ctx) => ({
38
38
  kyc: ctx.kyc,
39
39
  kycReminder: ctx.kycReminder,
40
+ kycReview: ctx.kycReview,
40
41
  })));
41
42
  const memberVerificationQuery = useMemberVerificationQuery();
42
43
  const memberVerificationId = memberVerificationQuery.data?.id;
@@ -76,6 +77,9 @@ export function PersonalInformation() {
76
77
  });
77
78
  kyc.setDone(true);
78
79
  globalStore.kyc.setOpen(false);
80
+ if (kyc.hasKYCReviewPromo) {
81
+ globalStore.kycReview.setOpen(true);
82
+ }
79
83
  toaster.success({
80
84
  title: 'Success',
81
85
  description: 'Personal information has been set successfully.',
@@ -91,6 +95,9 @@ export function PersonalInformation() {
91
95
  onSuccess() {
92
96
  kyc.setDone(true);
93
97
  globalStore.kyc.setOpen(false);
98
+ if (kyc.hasKYCReviewPromo) {
99
+ globalStore.kycReview.setOpen(true);
100
+ }
94
101
  toaster.success({
95
102
  title: 'Success',
96
103
  description: 'Personal information has been set successfully.',
@@ -21,6 +21,7 @@ export interface UseKYCDefaultReturn {
21
21
  setSelfieImageId: (id: string | null) => void;
22
22
  reset: () => void;
23
23
  isSkippable: boolean;
24
+ hasKYCReviewPromo: boolean;
24
25
  }
25
- export declare function useKYCDefault(isSkippable: boolean): UseKYCDefaultReturn;
26
+ export declare function useKYCDefault(isSkippable: boolean, hasKYCReviewPromo: boolean): UseKYCDefaultReturn;
26
27
  export {};
@@ -1,5 +1,5 @@
1
1
  import { useRef, useState } from 'react';
2
- export function useKYCDefault(isSkippable) {
2
+ export function useKYCDefault(isSkippable, hasKYCReviewPromo) {
3
3
  const [step, setStep] = useState(1);
4
4
  const [done, setDone] = useState(false);
5
5
  const [idFrontImageId, setFrontImageId] = useState(null);
@@ -35,5 +35,6 @@ export function useKYCDefault(isSkippable) {
35
35
  triggerEvent,
36
36
  reset,
37
37
  isSkippable,
38
+ hasKYCReviewPromo,
38
39
  };
39
40
  }
@@ -0,0 +1 @@
1
+ export declare function KYCReview(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import Image from 'next/image';
4
+ import { useShallow } from 'zustand/shallow';
5
+ import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
6
+ import cinePopLogo from '../../images/cinepop-logo.png';
7
+ import dearUtolLogo from '../../images/dear-utol-logo.png';
8
+ import mariasDiary from '../../images/marias-diary-logo.png';
9
+ import secretConfessionsLogo from '../../images/secret-confessions-logo.png';
10
+ import { Dialog } from '../../ui/Dialog/index.js';
11
+ import { Portal } from '../../ui/Portal/index.js';
12
+ export function KYCReview() {
13
+ const { kycReview } = useGlobalStore(useShallow((s) => ({ kycReview: s.kycReview })));
14
+ return (_jsx(Dialog.Root, { open: kycReview.open, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { className: "flex items-center", children: _jsxs(Dialog.Content, { className: "flex w-[375px] flex-col items-center justify-between space-y-4 border bg-[#232443] p-6 text-center", children: [_jsxs("div", { className: "flex flex-col items-center", children: [_jsx("div", { className: "mb-4 h-7 w-7 animate-spin rounded-full border-4 border-[#101730] border-t-[#F05027]" }), _jsx("div", { className: "font-semibold text-[#F5F5F6] text-lg", children: "Thanks for your submission." }), _jsxs("div", { className: "mt-1 text-[#CECFD2] text-sm", children: ["We\u2019re now ", '', _jsxs("span", { className: "text-[#F96B47]", children: ["reviewing your KYC information ", ''] }), "and will notify you once the verification is complete."] }), _jsx("div", { className: "mt-6 text-[#CECFD2] text-sm", children: "In the meantime, you can watch your favorite series on CinePop!" })] }), _jsxs("div", { className: "pt-3", children: [_jsx(Image, { src: cinePopLogo, alt: "cine poplogo", width: 151, height: 24, className: "mx-auto mb-2 h-auto w-[151px]" }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Image, { src: secretConfessionsLogo, alt: "secret confessions logo", width: 104, height: 53, className: "h-auto w-[104px]" }), _jsx(Image, { src: dearUtolLogo, alt: "dear utol logo", width: 105, height: 53, className: "h-auto w-[105px]" }), _jsx(Image, { src: mariasDiary, alt: "maria's diary logo", width: 104, height: 53, className: "h-auto w-[104px]" })] })] }), _jsx("button", { type: "button", className: "h-[44px] w-full rounded-md font-semibold", style: {
15
+ background: 'linear-gradient(90deg, #9333E8 0%, #D92778 100%)',
16
+ }, onClick: () => {
17
+ window.open('https://cinepop.film/', '_blank');
18
+ kycReview.setOpen(false);
19
+ }, children: "Watch Cinepop" })] }) })] }) }));
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.946",
3
+ "version": "0.0.948",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",