@opexa/portal-components 0.0.795 → 0.0.796
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/Banner/Banner.client.d.ts +12 -0
- package/dist/components/Banner/Banner.client.js +49 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
- package/dist/components/DigitainLauncher/Loading.d.ts +1 -0
- package/dist/components/DigitainLauncher/Loading.js +5 -0
- package/dist/components/KYC/BasicInformation.d.ts +1 -0
- package/dist/components/KYC/BasicInformation.js +101 -0
- package/dist/components/KYC/IdentityVerification.d.ts +1 -0
- package/dist/components/KYC/IdentityVerification.js +120 -0
- package/dist/components/KYC/Indicator.d.ts +1 -0
- package/dist/components/KYC/Indicator.js +8 -0
- package/dist/components/KYC/KYC.lazy.d.ts +6 -0
- package/dist/components/KYC/KYC.lazy.js +45 -0
- package/dist/components/KYC/KYCContext.d.ts +6 -0
- package/dist/components/KYC/KYCContext.js +2 -0
- package/dist/components/KYC/KYCVerificationStatus.lazy.js +7 -4
- package/dist/components/KYC/PersonalInformation.d.ts +1 -0
- package/dist/components/KYC/PersonalInformation.js +122 -0
- package/dist/components/KYC/useKYC.d.ts +25 -0
- package/dist/components/KYC/useKYC.js +38 -0
- package/dist/components/PortalProvider/AndroidOnlyComponents.d.ts +1 -0
- package/dist/components/PortalProvider/AndroidOnlyComponents.js +12 -0
- package/dist/components/PortalProvider/CXDTokenObserver.d.ts +1 -0
- package/dist/components/PortalProvider/CXDTokenObserver.js +30 -0
- package/dist/components/PortalProvider/SessionWatcher.js +13 -0
- package/dist/components/SignIn/FacebookSignInTrigger.js +1 -1
- package/dist/components/SignIn/GoogleSignInTrigger.js +1 -1
- package/dist/components/SignIn/utils.d.ts +8 -0
- package/dist/components/SignIn/utils.js +26 -0
- package/dist/constants/Branches.d.ts +2 -0
- package/dist/constants/Branches.js +42 -0
- package/dist/images/responsible-gaming-yellow.png +0 -0
- package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +4 -0
- package/dist/third-parties/FacebookPixel/FacebookPixel.js +4 -0
- package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
- package/dist/third-parties/FacebookPixel/api.js +1 -0
- package/dist/third-parties/FacebookPixel/index.d.ts +1 -0
- package/dist/third-parties/FacebookPixel/index.js +1 -0
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +4 -0
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +4 -0
- package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
- package/dist/third-parties/GoogleRecaptcha/api.js +1 -0
- package/dist/third-parties/GoogleRecaptcha/index.d.ts +1 -0
- package/dist/third-parties/GoogleRecaptcha/index.js +1 -0
- package/dist/third-parties/index.d.ts +2 -0
- package/dist/third-parties/index.js +2 -0
- package/dist/ui/Carousel/Carousel.d.ts +45 -45
- package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +198 -198
- package/dist/ui/Menu/menu.recipe.d.ts +11 -11
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useRef, useState } from 'react';
|
|
2
|
+
export function useKYC() {
|
|
3
|
+
const [step, setStep] = useState(2);
|
|
4
|
+
const [done, setDone] = useState(false);
|
|
5
|
+
const [idFrontImageId, setFrontImageId] = useState(null);
|
|
6
|
+
const [selfieImageId, setSelfieImageId] = useState(null);
|
|
7
|
+
const subscribers = useRef([]);
|
|
8
|
+
const subscribe = (subscriber) => {
|
|
9
|
+
subscribers.current.push(subscriber);
|
|
10
|
+
return () => {
|
|
11
|
+
subscribers.current = subscribers.current.filter((item) => item !== subscriber);
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
const triggerEvent = (detail) => {
|
|
15
|
+
subscribers.current.forEach((subscriber) => {
|
|
16
|
+
subscriber(detail);
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
const reset = () => {
|
|
20
|
+
setStep(1);
|
|
21
|
+
setDone(false);
|
|
22
|
+
setFrontImageId(null);
|
|
23
|
+
setSelfieImageId(null);
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
step,
|
|
27
|
+
setStep,
|
|
28
|
+
done,
|
|
29
|
+
setDone,
|
|
30
|
+
idFrontImageId,
|
|
31
|
+
setFrontImageId,
|
|
32
|
+
selfieImageId,
|
|
33
|
+
setSelfieImageId,
|
|
34
|
+
subscribe,
|
|
35
|
+
triggerEvent,
|
|
36
|
+
reset,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AndroidOnlyComponents(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Capacitor } from '@capacitor/core';
|
|
4
|
+
import { AndroidRoutingHandler } from './AndroidRoutingHandler.js';
|
|
5
|
+
import PushNotification from './PushNotifications.js';
|
|
6
|
+
export function AndroidOnlyComponents() {
|
|
7
|
+
const platform = Capacitor.getPlatform();
|
|
8
|
+
const isNative = platform === 'android' || platform === 'ios';
|
|
9
|
+
if (!isNative)
|
|
10
|
+
return null;
|
|
11
|
+
return (_jsxs(_Fragment, { children: [_jsx(PushNotification, {}), _jsx(AndroidRoutingHandler, {})] }));
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function CXDTokenObserver(): null;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { addHours } from 'date-fns';
|
|
3
|
+
import { clamp } from 'lodash-es';
|
|
4
|
+
import { useLocalStorage, useTimeout } from 'usehooks-ts';
|
|
5
|
+
import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
|
|
6
|
+
export function CXDTokenObserver() {
|
|
7
|
+
const { data: account } = useAccountQuery();
|
|
8
|
+
const accountCxd = {
|
|
9
|
+
cxd: account?.cellxpertDetails?.cxd,
|
|
10
|
+
};
|
|
11
|
+
const [cxd, setCxd, removeCxd] = useLocalStorage('cxd', null);
|
|
12
|
+
const now = new Date();
|
|
13
|
+
const removeCxdUntilInMs = cxd?.timestamp
|
|
14
|
+
? clamp(cxd.timestamp - now.getTime(), 0, Infinity)
|
|
15
|
+
: 0;
|
|
16
|
+
useTimeout(() => {
|
|
17
|
+
const isSame = cxd?.cxd === accountCxd.cxd;
|
|
18
|
+
if (!isSame) {
|
|
19
|
+
const extendedTimestamp = addHours(new Date(), 6).getTime();
|
|
20
|
+
setCxd({
|
|
21
|
+
cxd: accountCxd.cxd,
|
|
22
|
+
timestamp: extendedTimestamp,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}, account ? 100 : null);
|
|
26
|
+
useTimeout(() => {
|
|
27
|
+
removeCxd();
|
|
28
|
+
}, account ? removeCxdUntilInMs : null);
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useRouter } from 'next/navigation';
|
|
3
3
|
import { useTimeout } from 'usehooks-ts';
|
|
4
|
+
import { useShallow } from 'zustand/shallow';
|
|
5
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
4
6
|
import { useSessionHealthQuery } from '../../client/hooks/useSessionHealthQuery.js';
|
|
5
7
|
import { useSessionQuery } from '../../client/hooks/useSessionQuery.js';
|
|
6
8
|
import { useSignOutMutation } from '../../client/hooks/useSignOutMutation.js';
|
|
@@ -12,9 +14,20 @@ export function SessionWatcher() {
|
|
|
12
14
|
enabled: sessionQuery.data?.status === 'authenticated',
|
|
13
15
|
refetchInterval: 1000 * 5,
|
|
14
16
|
});
|
|
17
|
+
const { gameLaunch } = useGlobalStore(useShallow((ctx) => ({
|
|
18
|
+
gameLaunch: ctx.gameLaunch,
|
|
19
|
+
})));
|
|
15
20
|
const signOutMutation = useSignOutMutation({
|
|
16
21
|
onSuccess() {
|
|
22
|
+
if (gameLaunch.details.status === 'PLAYING') {
|
|
23
|
+
gameLaunch.setDetails({
|
|
24
|
+
status: 'WAITING',
|
|
25
|
+
session: null,
|
|
26
|
+
game: null,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
17
29
|
router.refresh();
|
|
30
|
+
router.push('/');
|
|
18
31
|
toaster.warning({
|
|
19
32
|
title: 'Logged Out',
|
|
20
33
|
description: 'Account accessed from a different device or browser.',
|
|
@@ -46,6 +46,6 @@ export const FacebookSignInTrigger = (props) => {
|
|
|
46
46
|
description: 'Failed to sign in with Facebook. Please try again.',
|
|
47
47
|
});
|
|
48
48
|
}, render: ({ onClick }) => {
|
|
49
|
-
return (_jsxs(Button, { variant: "outline", onClick: onClick, colorScheme: "gray", className: `mt-lg border-border-primary bg-bg-primary text-text-secondary-700 ${props.className}`, children: [_jsx(FacebookIcon, { className: "size-6" }), props.text ?? 'Continue with Facebook'] }));
|
|
49
|
+
return (_jsxs(Button, { variant: "outline", id: "fb-btn", onClick: onClick, colorScheme: "gray", className: `mt-lg border-border-primary bg-bg-primary text-text-secondary-700 ${props.className}`, children: [_jsx(FacebookIcon, { className: "size-6" }), props.text ?? 'Continue with Facebook'] }));
|
|
50
50
|
} }));
|
|
51
51
|
};
|
|
@@ -53,7 +53,7 @@ const Trigger = ({ children, disabled, asChild, onClick, text, className, ...pro
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
});
|
|
56
|
-
return (_jsx(ark.button, { type: "button", onClick: (e) => {
|
|
56
|
+
return (_jsx(ark.button, { type: "button", id: "google-btn", onClick: (e) => {
|
|
57
57
|
onClick?.(e);
|
|
58
58
|
signInGoogle();
|
|
59
59
|
}, asChild: !children ? true : asChild, disabled: signIn.isPending || disabled, ...props, children: children ?? (_jsxs(Button, { variant: "outline", colorScheme: "gray", className: `bg-bg-primary ${className}`, children: [_jsx(GoogleIcon, { className: "size-6" }), text ?? 'Continue with Google'] })) }));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type Options = {
|
|
2
|
+
accountName?: string;
|
|
3
|
+
siteName?: string;
|
|
4
|
+
signInOptions?: 'MOBILE_NUMBER' | 'NAME_AND_PASSWORD';
|
|
5
|
+
};
|
|
6
|
+
export type ErrorCode = 'MEMBER_ACCOUNT_BLACKLISTED' | 'MEMBER_ACCOUNT_SUSPENDED' | 'INVALID_RECAPTCHA_RESPONSE' | 'MEMBER_NOT_FOUND' | 'RATE_LIMIT_REACH' | 'NOT_READY_TO_SEND_VERIFICATION_ERROR' | 'Forbidden';
|
|
7
|
+
export declare function getFriendlyErrorMessage(code: ErrorCode, options?: Options): string;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export function getFriendlyErrorMessage(code, options) {
|
|
2
|
+
const accountName = options?.accountName ?? '';
|
|
3
|
+
const siteName = options?.siteName ?? '';
|
|
4
|
+
const signInOptions = options?.signInOptions ?? 'NAME_AND_PASSWORD';
|
|
5
|
+
switch (code) {
|
|
6
|
+
case 'MEMBER_ACCOUNT_BLACKLISTED':
|
|
7
|
+
return `Your account ${accountName} has been blacklisted due to a serious violation of our policies. For more information or to appeal, please contact the ${siteName} Chat Support team.`;
|
|
8
|
+
case 'MEMBER_ACCOUNT_SUSPENDED':
|
|
9
|
+
return `Your account ${accountName} has been temporarily suspended. Please reach out to the ${siteName} Chat Support team to learn more and get help with resolving the issue.`;
|
|
10
|
+
case 'INVALID_RECAPTCHA_RESPONSE':
|
|
11
|
+
return 'Invalid reCAPTCHA response';
|
|
12
|
+
case 'MEMBER_NOT_FOUND':
|
|
13
|
+
return 'Account not found. Please check your username and try again.';
|
|
14
|
+
case 'RATE_LIMIT_REACH':
|
|
15
|
+
return 'Rate limit exceeded';
|
|
16
|
+
case 'NOT_READY_TO_SEND_VERIFICATION_ERROR':
|
|
17
|
+
return 'Your account is not ready to send verification requests. Please try again later.';
|
|
18
|
+
case 'Forbidden':
|
|
19
|
+
if (signInOptions === 'MOBILE_NUMBER') {
|
|
20
|
+
return 'Invalid verification code. Please check the code and try again.';
|
|
21
|
+
}
|
|
22
|
+
return 'Invalid username or password, please try again.';
|
|
23
|
+
default:
|
|
24
|
+
return 'Something went wrong. Please try again later.';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export const BRANCHES = [
|
|
2
|
+
{
|
|
3
|
+
code: 'BRCAL',
|
|
4
|
+
name: 'Bingo Republic 2nd floor Primark Center Deparo St., Caloocan City',
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
code: 'BRNAG',
|
|
8
|
+
name: 'Bingo Republic 3rd floor Robinsons Mall, Naga City, Camarines Sur',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
code: 'BRANT',
|
|
12
|
+
name: 'Bingo Republic 2nd floor Robinsons Mall, San Vicente,Antique',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
code: 'BRCLA',
|
|
16
|
+
name: 'Clark',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
code: 'BRLAG',
|
|
20
|
+
name: 'Laguna',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
code: 'BREAS',
|
|
24
|
+
name: 'Eastwood City, Quezon City',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
code: 'BRMAR',
|
|
28
|
+
name: 'Bingo ng Bayan 4th floor Marikina Public Market, Marikina City',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
code: 'BRILO',
|
|
32
|
+
name: 'Iloilo',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
code: 'BRFIM',
|
|
36
|
+
name: 'Fisher Mall,Quezon City',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
code: 'BRCAC',
|
|
40
|
+
name: 'Villa Caceres Hotel, Naga City,Camsur',
|
|
41
|
+
},
|
|
42
|
+
];
|
|
Binary file
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FacebookPixel';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FacebookPixel.js';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './GoogleRecaptcha';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './GoogleRecaptcha.js';
|