@opexa/portal-components 0.0.834 → 0.0.835
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Banner/Banner.client.d.ts +12 -0
- package/dist/components/Banner/Banner.client.js +49 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
- package/dist/components/KYC/KYCVerificationStatus.lazy.js +7 -4
- package/dist/components/PortalProvider/AndroidOnlyComponents.d.ts +1 -0
- package/dist/components/PortalProvider/AndroidOnlyComponents.js +12 -0
- package/dist/components/PortalProvider/CXDTokenObserver.js +11 -11
- package/dist/components/SignIn/utils.d.ts +8 -0
- package/dist/components/SignIn/utils.js +26 -0
- package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +1 -1
- package/dist/constants/Branches.d.ts +2 -0
- package/dist/constants/Branches.js +42 -0
- package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +4 -0
- package/dist/third-parties/FacebookPixel/FacebookPixel.js +4 -0
- package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
- package/dist/third-parties/FacebookPixel/api.js +1 -0
- package/dist/third-parties/FacebookPixel/index.d.ts +1 -0
- package/dist/third-parties/FacebookPixel/index.js +1 -0
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +4 -0
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +4 -0
- package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
- package/dist/third-parties/GoogleRecaptcha/api.js +1 -0
- package/dist/third-parties/GoogleRecaptcha/index.d.ts +1 -0
- package/dist/third-parties/GoogleRecaptcha/index.js +1 -0
- package/dist/third-parties/index.d.ts +2 -0
- package/dist/third-parties/index.js +2 -0
- package/dist/ui/Avatar/Avatar.d.ts +9 -9
- package/dist/ui/Avatar/avatar.recipe.d.ts +3 -3
- 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 +144 -144
- package/dist/ui/Menu/menu.recipe.d.ts +8 -8
- package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
- package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +154 -154
- package/dist/ui/Popover/popover.recipe.d.ts +14 -14
- 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/dist/ui/Tooltip/Tooltip.d.ts +30 -30
- package/dist/ui/Tooltip/tooltip.recipe.d.ts +5 -5
- package/package.json +1 -1
- package/dist/components/AccountInfo/GoogleDisconnect.d.ts +0 -7
- package/dist/components/AccountInfo/GoogleDisconnect.js +0 -11
- package/dist/components/DepositWithdrawal/Deposit/GCashWebpayDeposit /GCashWebpayDeposit .d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/GCashWebpayDeposit /GCashWebpayDeposit .js +0 -191
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Confirmed.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Confirmed.js +0 -11
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Failed.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Failed.js +0 -11
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Form.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Form.js +0 -126
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/GeneratingQrCode.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/GeneratingQrCode.js +0 -10
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QRPHDeposit.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QRPHDeposit.js +0 -12
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QRPHDepositContext.d.ts +0 -17
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QRPHDepositContext.js +0 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QrCodeGenerated.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QrCodeGenerated.js +0 -41
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/useQRPHDeposit.d.ts +0 -13
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/useQRPHDeposit.js +0 -91
- package/dist/icons/LinkBrokenIcon.d.ts +0 -2
- package/dist/icons/LinkBrokenIcon.js +0 -4
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef, 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
|
-
export function useQRPHDeposit() {
|
|
9
|
-
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
10
|
-
kycVerificationStatus: ctx.kycVerificationStatus,
|
|
11
|
-
})));
|
|
12
|
-
const inputRef = useRef(null);
|
|
13
|
-
const [deposit, setDeposit] = useState(null);
|
|
14
|
-
const [status, setStatus] = useState('idle');
|
|
15
|
-
const verificationQuery = useMemberVerificationQuery();
|
|
16
|
-
const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
|
|
17
|
-
const mutation = useCreateQRPHDepositMutation({
|
|
18
|
-
onMutate() {
|
|
19
|
-
setStatus('generating-qr-code');
|
|
20
|
-
},
|
|
21
|
-
onSuccess(data) {
|
|
22
|
-
invariant(data.qrCode);
|
|
23
|
-
setStatus('qr-code-generated');
|
|
24
|
-
setDeposit(data);
|
|
25
|
-
},
|
|
26
|
-
onError() {
|
|
27
|
-
setStatus('failed');
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
const query = useDepositQuery(deposit?.id, {
|
|
31
|
-
enabled: !!deposit && status === 'qr-code-generated',
|
|
32
|
-
refetchInterval: (ctx) => {
|
|
33
|
-
if (ctx.state.data?.status === 'APPROVED' ||
|
|
34
|
-
ctx.state.data?.status === 'CONFIRMED' ||
|
|
35
|
-
ctx.state.data?.status === 'CANCELLED' ||
|
|
36
|
-
ctx.state.data?.status === 'REJECTED' ||
|
|
37
|
-
ctx.state.data?.status === 'FAILED') {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
return 2000;
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
if (query.data?.status === 'APPROVED' ||
|
|
45
|
-
query.data?.status === 'CONFIRMED') {
|
|
46
|
-
setStatus('confirmed');
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
if (query.data?.status === 'CANCELLED' ||
|
|
50
|
-
query.data?.status === 'REJECTED' ||
|
|
51
|
-
query.data?.status === 'FAILED') {
|
|
52
|
-
setStatus('failed');
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
}, [query.data?.status]);
|
|
56
|
-
const generateQRCode = async (input) => {
|
|
57
|
-
if (verificationStatus === 'PENDING' ||
|
|
58
|
-
verificationStatus === 'UNVERIFIED' ||
|
|
59
|
-
verificationStatus === 'REJECTED' ||
|
|
60
|
-
verificationStatus === 'CREATED') {
|
|
61
|
-
globalStore.kycVerificationStatus.setOpen(true);
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
inputRef.current = input;
|
|
65
|
-
mutation.mutate({
|
|
66
|
-
amount: input.amount,
|
|
67
|
-
promo: input.promo ?? undefined,
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
const regenerateQRCode = async () => {
|
|
71
|
-
invariant(inputRef.current);
|
|
72
|
-
mutation.reset();
|
|
73
|
-
await new Promise((resolve) => setTimeout(resolve, 1));
|
|
74
|
-
mutation.mutate({
|
|
75
|
-
amount: inputRef.current.amount,
|
|
76
|
-
promo: inputRef.current.promo ?? undefined,
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
const reset = () => {
|
|
80
|
-
setStatus('idle');
|
|
81
|
-
setDeposit(null);
|
|
82
|
-
inputRef.current = null;
|
|
83
|
-
};
|
|
84
|
-
return {
|
|
85
|
-
status,
|
|
86
|
-
deposit,
|
|
87
|
-
generateQRCode,
|
|
88
|
-
regenerateQRCode,
|
|
89
|
-
reset,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export function LinkBrokenIcon(props) {
|
|
3
|
-
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", ...props, children: _jsx("path", { d: "M8.5 15.5L15.5 8.49998M9 4V2M15 20V22M4 9H2M20 15H22M4.91421 4.91421L3.5 3.5M19.0858 19.0857L20.5 20.4999M12 17.6568L9.87871 19.7781C8.31662 21.3402 5.78396 21.3402 4.22186 19.7781C2.65976 18.216 2.65976 15.6833 4.22186 14.1212L6.34318 11.9999M17.6569 11.9999L19.7782 9.87859C21.3403 8.31649 21.3403 5.78383 19.7782 4.22174C18.2161 2.65964 15.6835 2.65964 14.1214 4.22174L12 6.34306", stroke: "#FEDF89", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }) }));
|
|
4
|
-
}
|