@opexa/portal-components 0.0.889 → 0.0.891
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/useCreateAiOGCashDepositMutation.d.ts +4 -0
- package/dist/client/hooks/useCreateAiOGCashDepositMutation.js +90 -0
- package/dist/client/hooks/useCreateAiOGrabPayDepositMutation.d.ts +4 -0
- package/dist/client/hooks/useCreateAiOGrabPayDepositMutation.js +80 -0
- package/dist/client/hooks/useCreateAiOPalawanPayDepositMutation.d.ts +4 -0
- package/dist/client/hooks/useCreateAiOPalawanPayDepositMutation.js +80 -0
- package/dist/client/hooks/useCreateAiOPayMayaDepositMutation.d.ts +4 -0
- package/dist/client/hooks/useCreateAiOPayMayaDepositMutation.js +80 -0
- package/dist/client/hooks/useCreateAurixPayGCashDepositMutation.d.ts +4 -0
- package/dist/client/hooks/useCreateAurixPayGCashDepositMutation.js +82 -0
- package/dist/client/hooks/useCreateAurixPayGrabPayDepositMutation.d.ts +4 -0
- package/dist/client/hooks/useCreateAurixPayGrabPayDepositMutation.js +88 -0
- package/dist/client/hooks/useCreateAurixPayPayMayaDepositMutation.d.ts +4 -0
- package/dist/client/hooks/useCreateAurixPayPayMayaDepositMutation.js +88 -0
- package/dist/client/hooks/useCreateAurixPayQrphDepositMutation.d.ts +4 -0
- package/dist/client/hooks/useCreateAurixPayQrphDepositMutation.js +88 -0
- package/dist/components/DepositWithdrawal/Deposit/AiOGCashDeposit/AiOGCashDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/AiOGrabPayDeposit/AiOGrabPayDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/AiOPalawanPayDeposit/AiOPalawanPayDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/AiOPayMayaDeposit/AiOPayMayaDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/AurixPayGCashDeposit/AurixPayGCashDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayGCashDeposit/AurixPayGCashDeposit.js +241 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayGrabPayDeposit/AurixPayGrabPayDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayGrabPayDeposit/AurixPayGrabPayDeposit.js +241 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.js +241 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/AurixPayQRPHDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/AurixPayQRPHDeposit.js +12 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/AurixPayQRPHDepositContext.d.ts +25 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/AurixPayQRPHDepositContext.js +2 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/Confirmed.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/Confirmed.js +11 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/Failed.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/Failed.js +13 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/Form.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/Form.js +126 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/GeneratingQrCode.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/GeneratingQrCode.js +10 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/QrCodeGenerated.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/QrCodeGenerated.js +41 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/useAurixPayQRPHDeposit.d.ts +17 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/useAurixPayQRPHDeposit.js +117 -0
- package/dist/components/DepositWithdrawal/Deposit/Deposit.js +23 -1
- 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/QrCodeGenerated.js +37 -1
- package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.d.ts +6 -0
- package/dist/components/DepositWithdrawal/PaymentMethods.js +20 -0
- package/dist/components/DepositWithdrawal/utils.d.ts +1 -1
- package/dist/components/DepositWithdrawal/utils.js +4 -0
- package/dist/components/ForgotPassword/ForgotPassword.lazy.d.ts +2 -2
- package/dist/components/ForgotPassword/ForgotPassword.lazy.js +14 -3
- package/dist/components/ForgotPassword/ForgotPasswordForm.d.ts +5 -1
- package/dist/components/ForgotPassword/ForgotPasswordForm.js +68 -33
- package/dist/components/SignUp/SignUpDefault/SignUpDefaultFormInternational.js +4 -1
- package/dist/components/Tournaments/TournamentsCarousel/TournamentCarouselItem.Crazywin.d.ts +1 -0
- package/dist/components/Tournaments/TournamentsCarousel/TournamentCarouselItem.Crazywin.js +53 -0
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarousel.d.ts +1 -0
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarousel.js +9 -2
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.HappyBingo.d.ts +1 -0
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.HappyBingo.js +54 -0
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.js +2 -2
- package/dist/components/TransactionRecords/DepositRecordsTable.js +6 -21
- package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +1 -1
- package/dist/images/tourna-icon.webp +0 -0
- package/dist/schemas/forgotPasswordSchema.d.ts +8 -8
- package/dist/services/queries.d.ts +6 -2
- package/dist/services/queries.js +179 -1
- package/dist/services/wallet.d.ts +55 -0
- package/dist/services/wallet.js +44 -1
- package/dist/types/index.d.ts +4 -0
- package/dist/ui/AlertDialog/AlertDialog.d.ts +154 -154
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +14 -14
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Carousel/Carousel.d.ts +72 -72
- package/dist/ui/Carousel/carousel.recipe.d.ts +8 -8
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
- package/dist/ui/Collapsible/collapsible.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/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Dialog/Dialog.d.ts +33 -33
- package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Field/Field.d.ts +21 -21
- package/dist/ui/Field/field.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +307 -307
- package/dist/ui/Menu/menu.recipe.d.ts +17 -17
- package/dist/ui/Popover/Popover.d.ts +121 -121
- package/dist/ui/Popover/popover.recipe.d.ts +11 -11
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/QrCode/QrCode.d.ts +40 -40
- package/dist/ui/QrCode/qrCode.recipe.d.ts +8 -8
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.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/dist/utils/capitalize.d.ts +11 -0
- package/dist/utils/capitalize.js +48 -5
- package/dist/utils/countries/types.d.ts +1 -1
- package/dist/utils/downloadImage.d.ts +4 -0
- package/dist/utils/downloadImage.js +47 -0
- package/dist/utils/mutationKeys.d.ts +4 -0
- package/dist/utils/mutationKeys.js +16 -0
- package/package.json +1 -1
package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/useAurixPayQRPHDeposit.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { ObjectId } from '@opexa/object-id';
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import invariant from 'tiny-invariant';
|
|
4
|
+
import { useShallow } from 'zustand/shallow';
|
|
5
|
+
import { useCreateAurixPayQrphDepositMutation } from '../../../../client/hooks/useCreateAurixPayQrphDepositMutation.js';
|
|
6
|
+
import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
|
|
7
|
+
import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
|
|
8
|
+
import { useMemberVerificationQuery } from '../../../../client/hooks/useMemberVerificationQuery.js';
|
|
9
|
+
import { ObjectType } from '../../../../services/ObjectType.js';
|
|
10
|
+
import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
|
|
11
|
+
export function useAurixPayQRPHDeposit() {
|
|
12
|
+
const depositWithdrawalProps = useDepositWithdrawalPropsContext();
|
|
13
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
14
|
+
kycVerificationStatus: ctx.kycVerificationStatus,
|
|
15
|
+
})));
|
|
16
|
+
const inputRef = useRef(null);
|
|
17
|
+
const [deposit, setDeposit] = useState(null);
|
|
18
|
+
const [status, setStatus] = useState('idle');
|
|
19
|
+
const [errorMessage, setErrorMessage] = useState(null);
|
|
20
|
+
const verificationQuery = useMemberVerificationQuery();
|
|
21
|
+
const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
|
|
22
|
+
const mutation = useCreateAurixPayQrphDepositMutation({
|
|
23
|
+
onMutate() {
|
|
24
|
+
setStatus('generating-qr-code');
|
|
25
|
+
},
|
|
26
|
+
onSuccess(data) {
|
|
27
|
+
invariant(data.qrCode);
|
|
28
|
+
setStatus('qr-code-generated');
|
|
29
|
+
setDeposit(data);
|
|
30
|
+
},
|
|
31
|
+
onError(data) {
|
|
32
|
+
setStatus('failed');
|
|
33
|
+
setErrorMessage({
|
|
34
|
+
name: data.name,
|
|
35
|
+
message: data.message,
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
const query = useDepositQuery(deposit?.id, {
|
|
40
|
+
enabled: !!deposit && status === 'qr-code-generated',
|
|
41
|
+
refetchInterval: (ctx) => {
|
|
42
|
+
if (ctx.state.data?.status === 'APPROVED' ||
|
|
43
|
+
ctx.state.data?.status === 'CONFIRMED' ||
|
|
44
|
+
ctx.state.data?.status === 'CANCELLED' ||
|
|
45
|
+
ctx.state.data?.status === 'REJECTED' ||
|
|
46
|
+
ctx.state.data?.status === 'FAILED') {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
return 2000;
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (query.data?.status === 'APPROVED' ||
|
|
54
|
+
query.data?.status === 'CONFIRMED') {
|
|
55
|
+
setStatus('confirmed');
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (query.data?.status === 'CANCELLED' ||
|
|
59
|
+
query.data?.status === 'REJECTED' ||
|
|
60
|
+
query.data?.status === 'FAILED') {
|
|
61
|
+
setStatus('failed');
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
}, [query.data?.status]);
|
|
65
|
+
const redirectUrl = (() => {
|
|
66
|
+
const path = depositWithdrawalProps.depositSuccessPageUrl ?? '/deposits/:id/status';
|
|
67
|
+
const origin = window.location.origin.includes('localhost')
|
|
68
|
+
? 'https://uat.powerplay.ph/deposit-success' +
|
|
69
|
+
depositWithdrawalProps.depositSuccessPageUrl
|
|
70
|
+
: window.location.origin;
|
|
71
|
+
return `${origin}${path}`;
|
|
72
|
+
})();
|
|
73
|
+
const generateQRCode = async (input) => {
|
|
74
|
+
if (!depositWithdrawalProps.bypassDepositKycCheck &&
|
|
75
|
+
(verificationStatus === 'PENDING' ||
|
|
76
|
+
verificationStatus === 'UNVERIFIED' ||
|
|
77
|
+
verificationStatus === 'REJECTED' ||
|
|
78
|
+
verificationStatus === 'CREATED')) {
|
|
79
|
+
globalStore.kycVerificationStatus.setOpen(true);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const id = ObjectId.generate(ObjectType.Deposit).toString();
|
|
83
|
+
inputRef.current = input;
|
|
84
|
+
mutation.mutate({
|
|
85
|
+
id,
|
|
86
|
+
amount: input.amount,
|
|
87
|
+
promo: input.promo ?? undefined,
|
|
88
|
+
redirectUrl: redirectUrl.replace(':id', id),
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
const regenerateQRCode = async () => {
|
|
92
|
+
invariant(inputRef.current);
|
|
93
|
+
mutation.reset();
|
|
94
|
+
await new Promise((resolve) => setTimeout(resolve, 1));
|
|
95
|
+
const id = ObjectId.generate(ObjectType.Deposit).toString();
|
|
96
|
+
mutation.mutate({
|
|
97
|
+
id,
|
|
98
|
+
amount: inputRef.current.amount,
|
|
99
|
+
promo: inputRef.current.promo ?? undefined,
|
|
100
|
+
redirectUrl: redirectUrl.replace(':id', id),
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
const reset = () => {
|
|
104
|
+
setStatus('idle');
|
|
105
|
+
setDeposit(null);
|
|
106
|
+
setErrorMessage(null);
|
|
107
|
+
inputRef.current = null;
|
|
108
|
+
};
|
|
109
|
+
return {
|
|
110
|
+
status,
|
|
111
|
+
deposit,
|
|
112
|
+
errorMessage,
|
|
113
|
+
generateQRCode,
|
|
114
|
+
regenerateQRCode,
|
|
115
|
+
reset,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
@@ -8,6 +8,10 @@ import { AlertCircleIcon } from '../../../icons/AlertCircleIcon.js';
|
|
|
8
8
|
import { SpinnerIcon } from '../../../icons/SpinnerIcon.js';
|
|
9
9
|
import { onMobileDevice } from '../../../utils/onMobileDevice.js';
|
|
10
10
|
import { PaymentMethods } from '../PaymentMethods.js';
|
|
11
|
+
import { AurixPayGCashDeposit } from './AurixPayGCashDeposit/AurixPayGCashDeposit.js';
|
|
12
|
+
import { AurixPayPayMayaDeposit } from './AurixPayGrabPayDeposit/AurixPayGrabPayDeposit.js';
|
|
13
|
+
import { AurixPayGrabPayDeposit } from './AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.js';
|
|
14
|
+
import { AurixPayQRPHDeposit } from './AurixPayQRPHDeposit/AurixPayQRPHDeposit.js';
|
|
11
15
|
const QRPHDeposit = lazy(() => import('./QRPHDeposit/QRPHDeposit.js').then((m) => ({ default: m.QRPHDeposit })));
|
|
12
16
|
const GCashDeposit = lazy(() => import('./GCashDeposit/GCashDeposit.js').then((m) => ({
|
|
13
17
|
default: m.GCashDeposit,
|
|
@@ -107,6 +111,24 @@ export function Deposit() {
|
|
|
107
111
|
enabled: paymentSettings?.mayaWebpayDepositGatewaySettings?.[enabledKey] &&
|
|
108
112
|
featureFlag.enabled,
|
|
109
113
|
},
|
|
114
|
+
{
|
|
115
|
+
method: 'AURIX_PAY_GCASH',
|
|
116
|
+
enabled: paymentSettings?.aurixPayGCashDepositGatewaySettings?.[enabledKey] &&
|
|
117
|
+
featureFlag.enabled,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
method: 'AURIX_PAY_GRAB_PAY',
|
|
121
|
+
enabled: paymentSettings?.aurixPayGrabPayDepositGatewaySettings?.[enabledKey] && featureFlag.enabled,
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
method: 'AURIX_PAY_PAYMAYA',
|
|
125
|
+
enabled: paymentSettings?.aurixPayPayMayaDepositGatewaySettings?.[enabledKey] && featureFlag.enabled,
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
method: 'AURIX_PAY_QRPH',
|
|
129
|
+
enabled: paymentSettings?.aurixPayQrphDepositGatewaySettings?.[enabledKey] &&
|
|
130
|
+
featureFlag.enabled,
|
|
131
|
+
},
|
|
110
132
|
];
|
|
111
133
|
paymentMethods.forEach((o) => {
|
|
112
134
|
if (o.enabled) {
|
|
@@ -135,7 +157,7 @@ export function Deposit() {
|
|
|
135
157
|
if (enabledPaymentMethods.length <= 0) {
|
|
136
158
|
return _jsx(NoAvailablePaymentMethods, {});
|
|
137
159
|
}
|
|
138
|
-
return (_jsxs(_Fragment, { children: [_jsx(PaymentMethods, { value: paymentMethod, onChange: handlePaymentMethodChange, options: enabledPaymentMethods }), _jsxs(Suspense, { fallback: _jsx(SpinnerIcon, { className: "mx-auto size-6" }), children: [paymentMethod === 'QRPH' && _jsx(QRPHDeposit, {}), paymentMethod === 'GCASH' && _jsx(GCashDeposit, {}), paymentMethod === 'MAYA' && _jsx(MayaDeposit, {}), paymentMethod === 'MAYA_APP' && _jsx(MayaAppDeposit, {}), paymentMethod === 'ONLINE_BANK' && _jsx(OnlineBankDeposit, {}), paymentMethod === 'LIBANGAN_PAY_IN' && _jsx(LibanganDeposit, {}), paymentMethod === 'PISO_PAY' && _jsx(PisoPayDeposit, {}), paymentMethod === 'AIO_GCASH' && _jsx(AiOGCashDeposit, {}), paymentMethod === 'AIO_PAY_MAYA' && _jsx(AiOPayMayaDeposit, {}), paymentMethod === 'AIO_GRAB_PAY' && _jsx(AiOGrabPayDeposit, {}), paymentMethod === 'AIO_PALAWAN_PAY' && _jsx(AiOPalawanPayDeposit, {}), paymentMethod === 'GCASH_WEBPAY' && _jsx(GCashWebpayDeposit, {}), paymentMethod === 'MAYA_WEBPAY' && _jsx(MayaWebpayDeposit, {})] })] }));
|
|
160
|
+
return (_jsxs(_Fragment, { children: [_jsx(PaymentMethods, { value: paymentMethod, onChange: handlePaymentMethodChange, options: enabledPaymentMethods }), _jsxs(Suspense, { fallback: _jsx(SpinnerIcon, { className: "mx-auto size-6" }), children: [paymentMethod === 'QRPH' && _jsx(QRPHDeposit, {}), paymentMethod === 'GCASH' && _jsx(GCashDeposit, {}), paymentMethod === 'MAYA' && _jsx(MayaDeposit, {}), paymentMethod === 'MAYA_APP' && _jsx(MayaAppDeposit, {}), paymentMethod === 'ONLINE_BANK' && _jsx(OnlineBankDeposit, {}), paymentMethod === 'LIBANGAN_PAY_IN' && _jsx(LibanganDeposit, {}), paymentMethod === 'PISO_PAY' && _jsx(PisoPayDeposit, {}), paymentMethod === 'AIO_GCASH' && _jsx(AiOGCashDeposit, {}), paymentMethod === 'AIO_PAY_MAYA' && _jsx(AiOPayMayaDeposit, {}), paymentMethod === 'AIO_GRAB_PAY' && _jsx(AiOGrabPayDeposit, {}), paymentMethod === 'AIO_PALAWAN_PAY' && _jsx(AiOPalawanPayDeposit, {}), paymentMethod === 'GCASH_WEBPAY' && _jsx(GCashWebpayDeposit, {}), paymentMethod === 'MAYA_WEBPAY' && _jsx(MayaWebpayDeposit, {}), paymentMethod === 'AURIX_PAY_GCASH' && _jsx(AurixPayGCashDeposit, {}), paymentMethod === 'AURIX_PAY_PAYMAYA' && _jsx(AurixPayPayMayaDeposit, {}), paymentMethod === 'AURIX_PAY_GRAB_PAY' && _jsx(AurixPayGrabPayDeposit, {}), paymentMethod === 'AURIX_PAY_QRPH' && _jsx(AurixPayQRPHDeposit, {})] })] }));
|
|
139
161
|
}
|
|
140
162
|
function MayaSessionSessionExpired() {
|
|
141
163
|
return (_jsxs("div", { className: "py-xl", children: [_jsx("div", { className: "mx-auto flex size-12 items-center justify-center rounded-full bg-bg-warning-secondary", children: _jsx(AlertCircleIcon, { className: "size-6 text-text-featured-icon-light-warning" }) }), _jsx("h2", { className: "mt-lg text-center font-semibold text-lg", children: "Session Expired" }), _jsx("p", { className: "mx-auto mt-xs max-w-[25rem] text-center text-sm text-text-tertiary-600", children: "Your session has timed out. To continue with deposits or withdrawals, Please try reloading the app." })] }));
|
package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const OnlineBankDepositContext: (props: {
|
|
2
2
|
value: {
|
|
3
3
|
view: "form" | "vca";
|
|
4
|
-
status: "
|
|
4
|
+
status: "failed" | "waiting" | "processing" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
5
5
|
verify: () => void;
|
|
6
6
|
reset: () => void;
|
|
7
7
|
deposit: import("../../../../types").Deposit | null;
|
|
@@ -14,7 +14,7 @@ export declare const OnlineBankDepositContext: (props: {
|
|
|
14
14
|
children?: import("react").ReactNode | undefined;
|
|
15
15
|
}) => React.ReactNode, useOnlineBankDepositContext: () => {
|
|
16
16
|
view: "form" | "vca";
|
|
17
|
-
status: "
|
|
17
|
+
status: "failed" | "waiting" | "processing" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
18
18
|
verify: () => void;
|
|
19
19
|
reset: () => void;
|
|
20
20
|
deposit: import("../../../../types").Deposit | null;
|
package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Deposit } from '../../../../types';
|
|
|
2
2
|
export type UseOnlineBankDepositReturn = ReturnType<typeof useOnlineBankDeposit>;
|
|
3
3
|
export declare function useOnlineBankDeposit(): {
|
|
4
4
|
view: "form" | "vca";
|
|
5
|
-
status: "
|
|
5
|
+
status: "failed" | "waiting" | "processing" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
6
6
|
verify: () => void;
|
|
7
7
|
reset: () => void;
|
|
8
8
|
deposit: Deposit | null;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Capacitor } from '@capacitor/core';
|
|
2
3
|
import Image from 'next/image';
|
|
4
|
+
import { useState } from 'react';
|
|
3
5
|
import { useBoolean } from 'usehooks-ts';
|
|
6
|
+
import { toaster } from '../../../../client/utils/toaster.js';
|
|
4
7
|
import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
|
|
5
8
|
import { ArrowCircleDownIcon } from '../../../../icons/ArrowCircleDownIcon.js';
|
|
6
9
|
import { QrCode02Icon } from '../../../../icons/QrCode02Icon.js';
|
|
@@ -10,10 +13,13 @@ import { AlertDialog } from '../../../../ui/AlertDialog/index.js';
|
|
|
10
13
|
import { Button } from '../../../../ui/Button/index.js';
|
|
11
14
|
import { Portal } from '../../../../ui/Portal/index.js';
|
|
12
15
|
import { QrCode } from '../../../../ui/QrCode/index.js';
|
|
16
|
+
import { downloadImage } from '../../../../utils/downloadImage.js';
|
|
13
17
|
import { useQRPHDepositContext } from './QRPHDepositContext.js';
|
|
14
18
|
export function QrCodeGenerated() {
|
|
15
19
|
const context = useQRPHDepositContext();
|
|
16
20
|
const confirm = useBoolean(false);
|
|
21
|
+
const [isDownloading, setIsDownloading] = useState(false);
|
|
22
|
+
const isNative = Capacitor.isNativePlatform();
|
|
17
23
|
return (_jsx(AlertDialog.Root, { open: context.status === 'qr-code-generated', lazyMount: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx("button", { type: "button", className: "absolute top-4 right-4 icon:size-6 p-md text-text-quinary disabled:cursor-not-allowed disabled:opacity-50", onClick: () => {
|
|
18
24
|
if (!confirm.value) {
|
|
19
25
|
confirm.setTrue();
|
|
@@ -29,7 +35,37 @@ export function QrCodeGenerated() {
|
|
|
29
35
|
: 'Scan the QR code below with your banking app, or upload it to complete your deposit.' }), !confirm.value && (_jsx("div", { className: "mx-auto mt-xl w-[14.125rem] rounded-xl bg-bg-primary-alt p-6", children: _jsxs(QrCode.Root, { value: context.deposit?.qrCode ?? '', encoding: {
|
|
30
36
|
ecc: 'H',
|
|
31
37
|
boostEcc: true,
|
|
32
|
-
}, 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 }) })] }),
|
|
38
|
+
}, 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 }) })] }), isNative ? (_jsx(QrCode.Context, { children: (qrCode) => (_jsxs("button", { type: "button", disabled: isDownloading, onClick: async () => {
|
|
39
|
+
try {
|
|
40
|
+
setIsDownloading(true);
|
|
41
|
+
const dataUrl = await qrCode.getDataUrl('image/jpeg');
|
|
42
|
+
const result = await downloadImage(dataUrl, `QRPH-${Date.now()}.jpg`);
|
|
43
|
+
if (result.success) {
|
|
44
|
+
toaster.success({
|
|
45
|
+
title: 'Success',
|
|
46
|
+
description: result.message,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
toaster.error({
|
|
51
|
+
title: 'Error',
|
|
52
|
+
description: result.message,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
console.error('Failed to download QR code:', error);
|
|
58
|
+
toaster.error({
|
|
59
|
+
title: 'Error',
|
|
60
|
+
description: 'An unexpected error occurred while downloading the QR code.',
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
setIsDownloading(false);
|
|
65
|
+
}
|
|
66
|
+
}, className: "mx-auto mt-5 flex w-fit items-center gap-1 font-semibold text-button-tertiary-fg disabled:cursor-not-allowed disabled:opacity-50", children: [_jsx(ArrowCircleDownIcon, { className: "size-5" }), isDownloading
|
|
67
|
+
? 'Downloading...'
|
|
68
|
+
: 'Download QR Code'] })) })) : (_jsxs(QrCode.DownloadTrigger, { type: "button", fileName: `QRPH-${Date.now()}.jpg`, mimeType: "image/jpeg", className: "mx-auto mt-5 flex w-fit items-center gap-1 font-semibold text-button-tertiary-fg", children: [_jsx(ArrowCircleDownIcon, { className: "size-5" }), "Download QR Code"] }))] }) })), confirm.value && (_jsxs("div", { className: "mt-4xl flex gap-lg", children: [_jsx(Button, { variant: "outline", onClick: confirm.setFalse, children: "Go back" }), _jsx(Button, { onClick: () => {
|
|
33
69
|
context.reset();
|
|
34
70
|
setTimeout(() => {
|
|
35
71
|
confirm.setFalse();
|
|
@@ -11,5 +11,11 @@ export interface DepositWithdrawalProps {
|
|
|
11
11
|
hasPrivacyPolicyAndTermsOfUse?: boolean;
|
|
12
12
|
bypassDomains?: BypassDomainConfig[];
|
|
13
13
|
bypassDepositKycCheck?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* @default "/deposits/<id>/status"
|
|
16
|
+
* @example
|
|
17
|
+
* "/hello/:id/world"
|
|
18
|
+
*/
|
|
19
|
+
depositSuccessPageUrl?: string;
|
|
14
20
|
}
|
|
15
21
|
export declare function DepositWithdrawal(props: DepositWithdrawalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -107,6 +107,26 @@ const OPTIONS = [
|
|
|
107
107
|
label: 'Maya Webpay',
|
|
108
108
|
image: maya,
|
|
109
109
|
},
|
|
110
|
+
{
|
|
111
|
+
value: 'AURIX_PAY_GCASH',
|
|
112
|
+
label: 'GCash',
|
|
113
|
+
image: gcash,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
value: 'AURIX_PAY_GRAB_PAY',
|
|
117
|
+
label: 'GrabPay',
|
|
118
|
+
image: grabPay,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
value: 'AURIX_PAY_PAYMAYA',
|
|
122
|
+
label: 'Maya',
|
|
123
|
+
image: maya,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
value: 'AURIX_PAY_QRPH',
|
|
127
|
+
label: 'QRPH',
|
|
128
|
+
image: qrph,
|
|
129
|
+
},
|
|
110
130
|
];
|
|
111
131
|
export function PaymentMethods(props) {
|
|
112
132
|
const options = useMemo(() => props.options?.length
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { KnownDepositError, KnownWithdrawalError, WithdrawalError } from '../../types';
|
|
3
|
-
export declare const PaymentMethodDefinition: z.ZodEnum<["GCASH", "GCASH_STANDARD_CASH_IN", "MAYA_APP", "MAYA", "ONLINE_BANK", "QRPH", "INSTAPAY", "LIBANGAN_PAY_IN", "VENTAJA_DISBURSEMENT", "PISO_PAY", "AIO_GCASH", "AIO_PAY_MAYA", "AIO_GRAB_PAY", "AIO_PALAWAN_PAY", "GCASH_WEBPAY", "MAYA_WEBPAY", "INSTAPAY_GCASH", "INSTAPAY_PAYMAYA"]>;
|
|
3
|
+
export declare const PaymentMethodDefinition: z.ZodEnum<["GCASH", "GCASH_STANDARD_CASH_IN", "MAYA_APP", "MAYA", "ONLINE_BANK", "QRPH", "INSTAPAY", "LIBANGAN_PAY_IN", "VENTAJA_DISBURSEMENT", "PISO_PAY", "AIO_GCASH", "AIO_PAY_MAYA", "AIO_GRAB_PAY", "AIO_PALAWAN_PAY", "GCASH_WEBPAY", "MAYA_WEBPAY", "INSTAPAY_GCASH", "INSTAPAY_PAYMAYA", "AURIX_PAY_GCASH", "AURIX_PAY_PAYMAYA", "AURIX_PAY_GRAB_PAY", "AURIX_PAY_QRPH"]>;
|
|
4
4
|
export type PaymentMethod = z.infer<typeof PaymentMethodDefinition>;
|
|
5
5
|
export type DepositWithdrawalErrors = KnownDepositError | KnownWithdrawalError | WithdrawalError | string;
|
|
6
6
|
export declare function explainError(error?: DepositWithdrawalErrors): string;
|
|
@@ -18,6 +18,10 @@ export const PaymentMethodDefinition = z.enum([
|
|
|
18
18
|
'MAYA_WEBPAY',
|
|
19
19
|
'INSTAPAY_GCASH',
|
|
20
20
|
'INSTAPAY_PAYMAYA',
|
|
21
|
+
'AURIX_PAY_GCASH',
|
|
22
|
+
'AURIX_PAY_PAYMAYA',
|
|
23
|
+
'AURIX_PAY_GRAB_PAY',
|
|
24
|
+
'AURIX_PAY_QRPH',
|
|
21
25
|
]);
|
|
22
26
|
const errorMap = {
|
|
23
27
|
DAILY_PURCHASE_OR_DEPOSIT_LIMIT_EXCEEDED: 'You have exceeded your daily purchase or deposit limit. Please try again tomorrow.',
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type ImageProps } from 'next/image';
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
|
-
type ForgotPasswordLayout = 'crazywin';
|
|
3
|
+
type ForgotPasswordLayout = 'crazywin' | 'default';
|
|
4
4
|
export interface ForgotPasswordProps {
|
|
5
5
|
logo: ImageProps['src'];
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
className?: string;
|
|
8
|
-
layout?: ForgotPasswordLayout;
|
|
8
|
+
layout?: ForgotPasswordLayout | 'happybingo';
|
|
9
9
|
}
|
|
10
10
|
export declare function ForgotPassword(props: ForgotPasswordProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import Image, {} from 'next/image';
|
|
4
|
-
import { Suspense } from 'react';
|
|
4
|
+
import { Suspense, useEffect, useState } from 'react';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
6
|
import { useShallow } from 'zustand/shallow';
|
|
7
7
|
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
@@ -14,11 +14,22 @@ export function ForgotPassword(props) {
|
|
|
14
14
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
15
15
|
forgotPassword: ctx.forgotPassword,
|
|
16
16
|
})));
|
|
17
|
+
const [layout, setLayout] = useState('default');
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
setLayout(() => {
|
|
20
|
+
switch (props.layout) {
|
|
21
|
+
case 'crazywin':
|
|
22
|
+
return 'crazywin';
|
|
23
|
+
default:
|
|
24
|
+
return 'default';
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}, [props.layout]);
|
|
17
28
|
const Body = {
|
|
18
29
|
crazywin: (_jsx(CrazywinForgotPassword, { logo: props.logo })),
|
|
19
|
-
default: (_jsxs(Dialog.Content, { className: twMerge('mx-auto h-full w-full items-start
|
|
30
|
+
default: (_jsxs(Dialog.Content, { className: twMerge('mx-auto h-full w-full items-start p-3xl pb-4xl lg:h-auto lg:w-[400px] lg:rounded-xl', props.layout === 'happybingo' ? 'bg-white dark:bg-[#0C111D]' : 'bg-bg-primary-alt', props.className), children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsx(Suspense, { children: _jsx(ForgotPasswordForm, { layout: props.layout }) })] }))
|
|
20
31
|
};
|
|
21
32
|
return (_jsx(Dialog.Root, { open: globalStore.forgotPassword.open, onOpenChange: (details) => {
|
|
22
33
|
globalStore.forgotPassword.setOpen(details.open);
|
|
23
|
-
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: Body[
|
|
34
|
+
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: Body[layout] })] }) }));
|
|
24
35
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx,
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
4
4
|
import { useRef, useState } from 'react';
|
|
5
5
|
import { Controller, useForm } from 'react-hook-form';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
7
|
import { z } from 'zod';
|
|
7
8
|
import { useShallow } from 'zustand/shallow';
|
|
8
9
|
import { useCooldown } from '../../client/hooks/useCooldown.js';
|
|
@@ -19,7 +20,7 @@ import { Button } from '../../ui/Button/index.js';
|
|
|
19
20
|
import { Field } from '../../ui/Field/index.js';
|
|
20
21
|
import { PasswordInput } from '../../ui/PasswordInput/index.js';
|
|
21
22
|
import { PinInput } from '../../ui/PinInput/index.js';
|
|
22
|
-
export function ForgotPasswordForm() {
|
|
23
|
+
export function ForgotPasswordForm({ layout }) {
|
|
23
24
|
const [step, setStep] = useState(1);
|
|
24
25
|
const mobileNumberParser = useMobileNumberParser();
|
|
25
26
|
const localeInfo = useLocaleInfo();
|
|
@@ -44,31 +45,42 @@ export function ForgotPasswordForm() {
|
|
|
44
45
|
});
|
|
45
46
|
},
|
|
46
47
|
});
|
|
47
|
-
const
|
|
48
|
-
.object({
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
const createStep1Definition = (includeOtp) => {
|
|
49
|
+
const base = z.object({
|
|
50
|
+
mobileNumber: z.string().superRefine((v, ctx) => {
|
|
51
|
+
if (!mobileNumberParser.validate(v)) {
|
|
52
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, message: 'Invalid mobile number' });
|
|
53
|
+
}
|
|
54
|
+
}),
|
|
55
|
+
newPassword: z.string().min(8, 'Password must be 8 or more characters').max(100),
|
|
56
|
+
confirmPassword: z.string().min(1, 'Confirm your password'),
|
|
57
|
+
verificationCode: includeOtp
|
|
58
|
+
? z.string().refine((v) => /^\d{4,6}$/.test(v), 'Invalid OTP')
|
|
59
|
+
: z.string().optional(),
|
|
60
|
+
});
|
|
61
|
+
return base.superRefine((val, ctx) => {
|
|
62
|
+
if (val.newPassword !== val.confirmPassword) {
|
|
51
63
|
ctx.addIssue({
|
|
64
|
+
path: ['confirmPassword'],
|
|
52
65
|
code: z.ZodIssueCode.custom,
|
|
53
|
-
message: '
|
|
66
|
+
message: 'Passwords do not match',
|
|
54
67
|
});
|
|
55
68
|
}
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
});
|
|
70
|
-
}
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
const includeOtp = layout === 'happybingo';
|
|
72
|
+
const step1Schema = createStep1Definition(includeOtp);
|
|
73
|
+
const step1Form = useForm({
|
|
74
|
+
mode: 'all',
|
|
75
|
+
resolver: zodResolver(step1Schema),
|
|
76
|
+
defaultValues: {
|
|
77
|
+
mobileNumber: '',
|
|
78
|
+
newPassword: '',
|
|
79
|
+
confirmPassword: '',
|
|
80
|
+
...(includeOtp ? { verificationCode: '' } : {}),
|
|
81
|
+
},
|
|
71
82
|
});
|
|
83
|
+
const mobileNumberValue = step1Form.watch('mobileNumber');
|
|
72
84
|
const Step2Definition = z.object({
|
|
73
85
|
verificationCode: z.array(z.string()).superRefine((val, ctx) => {
|
|
74
86
|
if (val.length !== 6 || val.some((v) => v.length !== 1)) {
|
|
@@ -79,15 +91,6 @@ export function ForgotPasswordForm() {
|
|
|
79
91
|
}
|
|
80
92
|
}),
|
|
81
93
|
});
|
|
82
|
-
const step1Form = useForm({
|
|
83
|
-
mode: 'all',
|
|
84
|
-
resolver: zodResolver(Step1Definition),
|
|
85
|
-
defaultValues: {
|
|
86
|
-
mobileNumber: '',
|
|
87
|
-
confirmPassword: '',
|
|
88
|
-
newPassword: '',
|
|
89
|
-
},
|
|
90
|
-
});
|
|
91
94
|
const step2Form = useForm({
|
|
92
95
|
resolver: zodResolver(Step2Definition),
|
|
93
96
|
defaultValues: {
|
|
@@ -99,7 +102,39 @@ export function ForgotPasswordForm() {
|
|
|
99
102
|
duration: 1000 * 60,
|
|
100
103
|
});
|
|
101
104
|
const form2Ref = useRef(null);
|
|
102
|
-
|
|
105
|
+
const Header = {
|
|
106
|
+
1: (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center font-semibold text-lg", children: "Forgot Password" }), _jsx("p", { className: twMerge('mt-xs text-center text-sm', layout === 'happybingo' ? 'text-[#475467] dark:text-[#94969C]' : 'text-text-secondary-700'), children: "Your new password will be used to sign in." })] })),
|
|
107
|
+
2: (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center font-semibold text-lg", children: "Check your Phone" }), _jsxs("p", { className: "mt-xs text-center text-sm text-text-secondary-700", children: ["We\u2019ve sent a verification code to your mobile number", ' ', _jsx("span", { className: "font-semibold", children: mobileNumberParser.format(step1Form.getValues('mobileNumber')) }), ' ', "via text"] })] }))
|
|
108
|
+
};
|
|
109
|
+
if (layout === 'happybingo') {
|
|
110
|
+
return (_jsxs(_Fragment, { children: [Header[step], _jsxs("form", { className: "mt-3xl", onSubmit: step1Form.handleSubmit(async (data) => {
|
|
111
|
+
resetPasswordMutation.mutate({
|
|
112
|
+
mobileNumber: mobileNumberParser.format(data.mobileNumber),
|
|
113
|
+
newPassword: step1Form.getValues('newPassword'),
|
|
114
|
+
verificationCode: step1Form.getValues('verificationCode'),
|
|
115
|
+
});
|
|
116
|
+
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { className: 'text-[#344054] dark:text-[#CECFD2]', children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "-translate-y-1/2 absolute top-1/2 left-3.5 flex shrink-0 items-center gap-md", children: [_jsx(localeInfo.country.flag, { className: "size-5" }), _jsx("span", { className: "text-text-placeholder", children: localeInfo.mobileNumber.areaCode })] }), _jsx(Field.Input, { className: 'bg-transparent border-[#D0D5DD] dark:border-[#333741]', style: {
|
|
117
|
+
paddingLeft: `calc(2.75rem + ${localeInfo.mobileNumber.areaCode.length}ch)`,
|
|
118
|
+
}, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsx(Field.Root, { invalid: !!step1Form.formState.errors.newPassword, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { className: 'text-[#344054] dark:text-[#CECFD2]', children: "New Password" }), _jsxs(PasswordInput.Control, { className: 'bg-transparent border-[#D0D5DD] dark:border-[#333741]', children: [_jsx(PasswordInput.Input, { placeholder: "Enter your new password", ...step1Form.register('newPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.newPassword?.message })] }) }), _jsx(Field.Root, { invalid: !!step1Form.formState.errors.confirmPassword, className: "mt-xl bg-transparent", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { className: 'text-[#344054] dark:text-[#CECFD2]', children: "Confirm Password" }), _jsxs(PasswordInput.Control, { className: 'bg-transparent border-[#D0D5DD] dark:border-[#333741]', children: [_jsx(PasswordInput.Input, { placeholder: "Confirm new password", ...step1Form.register('confirmPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.confirmPassword?.message })] }) }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.verificationCode, className: "mt-xl bg-transparent", children: [_jsx(Field.Label, { className: 'text-[#344054] dark:text-[#CECFD2]', children: "OTP Code" }), _jsxs("div", { className: "grid grid-cols-[1fr_104px] gap-2", children: [_jsx(Field.Input, { placeholder: "Enter OTP Code", ...step1Form.register('verificationCode'), className: 'bg-transparent border-[#D0D5DD] dark:border-[#333741]' }), _jsx(Button, { variant: 'outline', className: 'bg-transparent', type: 'button', disabled: !mobileNumberValue || !!step1Form.formState.errors.mobileNumber || cooldown.cooling, onClick: async () => {
|
|
119
|
+
if (!cooldown.cooling) {
|
|
120
|
+
try {
|
|
121
|
+
await sendVerificationCodeMutation.mutateAsync({
|
|
122
|
+
channel: 'SMS',
|
|
123
|
+
recipient: mobileNumberParser.format(step1Form.getValues('mobileNumber')),
|
|
124
|
+
});
|
|
125
|
+
cooldown.start();
|
|
126
|
+
}
|
|
127
|
+
catch (e) {
|
|
128
|
+
toaster.error({
|
|
129
|
+
description: e instanceof Error
|
|
130
|
+
? e.message
|
|
131
|
+
: 'Failed to send verification code',
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}, children: cooldown.cooling ? cooldown.countdown + ' sec' : 'Get OTP' })] }), _jsx(Field.ErrorText, { className: "text-[#ff2525b3] text-xs", children: step1Form.formState.errors.verificationCode?.message })] }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting || !step1Form.formState.isValid || !step1Form.formState.isDirty, children: "Set up New Password" })] })] }));
|
|
136
|
+
}
|
|
137
|
+
return (_jsxs(_Fragment, { children: [step === 1 && (_jsxs(_Fragment, { children: [Header[step], _jsxs("form", { className: "mt-3xl", onSubmit: step1Form.handleSubmit(async (data) => {
|
|
103
138
|
try {
|
|
104
139
|
await sendVerificationCodeMutation.mutateAsync({
|
|
105
140
|
channel: 'SMS',
|
|
@@ -117,7 +152,7 @@ export function ForgotPasswordForm() {
|
|
|
117
152
|
}
|
|
118
153
|
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "-translate-y-1/2 absolute top-1/2 left-3.5 flex shrink-0 items-center gap-md", children: [_jsx(localeInfo.country.flag, { className: "size-5" }), _jsx("span", { className: "text-text-placeholder", children: localeInfo.mobileNumber.areaCode })] }), _jsx(Field.Input, { style: {
|
|
119
154
|
paddingLeft: `calc(2.75rem + ${localeInfo.mobileNumber.areaCode.length}ch)`,
|
|
120
|
-
}, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsx(Field.Root, { invalid: !!step1Form.formState.errors.newPassword, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "New Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter your new password", ...step1Form.register('newPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.newPassword?.message })] }) }), _jsx(Field.Root, { invalid: !!step1Form.formState.errors.confirmPassword, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Confirm Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Confirm new password", ...step1Form.register('confirmPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.confirmPassword?.message })] }) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Continue" })] })] })), step === 2 && (_jsxs(_Fragment, { children: [
|
|
155
|
+
}, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsx(Field.Root, { invalid: !!step1Form.formState.errors.newPassword, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "New Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter your new password", ...step1Form.register('newPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.newPassword?.message })] }) }), _jsx(Field.Root, { invalid: !!step1Form.formState.errors.confirmPassword, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Confirm Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Confirm new password", ...step1Form.register('confirmPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.confirmPassword?.message })] }) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Continue" })] })] })), step === 2 && (_jsxs(_Fragment, { children: [Header[step], _jsxs("form", { ref: form2Ref, className: "mt-5", autoComplete: "off", onSubmit: step2Form.handleSubmit(async ({ verificationCode }) => {
|
|
121
156
|
resetPasswordMutation.mutate({
|
|
122
157
|
mobileNumber: mobileNumberParser.format(step1Form.getValues('mobileNumber')),
|
|
123
158
|
newPassword: step1Form.getValues('newPassword'),
|
|
@@ -275,11 +275,14 @@ export function SignUpDefaultFormInternational() {
|
|
|
275
275
|
}
|
|
276
276
|
}, {
|
|
277
277
|
until: (ok) => ok,
|
|
278
|
-
interval:
|
|
278
|
+
interval: 500,
|
|
279
279
|
maxAttempt: 5,
|
|
280
280
|
});
|
|
281
281
|
const ok = await pollLogin();
|
|
282
282
|
if (!ok) {
|
|
283
|
+
toaster.success({
|
|
284
|
+
description: 'Account created successfully. Please log in to continue.',
|
|
285
|
+
});
|
|
283
286
|
globalStore.signIn.setOpen(true);
|
|
284
287
|
return;
|
|
285
288
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function TournamentsCarouselItemCrazywin(): import("react/jsx-runtime").JSX.Element;
|