@opexa/portal-components 0.0.958 → 0.0.959
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/useCamera.d.ts +1 -1
- package/dist/client/hooks/useCamera.js +66 -22
- package/dist/client/hooks/useVerifyMobileNumber.d.ts +3 -0
- package/dist/client/hooks/useVerifyMobileNumber.js +20 -0
- package/dist/components/AccountInfo/AccountInfo.js +1 -1
- package/dist/components/AccountSecurity/AccountSecurity.js +1 -1
- 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/AiOPayMayaDeposit/AiOPayMayaDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/AurixPayGCashDeposit/AurixPayGCashDeposit.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/AurixPayGrabPayDeposit/AurixPayGrabPayDeposit.js +2 -2
- 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/AurixPayPayMayaDeposit/AurixPayPayMayaDeposit.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/Form.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/Deposit.js +10 -20
- package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/GCashWebpayDeposit/GCashWebpayDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/LibanganDeposit/LibanganDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/MayaWebpayDeposit/MayaWebpayDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/PisoPayDeposit/PisoPayDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/Form.js +1 -1
- package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.d.ts +0 -1
- package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.js +1 -2
- package/dist/components/DepositWithdrawal/Withdrawal/GCashStandardCashInWithdrawal/GCashStandardCashInWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayGCashWithdrawal/InstapayGcashWithdrawal.js +2 -2
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayPaymayaWithdrawal/InstapayPaymayaWithdrawal.js +2 -2
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/VentajaWithdrawal/VentajaWithdrawal.js +1 -1
- package/dist/components/Disclaimer/DisclaimerV3.js +12 -21
- package/dist/components/ForgotPassword/Crazywin/CWForgotPassword.js +1 -1
- package/dist/components/ForgotPassword/Crazywin/CWForgotPasswordForm.js +2 -2
- package/dist/components/ForgotPassword/ForgotPasswordForm.js +3 -3
- package/dist/components/GameProviders/GameProvidersCarousel.d.ts +0 -8
- package/dist/components/GameProviders/GameProvidersCarousel.js +0 -32
- package/dist/components/Games/Game.js +1 -6
- package/dist/components/Jackpots/JackpotsCarouselNext/JackpotsCarouselStageItem.js +1 -1
- package/dist/components/Quests/Crazywin/components/Countdown.js +1 -1
- package/dist/components/SignUp/SignUpKYC/SelfieImageField/useSelfieImageField.js +1 -0
- package/dist/components/SingleSignOn/SingleSignOn.d.ts +4 -0
- package/dist/components/SingleSignOn/SingleSignOn.js +185 -0
- package/dist/components/SingleSignOn/index.d.ts +1 -0
- package/dist/components/SingleSignOn/index.js +1 -0
- package/dist/components/TermsOfUse/TermsOfUseV2.lazy.d.ts +1 -1
- package/dist/components/TermsOfUse/TermsOfUseV2.lazy.js +1 -1
- package/dist/components/TermsOfUse/TermsOfUseV3.lazy.d.ts +1 -1
- package/dist/components/TermsOfUse/TermsOfUseV3.lazy.js +1 -1
- package/dist/components/shared/SelfieImageField/useSelfieImageField.js +3 -1
- package/dist/handlers/index.d.ts +2 -2
- package/dist/lib/components/UpdateMobileNumber/UpdateMobileNumber.d.ts +1 -3
- package/dist/lib/components/UpdateMobileNumber/UpdateMobileNumber.js +13 -8
- package/dist/schemas/forgotPasswordSchema.d.ts +4 -4
- 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/Menu/Menu.d.ts +198 -198
- package/dist/ui/Menu/menu.recipe.d.ts +11 -11
- package/dist/ui/Popover/Popover.d.ts +88 -88
- package/dist/ui/Popover/popover.recipe.d.ts +8 -8
- package/dist/ui/QrCode/QrCode.d.ts +25 -25
- package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
- 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/package.json +1 -1
|
@@ -13,7 +13,7 @@ export interface UseCameraReturn<T extends string = never> {
|
|
|
13
13
|
open(): Promise<void>;
|
|
14
14
|
openNativeCamera(direction: 'front' | 'back'): Promise<File | null>;
|
|
15
15
|
close(): Promise<void>;
|
|
16
|
-
snap(): CameraData | null
|
|
16
|
+
snap(): Promise<CameraData | null>;
|
|
17
17
|
reopen(): Promise<void>;
|
|
18
18
|
reset(): Promise<void>;
|
|
19
19
|
data: CameraData | null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CameraDirection } from '@capacitor/camera';
|
|
2
2
|
import { isBoolean } from 'lodash-es';
|
|
3
3
|
import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
|
|
4
|
+
import invariant from 'tiny-invariant';
|
|
4
5
|
import { useMediaQuery } from 'usehooks-ts';
|
|
5
6
|
export function useCamera(options = {}) {
|
|
6
7
|
const videoRef = useRef(null);
|
|
@@ -101,7 +102,7 @@ export function useCamera(options = {}) {
|
|
|
101
102
|
const file = new File([blob], 'photo.jpg', { type: blob.type });
|
|
102
103
|
return file;
|
|
103
104
|
}
|
|
104
|
-
catch (
|
|
105
|
+
catch (e) {
|
|
105
106
|
setError({
|
|
106
107
|
name: 'CameraError',
|
|
107
108
|
message: 'Failed to open native camera. Check your device settings and try again.',
|
|
@@ -121,33 +122,76 @@ export function useCamera(options = {}) {
|
|
|
121
122
|
resolve();
|
|
122
123
|
});
|
|
123
124
|
}, []);
|
|
124
|
-
const snap = useCallback(() => {
|
|
125
|
+
const snap = useCallback(async () => {
|
|
126
|
+
setData(null);
|
|
127
|
+
setError(null);
|
|
128
|
+
setSnapping(true);
|
|
125
129
|
const video = videoRef.current;
|
|
126
|
-
if (!video)
|
|
127
|
-
return null;
|
|
128
130
|
const canvas = document.createElement('canvas');
|
|
129
131
|
const context = canvas.getContext('2d');
|
|
130
|
-
|
|
131
|
-
|
|
132
|
+
invariant(video, 'Could not find video element');
|
|
133
|
+
invariant(context, 'Could not get canvas context');
|
|
134
|
+
video.currentTime = 1;
|
|
132
135
|
canvas.width = video.videoWidth;
|
|
133
136
|
canvas.height = video.videoHeight;
|
|
134
|
-
context.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
137
|
+
context.imageSmoothingEnabled = true;
|
|
138
|
+
context.imageSmoothingQuality = 'high';
|
|
139
|
+
context.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);
|
|
140
|
+
return new Promise((resolve) => {
|
|
141
|
+
canvas.toBlob(async (blob) => {
|
|
142
|
+
if (!blob) {
|
|
143
|
+
setSnapping(false);
|
|
144
|
+
resolve(null);
|
|
145
|
+
return setError({
|
|
146
|
+
name: 'CameraError',
|
|
147
|
+
message: "'canvas.toBlob' failed to create blob",
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
const url = canvas.toDataURL('image/jpeg', 1);
|
|
151
|
+
const file = new File([blob], `${crypto.randomUUID()}.jpeg`, {
|
|
152
|
+
type: 'image/jpeg',
|
|
153
|
+
endings: 'native',
|
|
154
|
+
lastModified: Date.now(),
|
|
155
|
+
});
|
|
156
|
+
const image = new Image();
|
|
157
|
+
image.src = url;
|
|
158
|
+
image.alt = '';
|
|
159
|
+
image.width = canvas.width;
|
|
160
|
+
image.height = canvas.height;
|
|
161
|
+
if (!image.complete || image.naturalWidth === 0) {
|
|
162
|
+
await new Promise((resolve, reject) => {
|
|
163
|
+
image.onload = () => resolve();
|
|
164
|
+
image.onerror = () => reject();
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
const data = {
|
|
168
|
+
url,
|
|
169
|
+
file,
|
|
170
|
+
image,
|
|
171
|
+
};
|
|
172
|
+
if (!options.transform) {
|
|
173
|
+
setData(data);
|
|
174
|
+
setSnapping(false);
|
|
175
|
+
resolve(data);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
const transformResult = await options.transform({
|
|
179
|
+
...data,
|
|
180
|
+
video,
|
|
181
|
+
canvas,
|
|
182
|
+
});
|
|
183
|
+
if (transformResult.ok) {
|
|
184
|
+
setData(transformResult.data);
|
|
185
|
+
resolve(transformResult.data);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
setError(transformResult.error);
|
|
189
|
+
resolve(null);
|
|
190
|
+
}
|
|
191
|
+
setSnapping(false);
|
|
192
|
+
}, 'image/jpeg', 1);
|
|
142
193
|
});
|
|
143
|
-
|
|
144
|
-
image.src = url;
|
|
145
|
-
image.width = canvas.width;
|
|
146
|
-
image.height = canvas.height;
|
|
147
|
-
const data = { url, file, image };
|
|
148
|
-
setData(data);
|
|
149
|
-
return data;
|
|
150
|
-
}, []);
|
|
194
|
+
}, [options]);
|
|
151
195
|
const reset = useCallback(() => {
|
|
152
196
|
setData(null);
|
|
153
197
|
setError(null);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useMutation } from '@tanstack/react-query';
|
|
2
|
+
import invariant from 'tiny-invariant';
|
|
3
|
+
import { verifyMobileNumber, } from '../../services/account.js';
|
|
4
|
+
import { getVerifyMobileNumberMutationKey } from '../../utils/mutationKeys.js';
|
|
5
|
+
import { getSession } from '../services/getSession.js';
|
|
6
|
+
export const useVerifyMobileNumber = (config) => {
|
|
7
|
+
return useMutation({
|
|
8
|
+
...config,
|
|
9
|
+
mutationKey: getVerifyMobileNumberMutationKey(),
|
|
10
|
+
mutationFn: async (input) => {
|
|
11
|
+
const session = await getSession();
|
|
12
|
+
invariant(session.status === 'authenticated');
|
|
13
|
+
await verifyMobileNumber(input.verificationCode, {
|
|
14
|
+
headers: {
|
|
15
|
+
Authorization: `Bearer ${session.token}`,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
};
|
|
@@ -205,7 +205,7 @@ function ContactInfo({ variant }) {
|
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
207
|
}, [account, form, parse]);
|
|
208
|
-
return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "grow font-semibold text-sm text-text-secondary-700", children: "Contact Info" }), profileCompletion?.personalInformation ? (_jsx(ark.svg, { asChild: true, className: "size-6 text-text-success-primary", children: _jsx(CheckVerified02Icon, {}) })) : (_jsxs("div", { className: "flex items-center gap-1 rounded-sm border border-[#93370d] bg-[#4e1d09] px-sm py-xs", children: [_jsx(AlertCircleIcon, { className: "h-5 w-5 text-[#FEC84B]" }), _jsx("span", { className: "m-0 text-[#FEC84B] text-xs", children: "Not Set" })] }))] }),
|
|
208
|
+
return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "grow font-semibold text-sm text-text-secondary-700", children: "Contact Info" }), profileCompletion?.personalInformation ? (_jsx(ark.svg, { asChild: true, className: "size-6 text-text-success-primary", children: _jsx(CheckVerified02Icon, {}) })) : (_jsxs("div", { className: "flex items-center gap-1 rounded-sm border border-[#93370d] bg-[#4e1d09] px-sm py-xs", children: [_jsx(AlertCircleIcon, { className: "h-5 w-5 text-[#FEC84B]" }), _jsx("span", { className: "m-0 text-[#FEC84B] text-xs", children: "Not Set" })] }))] }), _jsx(AlertWarning, { title: "Please add an email address to your account to receive important notifications.", className: "my-3" }), _jsxs("form", { className: "rounded-xl border border-border-secondary bg-bg-primary-alt shadow-xs", onSubmit: form.handleSubmit((data) => {
|
|
209
209
|
updateAccountMutation.mutate({
|
|
210
210
|
emailAddress: data.emailAddress && account?.emailAddress !== data.emailAddress
|
|
211
211
|
? data.emailAddress
|
|
@@ -160,7 +160,7 @@ function TransactionPassword() {
|
|
|
160
160
|
confirmPassword: '',
|
|
161
161
|
},
|
|
162
162
|
});
|
|
163
|
-
return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "font-semibold text-sm text-text-secondary-700", children: "Transaction password" }), _jsx("p", { className: "text-sm text-text-tertiary-600", children: "The transaction password secures and confirms your wallet withdrawals." })] }), profileCompletion?.
|
|
163
|
+
return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "font-semibold text-sm text-text-secondary-700", children: "Transaction password" }), _jsx("p", { className: "text-sm text-text-tertiary-600", children: "The transaction password secures and confirms your wallet withdrawals." })] }), profileCompletion?.personalInformation ? (_jsx(ark.svg, { asChild: true, className: "size-6 text-text-success-primary", children: _jsx(CheckVerified02Icon, {}) })) : (_jsxs("div", { className: "flex items-center gap-1 rounded-sm border border-[#93370d] bg-[#4e1d09] px-sm py-xs", children: [_jsx(AlertCircleIcon, { className: "h-5 w-5 text-[#FEC84B]" }), _jsx("span", { className: "m-0 text-nowrap text-[#FEC84B] text-xs", children: "Not Set" })] }))] }), _jsx(AlertWarning, { title: "Please set your transaction password. This is required when making withdrawals and helps secure your account.", className: "my-3" }), _jsxs("form", { className: "mt-5 rounded-xl border border-border-secondary bg-bg-primary-alt shadow-xs", onSubmit: form.handleSubmit((data) => {
|
|
164
164
|
updateAccountMutation.mutate({
|
|
165
165
|
transactionPassword: data.password,
|
|
166
166
|
});
|
|
@@ -121,7 +121,7 @@ export function AiOGCashDeposit() {
|
|
|
121
121
|
code: z.ZodIssueCode.too_big,
|
|
122
122
|
inclusive: true,
|
|
123
123
|
maximum: maximumAmount,
|
|
124
|
-
message: `Maximum amount is ${maximumAmount.toLocaleString()}
|
|
124
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
}),
|
|
@@ -114,7 +114,7 @@ export function AiOGrabPayDeposit() {
|
|
|
114
114
|
code: z.ZodIssueCode.too_big,
|
|
115
115
|
inclusive: true,
|
|
116
116
|
maximum: maximumAmount,
|
|
117
|
-
message: `Maximum amount is ${maximumAmount.toLocaleString()}
|
|
117
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
120
|
}),
|
|
@@ -119,7 +119,7 @@ export function AiOPayMayaDeposit() {
|
|
|
119
119
|
code: z.ZodIssueCode.too_big,
|
|
120
120
|
inclusive: true,
|
|
121
121
|
maximum: maximumAmount,
|
|
122
|
-
message: `Maximum amount is ${maximumAmount.toLocaleString()}
|
|
122
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
}),
|
package/dist/components/DepositWithdrawal/Deposit/AurixPayGCashDeposit/AurixPayGCashDeposit.js
CHANGED
|
@@ -123,7 +123,7 @@ export function AurixPayGCashDeposit() {
|
|
|
123
123
|
code: z.ZodIssueCode.too_big,
|
|
124
124
|
inclusive: true,
|
|
125
125
|
maximum: maximumAmount,
|
|
126
|
-
message: `Maximum amount is ${maximumAmount.toLocaleString()}
|
|
126
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
}),
|
|
@@ -208,7 +208,7 @@ export function AurixPayGCashDeposit() {
|
|
|
208
208
|
value = value.replace(/(?!^)\D/g, '');
|
|
209
209
|
if (value.startsWith('+')) {
|
|
210
210
|
// keep leading +
|
|
211
|
-
value =
|
|
211
|
+
value = '+' + value.slice(1).replace(/\D/g, '');
|
|
212
212
|
}
|
|
213
213
|
else {
|
|
214
214
|
// remove all non-digits
|
package/dist/components/DepositWithdrawal/Deposit/AurixPayGrabPayDeposit/AurixPayGrabPayDeposit.js
CHANGED
|
@@ -125,7 +125,7 @@ export function AurixPayGrabPayDeposit() {
|
|
|
125
125
|
code: z.ZodIssueCode.too_big,
|
|
126
126
|
inclusive: true,
|
|
127
127
|
maximum: maximumAmount,
|
|
128
|
-
message: `Maximum amount is ${maximumAmount.toLocaleString()}
|
|
128
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
131
|
}),
|
|
@@ -210,7 +210,7 @@ export function AurixPayGrabPayDeposit() {
|
|
|
210
210
|
value = value.replace(/(?!^)\D/g, '');
|
|
211
211
|
if (value.startsWith('+')) {
|
|
212
212
|
// keep leading +
|
|
213
|
-
value =
|
|
213
|
+
value = '+' + value.slice(1).replace(/\D/g, '');
|
|
214
214
|
}
|
|
215
215
|
else {
|
|
216
216
|
// remove all non-digits
|
package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AurixPayGrabPayDeposit(): import("react/jsx-runtime").JSX.Element;
|
package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.js
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
3
|
+
import { ObjectId } from '@opexa/object-id';
|
|
4
|
+
import Link from 'next/link';
|
|
5
|
+
import { useEffect, useState } from 'react';
|
|
6
|
+
import { Controller, useForm } from 'react-hook-form';
|
|
7
|
+
import invariant from 'tiny-invariant';
|
|
8
|
+
import { useBoolean } from 'usehooks-ts';
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { useShallow } from 'zustand/shallow';
|
|
11
|
+
import { useAvailablePromosQuery } from '../../../../client/hooks/useAvailablePromosQuery.js';
|
|
12
|
+
import { useCreateAurixPayGrabPayDepositMutation } from '../../../../client/hooks/useCreateAurixPayGrabPayDepositMutation.js';
|
|
13
|
+
import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
|
|
14
|
+
import { useDepositsCountQuery } from '../../../../client/hooks/useDepositsCountQuery.js';
|
|
15
|
+
import { useDisclosure } from '../../../../client/hooks/useDisclosure.js';
|
|
16
|
+
import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
|
|
17
|
+
import { useMemberVerificationQuery } from '../../../../client/hooks/useMemberVerificationQuery.js';
|
|
18
|
+
import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
|
|
19
|
+
import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
|
|
20
|
+
import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
|
|
21
|
+
import { ChevronUpIcon } from '../../../../icons/ChevronUpIcon.js';
|
|
22
|
+
import { RefreshCcw01Icon } from '../../../../icons/RefreshCcw01Icon.js';
|
|
23
|
+
import { SpinnerIcon } from '../../../../icons/SpinnerIcon.js';
|
|
24
|
+
import { XIcon } from '../../../../icons/XIcon.js';
|
|
25
|
+
import { ObjectType } from '../../../../services/ObjectType.js';
|
|
26
|
+
import { AlertDialog } from '../../../../ui/AlertDialog/index.js';
|
|
27
|
+
import { Button } from '../../../../ui/Button/index.js';
|
|
28
|
+
import { Field } from '../../../../ui/Field/index.js';
|
|
29
|
+
import { NumberInput } from '../../../../ui/NumberInput/index.js';
|
|
30
|
+
import { Portal } from '../../../../ui/Portal/index.js';
|
|
31
|
+
import { getQueryClient } from '../../../../utils/getQueryClient.js';
|
|
32
|
+
import { parseDecimal } from '../../../../utils/parseDecimal.js';
|
|
33
|
+
import { getDepositsCountQueryKey } from '../../../../utils/queryKeys.js';
|
|
34
|
+
import { AmountChoices } from '../../AmountChoices.js';
|
|
35
|
+
import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
|
|
36
|
+
import { AvailablePromos } from '../AvailablePromos.js';
|
|
37
|
+
export function AurixPayGrabPayDeposit() {
|
|
38
|
+
const depositWithdrawalProps = useDepositWithdrawalPropsContext();
|
|
39
|
+
const disclosure = useDisclosure({
|
|
40
|
+
onOpenChange(open) {
|
|
41
|
+
if (!open) {
|
|
42
|
+
form.reset();
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
47
|
+
depositWithdrawal: ctx.depositWithdrawal,
|
|
48
|
+
kycVerificationStatus: ctx.kycVerificationStatus,
|
|
49
|
+
})));
|
|
50
|
+
const verificationQuery = useMemberVerificationQuery();
|
|
51
|
+
const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
|
|
52
|
+
const [status, setStatus] = useState('waiting');
|
|
53
|
+
const [errorMessage, setErrorMessage] = useState(null);
|
|
54
|
+
const createDepositMutation = useCreateAurixPayGrabPayDepositMutation({
|
|
55
|
+
onMutate() {
|
|
56
|
+
disclosure.setOpen(true);
|
|
57
|
+
setStatus('processing');
|
|
58
|
+
},
|
|
59
|
+
onSuccess(data) {
|
|
60
|
+
const queryClient = getQueryClient();
|
|
61
|
+
invariant(data.checkoutUrl);
|
|
62
|
+
window.open(data.checkoutUrl, '_blank', 'noopener,noreferrer');
|
|
63
|
+
queryClient.invalidateQueries({
|
|
64
|
+
queryKey: getDepositsCountQueryKey(),
|
|
65
|
+
});
|
|
66
|
+
setStatus('success');
|
|
67
|
+
},
|
|
68
|
+
onError(data) {
|
|
69
|
+
setStatus('failed');
|
|
70
|
+
setErrorMessage({
|
|
71
|
+
name: data.name,
|
|
72
|
+
message: data.message,
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
const warn = useBoolean();
|
|
77
|
+
const depositQuery = useDepositQuery(createDepositMutation.data?.id, {
|
|
78
|
+
enabled: !warn.value && status === 'success',
|
|
79
|
+
refetchInterval: (ctx) => ctx.state.data?.status === 'CONFIRMED' ||
|
|
80
|
+
ctx.state.data?.status === 'REJECTED' ||
|
|
81
|
+
ctx.state.data?.status === 'CANCELLED'
|
|
82
|
+
? false
|
|
83
|
+
: 1000,
|
|
84
|
+
});
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (depositQuery.data?.status === 'CONFIRMED') {
|
|
87
|
+
setStatus('confirmed');
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (depositQuery.data?.status === 'REJECTED' ||
|
|
91
|
+
depositQuery.data?.status === 'CANCELLED') {
|
|
92
|
+
setStatus('failed');
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
}, [depositQuery.data?.status]);
|
|
96
|
+
const depositsCountQuery = useDepositsCountQuery();
|
|
97
|
+
const depositsCount = depositsCountQuery.data ?? 0;
|
|
98
|
+
const paymentSettingsQuery = usePaymentSettingsQuery();
|
|
99
|
+
const paymentSettings = paymentSettingsQuery.data;
|
|
100
|
+
const gatewaySettings = paymentSettings?.aioGCashDepositGatewaySettings;
|
|
101
|
+
const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
|
|
102
|
+
const minimumAmount = depositsCount <= 0
|
|
103
|
+
? parseDecimal(paymentSettingsQuery.data?.minimumFirstDepositAmount, 0)
|
|
104
|
+
: parseDecimal(gatewaySettings?.minimumAmount, 0);
|
|
105
|
+
const promosQuery = useAvailablePromosQuery();
|
|
106
|
+
const promos = promosQuery.data ?? [];
|
|
107
|
+
const definition = z
|
|
108
|
+
.object({
|
|
109
|
+
amount: z.string().superRefine((val, ctx) => {
|
|
110
|
+
const n = parseDecimal(val, 0);
|
|
111
|
+
if (n < minimumAmount) {
|
|
112
|
+
ctx.addIssue({
|
|
113
|
+
type: 'number',
|
|
114
|
+
code: z.ZodIssueCode.too_small,
|
|
115
|
+
inclusive: true,
|
|
116
|
+
minimum: minimumAmount,
|
|
117
|
+
message: `Please enter ${minimumAmount.toLocaleString()} or more to proceed with your deposit.`,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
if (n > maximumAmount) {
|
|
121
|
+
ctx.addIssue({
|
|
122
|
+
type: 'number',
|
|
123
|
+
code: z.ZodIssueCode.too_big,
|
|
124
|
+
inclusive: true,
|
|
125
|
+
maximum: maximumAmount,
|
|
126
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}),
|
|
130
|
+
promo: z.string().optional().nullable(),
|
|
131
|
+
accountNumber: z
|
|
132
|
+
.string()
|
|
133
|
+
.min(1, 'Account number is required')
|
|
134
|
+
.min(8, 'Account number must be 8 or more characters')
|
|
135
|
+
.max(32, 'Account number must not be more than 32 characters'),
|
|
136
|
+
})
|
|
137
|
+
.superRefine((value, ctx) => {
|
|
138
|
+
const promo = promos.find((o) => o.id === value.promo);
|
|
139
|
+
const promoMinAmount = parseDecimal(promo?.minimumDepositAmount, 0);
|
|
140
|
+
const promoMaxAmount = parseDecimal(promo?.maximumDepositAmount, 0);
|
|
141
|
+
const amount = parseDecimal(value.amount, 0);
|
|
142
|
+
if (promo && amount < promoMinAmount) {
|
|
143
|
+
ctx.addIssue({
|
|
144
|
+
path: ['amount'],
|
|
145
|
+
code: z.ZodIssueCode.custom,
|
|
146
|
+
message: `Minimum amount for this promo is ${promoMinAmount.toLocaleString()}`,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
if (promo && amount > promoMaxAmount) {
|
|
150
|
+
ctx.addIssue({
|
|
151
|
+
path: ['amount'],
|
|
152
|
+
code: z.ZodIssueCode.custom,
|
|
153
|
+
message: `Maximum amount for this promo is ${promoMaxAmount}`,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
const form = useForm({
|
|
158
|
+
mode: 'all',
|
|
159
|
+
resolver: zodResolver(definition),
|
|
160
|
+
defaultValues: {
|
|
161
|
+
amount: '0',
|
|
162
|
+
promo: globalStore.depositWithdrawal.promo ?? null,
|
|
163
|
+
accountNumber: '',
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
useEffect(() => {
|
|
167
|
+
if (minimumAmount) {
|
|
168
|
+
form.reset({
|
|
169
|
+
amount: minimumAmount.toString(),
|
|
170
|
+
promo: form.getValues('promo') ?? null,
|
|
171
|
+
accountNumber: form.getValues('accountNumber') ?? '',
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}, [form, minimumAmount]);
|
|
175
|
+
const redirectUrl = (() => {
|
|
176
|
+
const path = depositWithdrawalProps.depositSuccessPageUrl ?? '/deposits/:id/status';
|
|
177
|
+
const origin = window.location.origin.includes('localhost')
|
|
178
|
+
? 'https://uat.powerplay.ph' +
|
|
179
|
+
depositWithdrawalProps.depositSuccessPageUrl
|
|
180
|
+
: window.location.origin;
|
|
181
|
+
return `${origin}${path}`;
|
|
182
|
+
})();
|
|
183
|
+
return (_jsxs("form", { onSubmit: form.handleSubmit(async (data) => {
|
|
184
|
+
if (!depositWithdrawalProps.bypassDepositKycCheck &&
|
|
185
|
+
(verificationStatus === 'PENDING' ||
|
|
186
|
+
verificationStatus === 'UNVERIFIED' ||
|
|
187
|
+
verificationStatus === 'REJECTED' ||
|
|
188
|
+
verificationStatus === 'CREATED')) {
|
|
189
|
+
globalStore.kycVerificationStatus.setOpen(true);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
const id = ObjectId.generate(ObjectType.Deposit).toString();
|
|
194
|
+
createDepositMutation.reset();
|
|
195
|
+
createDepositMutation.mutate({
|
|
196
|
+
id,
|
|
197
|
+
amount: data.amount.toString(),
|
|
198
|
+
promo: data.promo ?? undefined,
|
|
199
|
+
redirectUrl: redirectUrl.replace(':id', id),
|
|
200
|
+
accountNumber: data.accountNumber,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}), noValidate: true, children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.accountNumber, children: [_jsx(Field.Label, { children: "Account number" }), _jsx(Field.Input, { ...form.register('accountNumber') }), _jsx(Field.ErrorText, { children: form.formState.errors.accountNumber?.message })] }), _jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, className: "mt-lg", children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
|
|
204
|
+
o.field.onChange(details.value);
|
|
205
|
+
}, allowMouseWheel: true, children: [_jsx(NumberInput.Label, { children: "Enter amount you want to deposit" }), _jsxs(NumberInput.Control, { children: [_jsx(NumberInput.Input, {}), _jsx(NumberInput.IncrementTrigger, { children: _jsx(ChevronUpIcon, {}) }), _jsx(NumberInput.DecrementTrigger, { children: _jsx(ChevronDownIcon, {}) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.amount?.message })] })) }), _jsx(AmountChoices, { value: parseDecimal(form.watch('amount'), 0), onChange: (value) => {
|
|
206
|
+
form.setValue('amount', value.toString(), {
|
|
207
|
+
shouldTouch: true,
|
|
208
|
+
shouldDirty: true,
|
|
209
|
+
shouldValidate: true,
|
|
210
|
+
});
|
|
211
|
+
}, min: minimumAmount, max: maximumAmount, className: "mt-lg" }), _jsx(Controller, { control: form.control, name: "promo", render: (o) => (_jsx(AvailablePromos, { value: o.field.value, onChange: (value) => {
|
|
212
|
+
o.field.onChange(value);
|
|
213
|
+
globalStore.depositWithdrawal.setPromo(null);
|
|
214
|
+
}, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: createDepositMutation.isPending, children: "Deposit" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["By depositing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: disclosure.open, onOpenChange: (details) => {
|
|
215
|
+
disclosure.setOpen(details.open);
|
|
216
|
+
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: () => {
|
|
217
|
+
setStatus('waiting');
|
|
218
|
+
setErrorMessage(null);
|
|
219
|
+
form.reset();
|
|
220
|
+
warn.setFalse();
|
|
221
|
+
}, 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(AlertDialog.Context, { children: (api) => (_jsx("button", { type: "button", className: "absolute top-2.5 right-2.5 flex icon:size-6 size-11 items-center justify-center text-text-quinary", onClick: () => {
|
|
222
|
+
if (status === 'success' && !warn.value) {
|
|
223
|
+
warn.setTrue();
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
api.setOpen(false);
|
|
227
|
+
}
|
|
228
|
+
}, children: _jsx(XIcon, {}) })) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "size-12 text-text-brand-primary-600" })), status === 'success' && !warn.value && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-brand-secondary text-text-featured-icon-light-brand", children: _jsx(RefreshCcw01Icon, {}) })), status === 'success' && warn.value && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-error-secondary text-text-featured-icon-light-error", children: _jsx(AlertCircleIcon, {}) })), status === 'confirmed' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-success-secondary text-text-featured-icon-light-success", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-error-secondary text-text-featured-icon-light-error", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Deposit', status === 'success' &&
|
|
229
|
+
!warn.value &&
|
|
230
|
+
'Didn’t see the payment window?', status === 'success' && warn.value && (_jsx(_Fragment, { children: "Are you sure you want to close this\u00A0window?" })), status === 'confirmed' && 'Deposit Successful', status === 'failed' && errorMessage?.name] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
|
|
231
|
+
"We're verifying your account and amount. Please hold a moment.", status === 'success' &&
|
|
232
|
+
!warn.value &&
|
|
233
|
+
'Sometimes the payment pop up doesn’t appear right away. Don’t worry, just click the button below to reopen it and continue your deposit.', status === 'success' &&
|
|
234
|
+
warn.value &&
|
|
235
|
+
'Closing this window might cancel your current deposit. Do you want to continue?', status === 'confirmed' &&
|
|
236
|
+
'Your deposit has been successfully processed.', status === 'failed' && errorMessage?.message] })] }), (status === 'failed' ||
|
|
237
|
+
status === 'success' ||
|
|
238
|
+
status === 'confirmed') && (_jsxs(AlertDialog.Footer, { children: [status === 'success' && !warn.value && (_jsx(Button, { asChild: true, children: _jsx("a", { href: createDepositMutation.data?.checkoutUrl ?? '', target: "_blank", rel: "noopener noreferrer", children: "Try Again" }) })), status === 'success' && warn.value && (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", onClick: () => {
|
|
239
|
+
warn.setFalse();
|
|
240
|
+
}, children: "Go back" }), _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => api.setOpen(false), children: "Continue" })) })] })), status !== 'success' && (_jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => api.setOpen(false), children: "Ok" })) }))] }))] }) })] }) })] }));
|
|
241
|
+
}
|
package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayPayMayaDeposit.js
CHANGED
|
@@ -123,7 +123,7 @@ export function AurixPayPayMayaDeposit() {
|
|
|
123
123
|
code: z.ZodIssueCode.too_big,
|
|
124
124
|
inclusive: true,
|
|
125
125
|
maximum: maximumAmount,
|
|
126
|
-
message: `Maximum amount is ${maximumAmount.toLocaleString()}
|
|
126
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
}),
|
|
@@ -208,7 +208,7 @@ export function AurixPayPayMayaDeposit() {
|
|
|
208
208
|
value = value.replace(/(?!^)\D/g, '');
|
|
209
209
|
if (value.startsWith('+')) {
|
|
210
210
|
// keep leading +
|
|
211
|
-
value =
|
|
211
|
+
value = '+' + value.slice(1).replace(/\D/g, '');
|
|
212
212
|
}
|
|
213
213
|
else {
|
|
214
214
|
// remove all non-digits
|
|
@@ -64,7 +64,7 @@ export function Form() {
|
|
|
64
64
|
code: z.ZodIssueCode.too_big,
|
|
65
65
|
inclusive: true,
|
|
66
66
|
maximum: maximumAmount,
|
|
67
|
-
message: `Maximum amount is ${maximumAmount.toLocaleString()}
|
|
67
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
}),
|
|
@@ -7,7 +7,6 @@ import { usePaymentSettingsQuery } from '../../../client/hooks/usePaymentSetting
|
|
|
7
7
|
import { AlertCircleIcon } from '../../../icons/AlertCircleIcon.js';
|
|
8
8
|
import { SpinnerIcon } from '../../../icons/SpinnerIcon.js';
|
|
9
9
|
import { onMobileDevice } from '../../../utils/onMobileDevice.js';
|
|
10
|
-
import { useDepositWithdrawalPropsContext } from '../DepositWithdrawalContext.js';
|
|
11
10
|
import { PaymentMethods } from '../PaymentMethods.js';
|
|
12
11
|
import { Voucher } from './Voucher/Voucher.js';
|
|
13
12
|
const QRPHDeposit = lazy(() => import('./QRPHDeposit/QRPHDeposit.js').then((m) => ({ default: m.QRPHDeposit })));
|
|
@@ -50,7 +49,6 @@ export function Deposit() {
|
|
|
50
49
|
const paymentSettingsQuery = usePaymentSettingsQuery();
|
|
51
50
|
const paymentSettings = paymentSettingsQuery.data;
|
|
52
51
|
const featureFlag = useFeatureFlag();
|
|
53
|
-
const { isOfWinSite } = useDepositWithdrawalPropsContext();
|
|
54
52
|
const aurixComponents = useMemo(() => {
|
|
55
53
|
return {
|
|
56
54
|
gcash: lazy(() => import('./AurixPayGCashDeposit/AurixPayGCashDeposit.js').then((m) => ({
|
|
@@ -78,31 +76,23 @@ export function Deposit() {
|
|
|
78
76
|
const paymentMethods = [
|
|
79
77
|
{
|
|
80
78
|
method: 'GCASH',
|
|
81
|
-
enabled:
|
|
82
|
-
|
|
83
|
-
featureFlag.enabled
|
|
84
|
-
: paymentSettings?.gcashDepositGatewaySettings?.[enabledKey],
|
|
79
|
+
enabled: paymentSettings?.gcashDepositGatewaySettings?.[enabledKey] &&
|
|
80
|
+
featureFlag.enabled,
|
|
85
81
|
},
|
|
86
82
|
{
|
|
87
83
|
method: 'MAYA',
|
|
88
|
-
enabled:
|
|
89
|
-
|
|
90
|
-
featureFlag.enabled
|
|
91
|
-
: paymentSettings?.mayaDepositGatewaySettings?.[enabledKey],
|
|
84
|
+
enabled: paymentSettings?.mayaDepositGatewaySettings?.[enabledKey] &&
|
|
85
|
+
featureFlag.enabled,
|
|
92
86
|
},
|
|
93
87
|
{
|
|
94
88
|
method: 'QRPH',
|
|
95
|
-
enabled:
|
|
96
|
-
|
|
97
|
-
featureFlag.enabled
|
|
98
|
-
: paymentSettings?.qrphDepositGatewaySettings?.[enabledKey],
|
|
89
|
+
enabled: paymentSettings?.qrphDepositGatewaySettings?.[enabledKey] &&
|
|
90
|
+
featureFlag.enabled,
|
|
99
91
|
},
|
|
100
92
|
{
|
|
101
93
|
method: 'ONLINE_BANK',
|
|
102
|
-
enabled:
|
|
103
|
-
|
|
104
|
-
featureFlag.enabled
|
|
105
|
-
: paymentSettings?.onlineBankDepositGatewaySettings?.[enabledKey],
|
|
94
|
+
enabled: paymentSettings?.onlineBankDepositGatewaySettings?.[enabledKey] &&
|
|
95
|
+
featureFlag.enabled,
|
|
106
96
|
},
|
|
107
97
|
{
|
|
108
98
|
method: 'LIBANGAN_PAY_IN',
|
|
@@ -159,7 +149,7 @@ export function Deposit() {
|
|
|
159
149
|
{
|
|
160
150
|
method: 'VOUCHER',
|
|
161
151
|
enabled: featureFlag.enabled,
|
|
162
|
-
}
|
|
152
|
+
}
|
|
163
153
|
];
|
|
164
154
|
paymentMethods.forEach((o) => {
|
|
165
155
|
if (o.enabled) {
|
|
@@ -167,7 +157,7 @@ export function Deposit() {
|
|
|
167
157
|
}
|
|
168
158
|
});
|
|
169
159
|
return l;
|
|
170
|
-
}, [featureFlag.enabled, onMaya, paymentSettings
|
|
160
|
+
}, [featureFlag.enabled, onMaya, paymentSettings]);
|
|
171
161
|
const [paymentMethod, setPaymentMethod] = useState();
|
|
172
162
|
useEffect(() => {
|
|
173
163
|
if (enabledPaymentMethods.length > 0 && !paymentMethod) {
|
|
@@ -115,7 +115,7 @@ export function GCashDeposit() {
|
|
|
115
115
|
code: z.ZodIssueCode.too_big,
|
|
116
116
|
inclusive: true,
|
|
117
117
|
maximum: maximumAmount,
|
|
118
|
-
message: `Maximum amount is ${maximumAmount.toLocaleString()}
|
|
118
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
}),
|
|
@@ -110,7 +110,7 @@ export function GCashWebpayDeposit() {
|
|
|
110
110
|
code: z.ZodIssueCode.too_big,
|
|
111
111
|
inclusive: true,
|
|
112
112
|
maximum: maximumAmount,
|
|
113
|
-
message: `Maximum amount is ${maximumAmount.toLocaleString()}
|
|
113
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
}),
|
|
@@ -110,7 +110,7 @@ export function LibanganDeposit() {
|
|
|
110
110
|
code: z.ZodIssueCode.too_big,
|
|
111
111
|
inclusive: true,
|
|
112
112
|
maximum: maximumAmount,
|
|
113
|
-
message: `Maximum amount is ${maximumAmount.toLocaleString()}
|
|
113
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
}),
|
|
@@ -81,7 +81,7 @@ export function MayaAppDeposit() {
|
|
|
81
81
|
code: z.ZodIssueCode.too_big,
|
|
82
82
|
inclusive: true,
|
|
83
83
|
maximum: maximumAmount,
|
|
84
|
-
message: `Maximum amount is ${maximumAmount.toLocaleString()}
|
|
84
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
}),
|