@opexa/portal-components 0.0.922 → 0.0.924
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/client/hooks/useUpdateMobileNumber.js +1 -1
- package/dist/components/AccountInfo/AccountInfo.js +1 -1
- package/dist/components/AccountSecurity/AccountSecurity.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/AurixPayGrabPayDeposit/AurixPayGrabPayDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/AurixPayGrabPayDeposit/AurixPayGrabPayDeposit.js +5 -3
- package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.js +2 -21
- package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayPayMayaDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayPayMayaDeposit.js +260 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/AurixPayQRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/useAurixPayQRPHDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/Deposit.js +2 -2
- 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/KYC/KYCDefault/KYCDefault.d.ts +1 -0
- package/dist/components/KYC/KYCDefault/KYCDefault.js +7 -1
- package/dist/components/SingleSignOn/SingleSignOn.d.ts +1 -1
- package/dist/components/SingleSignOn/SingleSignOn.js +15 -7
- package/dist/components/UpdateMobileNumber/UpdateMobileNumber.js +9 -4
- package/dist/ui/Carousel/Carousel.d.ts +99 -99
- package/dist/ui/Carousel/carousel.recipe.d.ts +11 -11
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.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/QrCode/QrCode.d.ts +25 -25
- package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/package.json +1 -1
- package/dist/assets/providers/alize.png +0 -0
- package/dist/assets/providers/bigtime-gaming.png +0 -0
- package/dist/assets/providers/bng.png +0 -0
- package/dist/assets/providers/boongo.png +0 -0
- package/dist/assets/providers/btg.png +0 -0
- package/dist/assets/providers/cq9.png +0 -0
- package/dist/assets/providers/darwin.png +0 -0
- package/dist/assets/providers/digitain.png +0 -0
- package/dist/assets/providers/evolution.png +0 -0
- package/dist/assets/providers/fantasma-games.png +0 -0
- package/dist/assets/providers/fc.png +0 -0
- package/dist/assets/providers/fp.png +0 -0
- package/dist/assets/providers/habanero.png +0 -0
- package/dist/assets/providers/hacksaw.png +0 -0
- package/dist/assets/providers/jdb.png +0 -0
- package/dist/assets/providers/jili.png +0 -0
- package/dist/assets/providers/leap.png +0 -0
- package/dist/assets/providers/live-22-metaverse.png +0 -0
- package/dist/assets/providers/netent.png +0 -0
- package/dist/assets/providers/no-limit.png +0 -0
- package/dist/assets/providers/pg.png +0 -0
- package/dist/assets/providers/pgsoft.png +0 -0
- package/dist/assets/providers/pragmatic-play.png +0 -0
- package/dist/assets/providers/realtime-gaming.png +0 -0
- package/dist/assets/providers/redtiger.png +0 -0
- package/dist/assets/providers/rtg.png +0 -0
- package/dist/assets/providers/sagaming.png +0 -0
- package/dist/client/hooks/useAiOGCashDepositMutation.d.ts +0 -4
- package/dist/client/hooks/useAiOGCashDepositMutation.js +0 -90
- package/dist/client/hooks/useAiOGrabPayDepositMutation.d.ts +0 -4
- package/dist/client/hooks/useAiOGrabPayDepositMutation.js +0 -80
- package/dist/client/hooks/useAiOPalawanPayDepositMutation.d.ts +0 -4
- package/dist/client/hooks/useAiOPalawanPayDepositMutation.js +0 -80
- package/dist/client/hooks/useAiOPayMayaDepositMutation.d.ts +0 -4
- package/dist/client/hooks/useAiOPayMayaDepositMutation.js +0 -80
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositAlert.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositAlert.js +0 -99
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositDetails.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositDetails.js +0 -17
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.js +0 -116
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHQRCode.d.ts +0 -3
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHQRCode.js +0 -69
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDeposit.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDeposit.js +0 -10
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositAlert.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositAlert.js +0 -99
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositContext.d.ts +0 -25
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositContext.js +0 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositDetails.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositDetails.js +0 -17
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositForm.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositForm.js +0 -116
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHQRCode.d.ts +0 -3
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHQRCode.js +0 -69
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/useQRPHDeposit.d.ts +0 -13
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/useQRPHDeposit.js +0 -85
- package/dist/components/DepositWithdrawal/Deposit__legacy/AiOGCashDeposit/AiOGCashDeposit.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/AiOGCashDeposit/AiOGCashDeposit.js +0 -173
- package/dist/components/DepositWithdrawal/Deposit__legacy/AiOGrabPayDeposit/AiOGrabPayDeposit.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/AiOGrabPayDeposit/AiOGrabPayDeposit.js +0 -171
- package/dist/components/DepositWithdrawal/Deposit__legacy/AiOPalawanPayDeposit/AiOPalawanPayDeposit.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/AiOPalawanPayDeposit/AiOPalawanPayDeposit.js +0 -171
- package/dist/components/DepositWithdrawal/Deposit__legacy/AiOPayMayaDeposit/AiOPayMayaDeposit.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/AiOPayMayaDeposit/AiOPayMayaDeposit.js +0 -171
- package/dist/components/DepositWithdrawal/Deposit__legacy/AvailablePromos.d.ts +0 -8
- package/dist/components/DepositWithdrawal/Deposit__legacy/AvailablePromos.js +0 -33
- package/dist/components/DepositWithdrawal/Deposit__legacy/Deposit.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/Deposit.js +0 -120
- package/dist/components/DepositWithdrawal/Deposit__legacy/GCashDeposit/GCashDeposit.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/GCashDeposit/GCashDeposit.js +0 -163
- package/dist/components/DepositWithdrawal/Deposit__legacy/GCashWebpayDeposit/GCashWebpayDeposit.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/GCashWebpayDeposit/GCashWebpayDeposit.js +0 -165
- package/dist/components/DepositWithdrawal/Deposit__legacy/LibanganDeposit/LibanganDeposit.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/LibanganDeposit/LibanganDeposit.js +0 -186
- package/dist/components/DepositWithdrawal/Deposit__legacy/MayaAppDeposit/MayaAppDeposit.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/MayaAppDeposit/MayaAppDeposit.js +0 -157
- package/dist/components/DepositWithdrawal/Deposit__legacy/MayaDeposit/MayaDeposit.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/MayaDeposit/MayaDeposit.js +0 -163
- package/dist/components/DepositWithdrawal/Deposit__legacy/MayaWebpayDeposit/MayaWebpayDeposit.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/MayaWebpayDeposit/MayaWebpayDeposit.js +0 -166
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDeposit.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDeposit.js +0 -10
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositAlert.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositAlert.js +0 -99
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositContext.d.ts +0 -25
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositContext.js +0 -2
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositDetails.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositDetails.js +0 -19
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositForm.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositForm.js +0 -115
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/useOnlineBankDeposit.d.ts +0 -13
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/useOnlineBankDeposit.js +0 -81
- package/dist/components/DepositWithdrawal/Deposit__legacy/PisoPayDeposit/PisoPayDeposit.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/PisoPayDeposit/PisoPayDeposit.js +0 -180
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDeposit.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDeposit.js +0 -10
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositAlert.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositAlert.js +0 -99
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositContext.d.ts +0 -25
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositContext.js +0 -2
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositDetails.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositDetails.js +0 -17
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositForm.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositForm.js +0 -116
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHQRCode.d.ts +0 -3
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHQRCode.js +0 -69
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/useQRPHDeposit.d.ts +0 -13
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/useQRPHDeposit.js +0 -85
- 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 -33
- package/dist/components/KYCNotRequired/KYCNotRequired.d.ts +0 -0
- package/dist/components/KYCNotRequired/KYCNotRequired.js +0 -1
- package/dist/components/PortalProvider/AndroidOnlyComponents.d.ts +0 -1
- package/dist/components/PortalProvider/AndroidOnlyComponents.js +0 -12
- package/dist/components/Quests/MultiWageringQuest.d.ts +0 -1
- package/dist/components/Quests/MultiWageringQuest.js +0 -111
- package/dist/images/game-providers/ALPHACHINKO.png +0 -0
- package/dist/utils/getLocaleInfo.d.ts +0 -79
- package/dist/utils/getLocaleInfo.js +0 -175
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Capacitor } from '@capacitor/core';
|
|
4
|
-
import { Directory, Filesystem } from '@capacitor/filesystem';
|
|
5
|
-
import Image from 'next/image';
|
|
6
|
-
import { toaster } from '../../../../client/utils/toaster.js';
|
|
7
|
-
import qrphIcon from '../../../../images/qrph-icon.png';
|
|
8
|
-
import { QrCode } from '../../../../ui/QrCode/index.js';
|
|
9
|
-
export function QRPHQRCode(props) {
|
|
10
|
-
async function handleNativeDownload() {
|
|
11
|
-
const QRCode = await import('qrcode');
|
|
12
|
-
const dataUrl = await QRCode.toDataURL(props.qrCodeString, {
|
|
13
|
-
type: 'image/png',
|
|
14
|
-
color: {
|
|
15
|
-
light: '#FFFFFF',
|
|
16
|
-
dark: '#000000',
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
const base64 = dataUrl.split(',')[1];
|
|
20
|
-
try {
|
|
21
|
-
await Filesystem.writeFile({
|
|
22
|
-
path: `qrcode-${Date.now()}.png`,
|
|
23
|
-
data: base64,
|
|
24
|
-
directory: Directory.Documents,
|
|
25
|
-
});
|
|
26
|
-
toaster.success({
|
|
27
|
-
title: 'QR Code successfully saved to your device',
|
|
28
|
-
description: 'To continue with your deposit, please upload the QR code in your banking app.',
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
console.log(error, 'error');
|
|
33
|
-
toaster.error({
|
|
34
|
-
title: 'Failed to save QR Code',
|
|
35
|
-
description: 'An error occurred while saving the QR code to your device.',
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
async function handleWebDownload() {
|
|
40
|
-
try {
|
|
41
|
-
const QRCode = await import('qrcode');
|
|
42
|
-
const dataUrl = await QRCode.toDataURL(props.qrCodeString, {
|
|
43
|
-
type: 'image/png',
|
|
44
|
-
color: {
|
|
45
|
-
light: '#FFFFFF',
|
|
46
|
-
dark: '#000000',
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
const link = document.createElement('a');
|
|
50
|
-
link.href = dataUrl;
|
|
51
|
-
link.download = `qrcode-${Date.now()}.png`;
|
|
52
|
-
document.body.appendChild(link);
|
|
53
|
-
link.click();
|
|
54
|
-
document.body.removeChild(link);
|
|
55
|
-
toaster.success({
|
|
56
|
-
title: 'QR Code successfully saved to your device',
|
|
57
|
-
description: 'To continue with your deposit, please upload the QR code in your banking app.',
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
console.log(error, 'error');
|
|
62
|
-
toaster.error({
|
|
63
|
-
title: 'Failed to save QR Code',
|
|
64
|
-
description: 'An error occurred while saving the QR code to your device.',
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return (_jsxs(QrCode.Root, { value: props.qrCodeString, className: "mx-auto mt-6 w-[12.5rem] rounded-lg border border-border-primary bg-bg-brand-secondary-alt p-5 lg:w-[13rem] lg:p-6", children: [_jsxs("div", { className: "relative", children: [_jsx(QrCode.Frame, { className: "mx-auto size-[10rem] rounded-[0.25rem] border border-border-primary bg-white", children: _jsx(QrCode.Pattern, {}) }), _jsx(QrCode.Overlay, { className: "bg-white p-0.5", children: _jsx(Image, { src: qrphIcon, alt: "", className: "size-8", width: 40, height: 40 }) })] }), Capacitor.isNativePlatform() ? (_jsx("button", { type: "button", onClick: handleNativeDownload, className: "mt-5 block w-full text-center font-semibold text-sm text-text-secondary-700", children: "Download QR Code to Device" })) : (_jsx("button", { type: "button", onClick: handleWebDownload, className: "mt-5 block w-full text-center font-semibold text-sm text-text-secondary-700", children: "Download QR Code" }))] }));
|
|
69
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Deposit } from '../../../../types';
|
|
2
|
-
export type UseQRPHDepositReturn = ReturnType<typeof useQRPHDeposit>;
|
|
3
|
-
export declare function useQRPHDeposit(): {
|
|
4
|
-
view: "qrCode" | "form";
|
|
5
|
-
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
6
|
-
verify: () => void;
|
|
7
|
-
reset: () => void;
|
|
8
|
-
deposit: Deposit | null;
|
|
9
|
-
generateQRCode: (input: {
|
|
10
|
-
amount: string;
|
|
11
|
-
promo?: string | null;
|
|
12
|
-
}) => void;
|
|
13
|
-
};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
import invariant from 'tiny-invariant';
|
|
3
|
-
import { useShallow } from 'zustand/shallow';
|
|
4
|
-
import { useCreateQRPHDepositMutation } from '../../../../client/hooks/useCreateQRPHDepositMutation.js';
|
|
5
|
-
import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
|
|
6
|
-
import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
|
|
7
|
-
import { useMemberVerificationQuery } from '../../../../client/hooks/useMemberVerificationQuery.js';
|
|
8
|
-
import { getQueryClient } from '../../../../utils/getQueryClient.js';
|
|
9
|
-
import { getDepositsCountQueryKey } from '../../../../utils/queryKeys.js';
|
|
10
|
-
export function useQRPHDeposit() {
|
|
11
|
-
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
12
|
-
kycVerificationStatus: ctx.kycVerificationStatus,
|
|
13
|
-
})));
|
|
14
|
-
const [deposit, setDeposit] = useState(null);
|
|
15
|
-
const verificationQuery = useMemberVerificationQuery();
|
|
16
|
-
const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
|
|
17
|
-
const [status, setStatus] = useState('waiting');
|
|
18
|
-
const view = status === 'verification-failed' ||
|
|
19
|
-
status === 'verification-waiting' ||
|
|
20
|
-
status === 'verification-success' ||
|
|
21
|
-
status === 'verification-processing'
|
|
22
|
-
? 'qrCode'
|
|
23
|
-
: 'form';
|
|
24
|
-
const mutation = useCreateQRPHDepositMutation({
|
|
25
|
-
onMutate() {
|
|
26
|
-
setStatus('processing');
|
|
27
|
-
},
|
|
28
|
-
onSuccess(data) {
|
|
29
|
-
const queryClient = getQueryClient();
|
|
30
|
-
invariant(data.qrCode);
|
|
31
|
-
setStatus('verification-waiting');
|
|
32
|
-
queryClient.invalidateQueries({ queryKey: getDepositsCountQueryKey() });
|
|
33
|
-
setDeposit(data);
|
|
34
|
-
},
|
|
35
|
-
onError() {
|
|
36
|
-
setStatus('failed');
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
const generateQRCode = (input) => {
|
|
40
|
-
//handle new kyc process
|
|
41
|
-
if (verificationStatus === 'PENDING' ||
|
|
42
|
-
verificationStatus === 'UNVERIFIED' ||
|
|
43
|
-
verificationStatus === 'REJECTED' ||
|
|
44
|
-
verificationStatus === 'CREATED') {
|
|
45
|
-
globalStore.kycVerificationStatus.setOpen(true);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
mutation.mutate({
|
|
50
|
-
amount: input.amount,
|
|
51
|
-
promo: input.promo ?? undefined,
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
const query = useDepositQuery(deposit?.id, {
|
|
56
|
-
enabled: !!deposit,
|
|
57
|
-
refetchInterval: 5000,
|
|
58
|
-
});
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
if (query.data?.status === 'APPROVED' ||
|
|
61
|
-
query.data?.status === 'CONFIRMED') {
|
|
62
|
-
setStatus('verification-success');
|
|
63
|
-
}
|
|
64
|
-
if (query.data?.status === 'CANCELLED' ||
|
|
65
|
-
query.data?.status === 'REJECTED' ||
|
|
66
|
-
query.data?.status === 'FAILED') {
|
|
67
|
-
setStatus('verification-failed');
|
|
68
|
-
}
|
|
69
|
-
}, [query.data?.status]);
|
|
70
|
-
const reset = () => {
|
|
71
|
-
setDeposit(null);
|
|
72
|
-
setStatus('waiting');
|
|
73
|
-
};
|
|
74
|
-
const verify = () => {
|
|
75
|
-
setStatus('verification-processing');
|
|
76
|
-
};
|
|
77
|
-
return {
|
|
78
|
-
view,
|
|
79
|
-
status,
|
|
80
|
-
verify,
|
|
81
|
-
reset,
|
|
82
|
-
deposit,
|
|
83
|
-
generateQRCode,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function BasicInformation(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { zodResolver } from '@hookform/resolvers/zod';
|
|
3
|
-
import { differenceInYears, format, isSameDay, isValid, parse } from 'date-fns';
|
|
4
|
-
import { isNil, omitBy, size } from 'lodash-es';
|
|
5
|
-
import { useEffect } from 'react';
|
|
6
|
-
import { useForm } from 'react-hook-form';
|
|
7
|
-
import invariant from 'tiny-invariant';
|
|
8
|
-
import { z } from 'zod';
|
|
9
|
-
import { useAccountQuery } from '../../../client/hooks/useAccountQuery.js';
|
|
10
|
-
import { useUpdateAccountMutation } from '../../../client/hooks/useUpdateAccountMutation.js';
|
|
11
|
-
import { toaster } from '../../../client/utils/toaster.js';
|
|
12
|
-
import { Button } from '../../../ui/Button/index.js';
|
|
13
|
-
import { Dialog } from '../../../ui/Dialog/index.js';
|
|
14
|
-
import { Field } from '../../../ui/Field/index.js';
|
|
15
|
-
import { useKYCDefaultContext } from './KYCDefaultContext.js';
|
|
16
|
-
const definition = z.object({
|
|
17
|
-
realName: z
|
|
18
|
-
.string()
|
|
19
|
-
.min(3, 'Name must be 3 or more characters')
|
|
20
|
-
.max(50, 'Name must not be more than 50 characters')
|
|
21
|
-
.regex(/^[a-z0-9 ]+$/gi, 'Name must not contain special characters')
|
|
22
|
-
.trim(),
|
|
23
|
-
birthDay: z
|
|
24
|
-
.string()
|
|
25
|
-
.min(1, 'Date of birth is required')
|
|
26
|
-
.superRefine((value, ctx) => {
|
|
27
|
-
const dob = parse(value, 'yyyy-MM-dd', new Date());
|
|
28
|
-
if (!isValid(dob)) {
|
|
29
|
-
return ctx.addIssue({
|
|
30
|
-
code: z.ZodIssueCode.invalid_date,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
const now = new Date();
|
|
34
|
-
const age = differenceInYears(now, dob);
|
|
35
|
-
if (age < 21) {
|
|
36
|
-
return ctx.addIssue({
|
|
37
|
-
code: z.ZodIssueCode.custom,
|
|
38
|
-
message: 'You must be at least 21 years old',
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}),
|
|
42
|
-
branchCode: z.string().min(4).max(10).optional().or(z.literal('')),
|
|
43
|
-
});
|
|
44
|
-
export function BasicInformation() {
|
|
45
|
-
const kyc = useKYCDefaultContext();
|
|
46
|
-
const form = useForm({
|
|
47
|
-
resolver: zodResolver(definition),
|
|
48
|
-
mode: 'all',
|
|
49
|
-
defaultValues: {
|
|
50
|
-
birthDay: '',
|
|
51
|
-
branchCode: '',
|
|
52
|
-
realName: '',
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
const accountQuery = useAccountQuery();
|
|
56
|
-
const account = accountQuery.data;
|
|
57
|
-
const stepCompleted = account != null && account.realName != null && account.birthDay != null;
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
if (stepCompleted)
|
|
60
|
-
kyc.setStep(2);
|
|
61
|
-
}, [stepCompleted, kyc]);
|
|
62
|
-
useEffect(() => {
|
|
63
|
-
if (account) {
|
|
64
|
-
form.reset({
|
|
65
|
-
realName: account.realName ?? '',
|
|
66
|
-
birthDay: account.birthDay
|
|
67
|
-
? format(account.birthDay, 'yyyy-MM-dd')
|
|
68
|
-
: '',
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}, [account, form]);
|
|
72
|
-
const updateAccountMutation = useUpdateAccountMutation({
|
|
73
|
-
onError(error) {
|
|
74
|
-
toaster.error({
|
|
75
|
-
title: 'Error',
|
|
76
|
-
description: error.message,
|
|
77
|
-
});
|
|
78
|
-
},
|
|
79
|
-
onSuccess() {
|
|
80
|
-
kyc.setStep(2);
|
|
81
|
-
toaster.success({
|
|
82
|
-
title: 'Success',
|
|
83
|
-
description: 'Basic information has been set successfully.',
|
|
84
|
-
});
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
return (_jsxs("div", { children: [_jsx(Dialog.Title, { className: "text-center font-semibold text-lg", children: "Basic Information" }), _jsx(Dialog.Description, { className: "mt-xs text-center text-sm text-text-secondary-700", children: "Enter your basic details for identification and communication." }), _jsxs("form", { className: "mt-3", onSubmit: form.handleSubmit((data) => {
|
|
88
|
-
invariant(account);
|
|
89
|
-
const input = omitBy({
|
|
90
|
-
realName: account.realName === data.realName ? undefined : data.realName,
|
|
91
|
-
birthDay: account.birthDay && isSameDay(data.birthDay, account.birthDay)
|
|
92
|
-
? undefined
|
|
93
|
-
: format(data.birthDay, 'yyyy-MM-dd'),
|
|
94
|
-
}, isNil);
|
|
95
|
-
if (size(input) === 0)
|
|
96
|
-
return kyc.setStep(2);
|
|
97
|
-
updateAccountMutation.mutate(input);
|
|
98
|
-
}), children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.realName, readOnly: !!accountQuery.data?.realName, children: [_jsx(Field.Label, { children: "Real Name" }), _jsx(Field.Input, { placeholder: "Enter your real name", ...form.register('realName') }), _jsx(Field.ErrorText, { children: form.formState.errors.realName?.message })] }), _jsxs(Field.Root, { className: "mt-3", invalid: !!form.formState.errors.branchCode, readOnly: !!accountQuery.data?.birthDay, children: [_jsx(Field.Label, { children: "Date of Birth" }), _jsx(Field.Input, { type: "date", ...form.register('birthDay') }), _jsx(Field.ErrorText, { children: form.formState.errors.birthDay?.message })] }), _jsx(Button, { type: "submit", className: "mt-8", disabled: accountQuery.isLoading ||
|
|
99
|
-
updateAccountMutation.isPending ||
|
|
100
|
-
stepCompleted, children: "Continue" })] })] }));
|
|
101
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function KYCVerificationStatus(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import dynamic from 'next/dynamic';
|
|
4
|
-
const Component = dynamic(() => import('./KYCVerificationStatus.lazy.js').then((m) => m.KYCVerificationStatus), {
|
|
5
|
-
ssr: false,
|
|
6
|
-
loading: () => null,
|
|
7
|
-
});
|
|
8
|
-
export function KYCVerificationStatus() {
|
|
9
|
-
return _jsx(Component, {});
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function KYCVerificationStatus(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import Image from 'next/image';
|
|
3
|
-
import { twMerge } from 'tailwind-merge';
|
|
4
|
-
import { useShallow } from 'zustand/shallow';
|
|
5
|
-
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
6
|
-
import { useMemberVerificationQuery } from '../../client/hooks/useMemberVerificationQuery.js';
|
|
7
|
-
import alertIcon from '../../images/kyc-verification-status/alert-icon.png';
|
|
8
|
-
import bellIcon from '../../images/kyc-verification-status/bell-icon.png';
|
|
9
|
-
import { Button } from '../../ui/Button/index.js';
|
|
10
|
-
import { Dialog } from '../../ui/Dialog/index.js';
|
|
11
|
-
import { Portal } from '../../ui/Portal/index.js';
|
|
12
|
-
export function KYCVerificationStatus() {
|
|
13
|
-
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
14
|
-
kycVerificationStatus: ctx.kycVerificationStatus,
|
|
15
|
-
kyc: ctx.kyc,
|
|
16
|
-
})));
|
|
17
|
-
const verificationQuery = useMemberVerificationQuery();
|
|
18
|
-
const status = verificationQuery.data?.status ?? 'UNVERIFIED';
|
|
19
|
-
const icons = status === 'PENDING' ? bellIcon : alertIcon;
|
|
20
|
-
return (_jsx(Dialog.Root, { open: globalStore.kycVerificationStatus.open, onOpenChange: (details) => {
|
|
21
|
-
globalStore.kycVerificationStatus.setOpen(details.open);
|
|
22
|
-
}, 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: _jsx(Dialog.Content, { className: "mx-auto h-fit w-[450px] overflow-y-auto rounded-lg bg-bg-primary", children: _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mb-3xl grid h-[200px] w-full place-items-center rounded-xl bg-radial from-40% from-button-primary-bg to-bg-brand-solid", children: _jsx(Image, { src: icons, alt: "icon", className: "w-60 object-contain", draggable: false, width: 120, height: 120 }) }), _jsxs("h1", { className: "font-semibold text-lg text-white", children: [status === 'PENDING' && 'Verification in Progress', status === 'REJECTED' && 'Verification Rejected', status === 'UNVERIFIED' && 'Verification Required'] }), _jsxs("p", { className: "mb-4xl text-[#94969C] text-base", children: [status === 'PENDING' &&
|
|
23
|
-
`Your account verification is still under review. Please wait
|
|
24
|
-
until it's approved before you can continue playing or
|
|
25
|
-
depositing.`, status === 'REJECTED' &&
|
|
26
|
-
'Your account verification was not approved. Please resubmit your verification to regain full access.', status === 'UNVERIFIED' &&
|
|
27
|
-
'Your account is not yet verified. Please complete the verification process to continue playing or depositing.'] }), _jsxs(Button, { variant: "solid", className: twMerge('mb-2 w-full', status === 'PENDING' && 'hidden'), onClick: () => {
|
|
28
|
-
globalStore.kycVerificationStatus.setOpen(false);
|
|
29
|
-
globalStore.kyc.setOpen(true);
|
|
30
|
-
}, children: [status === 'REJECTED' && 'Resubmit Verification', status === 'UNVERIFIED' && 'Verify Now'] }), _jsx(Button, { type: "button", variant: "outline", onClick: () => {
|
|
31
|
-
globalStore.kycVerificationStatus.setOpen(false);
|
|
32
|
-
}, children: "Close" })] }) }) })] }) }));
|
|
33
|
-
}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function AndroidOnlyComponents(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function MultiWageringQuest(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useRouter, useSearchParams } from 'next/navigation';
|
|
3
|
-
import { useCallback, useMemo } from 'react';
|
|
4
|
-
import { useControllableState } from '../../client/hooks/useControllableState.js';
|
|
5
|
-
import { useDisclosure } from '../../client/hooks/useDisclosure.js';
|
|
6
|
-
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
7
|
-
import { Lock01Icon } from '../../icons/Lock01Icon.js';
|
|
8
|
-
import { XIcon } from '../../icons/XIcon.js';
|
|
9
|
-
import { Badge } from '../../ui/Badge/index.js';
|
|
10
|
-
import { Button } from '../../ui/Button/index.js';
|
|
11
|
-
import { Dialog } from '../../ui/Dialog/index.js';
|
|
12
|
-
import { Portal } from '../../ui/Portal/index.js';
|
|
13
|
-
import { Progress } from '../../ui/Progress/index.js';
|
|
14
|
-
import { Prose } from '../../ui/Prose/index.js';
|
|
15
|
-
import { formatNumber } from '../../utils/formatNumber.js';
|
|
16
|
-
import { useQuestContext } from './QuestsContext.js';
|
|
17
|
-
import { RemainingTime } from './RemainingTime.js';
|
|
18
|
-
export function MultiWageringQuest() {
|
|
19
|
-
const disclosure = useDisclosure();
|
|
20
|
-
const quest = useQuestContext();
|
|
21
|
-
const { stages, totalStage, currentStage, progressPercentage } = useMemo(() => {
|
|
22
|
-
const currentStage = quest.stages.filter((m) => m.cleared).length;
|
|
23
|
-
const progress = [];
|
|
24
|
-
const turnover = parseFloat(quest.turnover || '0');
|
|
25
|
-
let remaining = turnover;
|
|
26
|
-
const stageTargets = quest.stages.map((s) => parseFloat(s.targetTurnover));
|
|
27
|
-
for (const target of stageTargets) {
|
|
28
|
-
if (remaining <= 0) {
|
|
29
|
-
progress.push(0);
|
|
30
|
-
}
|
|
31
|
-
else if (remaining >= target) {
|
|
32
|
-
progress.push(100);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
progress.push((remaining / target) * 100);
|
|
36
|
-
}
|
|
37
|
-
remaining -= target;
|
|
38
|
-
}
|
|
39
|
-
if (!quest?.stages) {
|
|
40
|
-
return {
|
|
41
|
-
stages: [],
|
|
42
|
-
totalStage: 0,
|
|
43
|
-
currentStage: 0,
|
|
44
|
-
progressPercentage: 0,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
const transformedStages = quest.stages.map((stage, idx) => ({
|
|
48
|
-
...stage,
|
|
49
|
-
progressValue: progress[idx],
|
|
50
|
-
}));
|
|
51
|
-
return {
|
|
52
|
-
stages: transformedStages,
|
|
53
|
-
totalStage: quest.stages.length,
|
|
54
|
-
currentStage: currentStage === 0 ? 1 : currentStage,
|
|
55
|
-
progressPercentage: +quest.progressPercentage,
|
|
56
|
-
};
|
|
57
|
-
}, [quest]);
|
|
58
|
-
const handleViewDetails = useCallback(() => {
|
|
59
|
-
disclosure.setOpen(true);
|
|
60
|
-
}, [disclosure]);
|
|
61
|
-
const localeInfo = useLocaleInfo();
|
|
62
|
-
const params = useSearchParams();
|
|
63
|
-
const questId = params.get('id');
|
|
64
|
-
const isOpen = useMemo(() => {
|
|
65
|
-
return questId === quest.id;
|
|
66
|
-
}, [questId, quest.id]);
|
|
67
|
-
const router = useRouter();
|
|
68
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex h-full w-full flex-col space-y-6 rounded-2xl border border-border-primary bg-bg-tertiary px-4 pt-5 pb-6", children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsx("div", { className: "flex max-h-7.5 items-center justify-between", children: _jsx(RemainingTime, { endOfDay: true }) }), _jsx("p", { className: "font-semibold text-xl", children: quest?.name || 'Multi Stage Wagering Quest' }), _jsx("div", { className: "text-[#CECFD2] text-sm", dangerouslySetInnerHTML: {
|
|
69
|
-
__html: quest?.description ||
|
|
70
|
-
'Ready for a challenge? Complete them all and get amazing rewards!',
|
|
71
|
-
} }), _jsxs("div", { className: "flex items-center justify-between pt-5", children: [_jsxs("p", { className: "text-[#F5F5F6] text-sm", children: ["Progress: ", quest.progressPercentage, "%"] }), _jsxs("p", { className: "text-[#F5F5F6] text-sm", children: [quest.turnover, _jsxs("span", { className: "text-[#94969C]", children: ["/", quest.targetTurnover, " PHP"] })] })] }), _jsx(Progress.Root, { max: 100, className: "h-2 rounded-full bg-bg-primary", value: progressPercentage, children: _jsx(Progress.Track, { children: _jsx(Progress.Range, { className: "bg-utility-brand-600" }) }) }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("p", { className: "text-[#F5F5F6] text-sm", children: ["Stage ", currentStage, " of ", totalStage] }), _jsx(Badge.Root, { size: "lg", className: "border border-border-badge bg-bg-badge", round: false, children: _jsxs(Badge.Label, { className: "!text-text-badge flex items-center justify-center text-xs", children: [_jsx("p", { className: "flex h-[10px] items-center justify-center", children: "+" }), ' ', formatNumber(quest.stages?.reduce((curr, prev) => {
|
|
72
|
-
return curr + Number(prev.bonusAmount || 0);
|
|
73
|
-
}, 0), {
|
|
74
|
-
currency: localeInfo.currency.code,
|
|
75
|
-
maxDecimalPlaces: 0,
|
|
76
|
-
minDecimalPlaces: 0,
|
|
77
|
-
}), ' ', "Bonus"] }) })] })] }), _jsx("div", { className: "flex h-full items-end", children: _jsx(Button, { size: "sm", onClick: handleViewDetails, "aria-label": "View Details", disabled: quest.status === 'FAILED' || quest.status === 'COMPLETED', className: "disabled:bg-bg-primary disabled:text-text-disabled", children: "View Details" }) })] }), _jsx(Stages, { open: disclosure.open || isOpen, onOpenChange: (open) => {
|
|
78
|
-
disclosure.setOpen(open);
|
|
79
|
-
router.push('/quests');
|
|
80
|
-
}, quest: quest, stages: stages })] }));
|
|
81
|
-
}
|
|
82
|
-
function Stages(props) {
|
|
83
|
-
const [open, setOpen] = useControllableState({
|
|
84
|
-
value: props.open,
|
|
85
|
-
defaultValue: props.defaultOpen ?? false,
|
|
86
|
-
onChange: props.onOpenChange,
|
|
87
|
-
});
|
|
88
|
-
const currentStage = useMemo(() => {
|
|
89
|
-
const stage = props?.stages?.findLastIndex((stage) => stage.cleared) ?? 0;
|
|
90
|
-
return stage !== -1 ? stage + 1 : 1;
|
|
91
|
-
}, [props.stages]);
|
|
92
|
-
return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: open, onOpenChange: (details) => setOpen(details.open), closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "mx-auto mt-40 min-h-auto min-w-[23rem] max-w-[25rem] overflow-y-auto rounded-xl border border-border-wagering-popup px-4 py-5", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "group flex flex-col space-y-5 text-sm text-text-quarterary-brand", children: [_jsx("h2", { className: "font-semibold text-lg text-text-primary-900", children: props.quest?.name || 'Quest' }), _jsx(Prose, { dangerouslySetInnerHTML: {
|
|
93
|
-
__html: props.quest?.description ?? '',
|
|
94
|
-
} }), _jsx("div", { className: "flex w-full flex-col space-y-3", children: props.stages.map((stage, idx) => {
|
|
95
|
-
if (currentStage >= idx + 1) {
|
|
96
|
-
return (_jsx(QuestWageringStageUnlocked, { data: stage, progressValue: stage.progressValue, bonus: stage.bonusAmount, stage: idx, isCompleted: stage.cleared }, idx));
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
return _jsx(QuestWageringStageLocked, { stage: idx }, idx);
|
|
100
|
-
}
|
|
101
|
-
}) }), _jsx(Button, { size: "sm", onClick: () => setOpen(false), "aria-label": "Close", className: "w-full", children: "Close" })] })] }) })] }) }));
|
|
102
|
-
}
|
|
103
|
-
function QuestWageringStageUnlocked({ bonus, stage, progressValue, data, isCompleted = false, }) {
|
|
104
|
-
const localeInfo = useLocaleInfo();
|
|
105
|
-
return (_jsxs("div", { className: "mb-4 flex flex-col justify-between rounded-xl border border-border-wagering-stage-popup bg-bg-wagering-stage-popup p-3", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("p", { className: "font-medium", children: ["Stage ", stage + 1] }), _jsx(Badge.Root, { colorScheme: isCompleted ? 'success' : 'blue', size: "md", round: true, children: _jsx(Badge.Label, { children: data.cleared ? 'Completed' : 'Ongoing' }) })] }), _jsxs("div", { className: "mt-2.5 flex items-center justify-between", children: [_jsxs("p", { children: ["Progress ", progressValue, "%"] }), _jsx(Badge.Root, { size: "md", className: "border border-border-badge bg-bg-badge", round: false, children: _jsxs(Badge.Label, { className: "!text-text-badge", children: ["+", formatNumber(bonus, {
|
|
106
|
-
currency: localeInfo.currency.code,
|
|
107
|
-
}), ' ', "Bonus"] }) })] }), _jsx(Progress.Root, { max: 100, className: "mt-2 h-2 rounded-full bg-bg-primary", value: progressValue ?? 0, children: _jsx(Progress.Track, { children: _jsx(Progress.Range, { className: "bg-utility-brand-600" }) }) })] }));
|
|
108
|
-
}
|
|
109
|
-
function QuestWageringStageLocked({ stage }) {
|
|
110
|
-
return (_jsxs("div", { className: "mb-4 flex items-center justify-between rounded-xl border border-border-wagering-stage-popup bg-bg-wagering-stage-popup p-3", children: [_jsxs("p", { className: "font-medium", children: ["Stage ", stage + 1] }), _jsx("div", { className: "flex items-center justify-center rounded-full border border-border-lock bg-bg-lock p-1", children: _jsx(Lock01Icon, { className: "size-3 stroke-3 font-medium text-text-lock" }) })] }));
|
|
111
|
-
}
|
|
Binary file
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { type ComponentProps, type ComponentType } from 'react';
|
|
2
|
-
export interface CountryInfo {
|
|
3
|
-
/**
|
|
4
|
-
* @description The country code
|
|
5
|
-
* @example 'PHL'
|
|
6
|
-
*/
|
|
7
|
-
code: 'IDN' | 'IND' | 'MYS' | 'PHL' | 'VNM';
|
|
8
|
-
/**
|
|
9
|
-
* @description The country name
|
|
10
|
-
* @example 'Philippines'
|
|
11
|
-
*/
|
|
12
|
-
name: string;
|
|
13
|
-
/**
|
|
14
|
-
* @description The country flag
|
|
15
|
-
* @usage
|
|
16
|
-
* ```tsx
|
|
17
|
-
* const localeInfo = getLocaleInfo('Asia/Manila');
|
|
18
|
-
* <localeInfo.country.flag />
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
flag: ComponentType<ComponentProps<'svg'>>;
|
|
22
|
-
}
|
|
23
|
-
export interface CurrencyInfo {
|
|
24
|
-
/**
|
|
25
|
-
* @description The currency code
|
|
26
|
-
* @example 'PHP'
|
|
27
|
-
*/
|
|
28
|
-
code: 'IDR' | 'INR' | 'MYR' | 'PHP' | 'USD' | 'VND';
|
|
29
|
-
/**
|
|
30
|
-
* @description The currency name
|
|
31
|
-
* @example 'Philippine Peso'
|
|
32
|
-
*/
|
|
33
|
-
name: string;
|
|
34
|
-
/**
|
|
35
|
-
* @description The currency symbol
|
|
36
|
-
* @example '₱'
|
|
37
|
-
*/
|
|
38
|
-
symbol: string;
|
|
39
|
-
/**
|
|
40
|
-
* Used in api
|
|
41
|
-
* @example 'VIRTUAL'
|
|
42
|
-
*/
|
|
43
|
-
externalCode: 'IDR' | 'INR' | 'MYR' | 'PHP' | 'USD' | 'VIRTUAL' | (string & {});
|
|
44
|
-
}
|
|
45
|
-
export interface MobileNumberInfo {
|
|
46
|
-
/**
|
|
47
|
-
* @description The mobile number area code
|
|
48
|
-
* @example '+63'
|
|
49
|
-
*/
|
|
50
|
-
areaCode: string;
|
|
51
|
-
/**
|
|
52
|
-
* @description The mobile number digits count
|
|
53
|
-
* @example 10
|
|
54
|
-
*/
|
|
55
|
-
numOfDigits: number;
|
|
56
|
-
/**
|
|
57
|
-
* @description pattern to validate mobile number
|
|
58
|
-
* @usage
|
|
59
|
-
* ```ts
|
|
60
|
-
* const localeInfo = getLocaleInfo('Asia/Manila');
|
|
61
|
-
* const isValid = localeInfo.mobileNumber.pattern.test('9190000000');
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
pattern: RegExp;
|
|
65
|
-
/**
|
|
66
|
-
* @description The mobile number example
|
|
67
|
-
* @example '9190000000'
|
|
68
|
-
*/
|
|
69
|
-
example: string;
|
|
70
|
-
}
|
|
71
|
-
export type Timezone = 'Asia/Manila' | 'Asia/Kolkata' | 'Asia/Jakarta' | 'Asia/Makassar' | 'Asia/Jayapura' | 'Asia/Kuala_Lumpur' | 'Asia/Ho_Chi_Minh' | (string & {});
|
|
72
|
-
export interface LocaleInfo {
|
|
73
|
-
locale: string;
|
|
74
|
-
timezone: Timezone;
|
|
75
|
-
country: CountryInfo;
|
|
76
|
-
currency: CurrencyInfo;
|
|
77
|
-
mobileNumber: MobileNumberInfo;
|
|
78
|
-
}
|
|
79
|
-
export declare const getLocaleInfo: (timezone: Timezone) => LocaleInfo;
|