@opexa/portal-components 0.0.41 → 0.0.43
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/useCreateOnlineBankDepositMutation.js +4 -1
- package/dist/client/hooks/useCreateQRPHDepositMutation.js +4 -1
- package/dist/client/hooks/useIsMayaSessionValidQuery.js +5 -1
- package/dist/components/DepositWithdrawal/Deposit/Deposit.js +15 -4
- package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +23 -16
- package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.js +23 -25
- package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +23 -16
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDeposit.js +3 -4
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositAlert.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositAlert.js +96 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +16 -16
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositDetails.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositDetails.js +16 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.js +3 -11
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +9 -10
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.js +38 -51
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDeposit.js +3 -4
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositAlert.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositAlert.js +96 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +14 -16
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositDetails.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositDetails.js +16 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.js +3 -11
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +8 -10
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.js +37 -54
- package/dist/components/DepositWithdrawal/PaymentMethods.js +3 -2
- package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.js +23 -19
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js +23 -20
- package/dist/components/DepositWithdrawal/Withdrawal/MayaAppWithdrawal/MayaAppWithdrawal.js +23 -25
- package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.js +23 -19
- package/dist/components/DepositWithdrawal/Withdrawal/Withdrawal.js +11 -2
- package/dist/icons/SpinnerIcon.js +1 -1
- package/dist/images/QRPH.png +0 -0
- package/dist/images/gcash.png +0 -0
- package/dist/styles/theme.css +28 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- 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.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 +196 -196
- package/dist/ui/Combobox/combobox.recipe.d.ts +14 -14
- package/dist/ui/DatePicker/DatePicker.d.ts +192 -192
- package/dist/ui/DatePicker/datePicker.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/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +55 -55
- package/dist/ui/Popover/popover.recipe.d.ts +5 -5
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- 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 +10 -5
- package/dist/components/AccountVerification/selfie.png +0 -0
- package/dist/components/AccountVerification/upload-id.png +0 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositLoading.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositLoading.js +0 -5
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositSuccess.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositSuccess.js +0 -5
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositVCA.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositVCA.js +0 -14
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositLoading.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositLoading.js +0 -5
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositQrCode.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositQrCode.js +0 -18
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositSuccess.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositSuccess.js +0 -8
- package/dist/components/DepositWithdrawal/MayaSessionExpired.d.ts +0 -1
- package/dist/components/DepositWithdrawal/MayaSessionExpired.js +0 -5
- package/dist/components/PortalProvider/PortalProvider.client.d.ts +0 -2
- package/dist/components/PortalProvider/PortalProvider.client.js +0 -38
- package/dist/images/QRPh.png +0 -0
|
@@ -1,36 +1,28 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Portal } from '@ark-ui/react';
|
|
2
3
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
4
5
|
import { Controller, useForm } from 'react-hook-form';
|
|
5
6
|
import { z } from 'zod';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { ChevronDownIcon, ChevronUpIcon, EyeIcon, EyeOffIcon, SpinnerIcon, } from '../../../../icons/index.js';
|
|
10
|
-
import { Button, Field, NumberInput, PasswordInput } from '../../../../ui/index.js';
|
|
7
|
+
import { useCreateMayaAppWithdrawalMutation, usePaymentSettingsQuery, } from '../../../../client/hooks/index.js';
|
|
8
|
+
import { AlertCircleIcon, ChevronDownIcon, ChevronUpIcon, EyeIcon, EyeOffIcon, SpinnerIcon, XIcon, } from '../../../../icons/index.js';
|
|
9
|
+
import { AlertDialog, Button, Field, NumberInput, PasswordInput, } from '../../../../ui/index.js';
|
|
11
10
|
import { parseDecimal } from '../../../../utils/index.js';
|
|
12
11
|
import { AmountChoices } from '../../AmountChoices.js';
|
|
13
|
-
import { MayaSessionExpired } from '../../MayaSessionExpired.js';
|
|
14
12
|
export function MayaAppWithdrawal() {
|
|
15
|
-
const
|
|
16
|
-
depositWithdrawal: ctx.depositWithdrawal,
|
|
17
|
-
})));
|
|
13
|
+
const [status, setStatus] = useState('waiting');
|
|
18
14
|
const createWithdrawalMutation = useCreateMayaAppWithdrawalMutation({
|
|
15
|
+
onMutate() {
|
|
16
|
+
setStatus('processing');
|
|
17
|
+
},
|
|
19
18
|
onSuccess() {
|
|
20
19
|
form.reset();
|
|
21
|
-
|
|
22
|
-
toaster.success({
|
|
23
|
-
description: 'Withdrawal request submitted successfully.',
|
|
24
|
-
});
|
|
20
|
+
setStatus('success');
|
|
25
21
|
},
|
|
26
|
-
onError(
|
|
27
|
-
|
|
28
|
-
description: error.message,
|
|
29
|
-
});
|
|
22
|
+
onError() {
|
|
23
|
+
setStatus('failed');
|
|
30
24
|
},
|
|
31
25
|
});
|
|
32
|
-
const isMayaSessionValidQuery = useIsMayaSessionValidQuery();
|
|
33
|
-
const isMayaSessionValid = isMayaSessionValidQuery.data ?? true;
|
|
34
26
|
const paymentSettingsQuery = usePaymentSettingsQuery();
|
|
35
27
|
const paymentSettings = paymentSettingsQuery.data;
|
|
36
28
|
const gatewaySettings = paymentSettings?.mayaAppWithdrawalGatewaySettings;
|
|
@@ -85,9 +77,6 @@ export function MayaAppWithdrawal() {
|
|
|
85
77
|
transactionPassword: data.password,
|
|
86
78
|
});
|
|
87
79
|
});
|
|
88
|
-
if (!isMayaSessionValid) {
|
|
89
|
-
return _jsx(MayaSessionExpired, {});
|
|
90
|
-
}
|
|
91
80
|
return (_jsxs("form", { onSubmit: handleSubmit, noValidate: true, children: [_jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
|
|
92
81
|
o.field.onChange(details.value);
|
|
93
82
|
}, formatOptions: {
|
|
@@ -99,5 +88,14 @@ export function MayaAppWithdrawal() {
|
|
|
99
88
|
shouldDirty: true,
|
|
100
89
|
shouldValidate: true,
|
|
101
90
|
});
|
|
102
|
-
}, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx("button", { type: "button", className: "underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children:
|
|
91
|
+
}, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx("button", { type: "button", className: "underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
|
|
92
|
+
if (!details.open) {
|
|
93
|
+
setStatus('waiting');
|
|
94
|
+
}
|
|
95
|
+
}, lazyMount: true, unmountOnExit: true, 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.CloseTrigger, { disabled: status === 'processing', children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "text-text-brand-primary-600 size-12" })), status === 'success' && (_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "bg-bg-error-secondary text-text-featured-icon-light-error flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Withdraw', status === 'success' && 'Withdrawal Submitted', status === 'failed' && 'Withdraw Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
|
|
96
|
+
"We're verifying your account and amount. Please hold a moment.", status === 'success' &&
|
|
97
|
+
'Your withdrawal request has been submitted successfully and is awaiting confirmation. You won’t have to wait long — once approved, the funds will be credited to your account.', status === 'failed' &&
|
|
98
|
+
'Something went wrong while processing your withdrawal. Please try again or contact support.'] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
|
|
99
|
+
api.setOpen(false);
|
|
100
|
+
}, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
|
|
103
101
|
}
|
|
@@ -1,33 +1,28 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Portal } from '@ark-ui/react';
|
|
2
3
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
4
5
|
import { Controller, useForm } from 'react-hook-form';
|
|
5
6
|
import { z } from 'zod';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { ChevronDownIcon, ChevronUpIcon, EyeIcon, EyeOffIcon, SpinnerIcon, } from '../../../../icons/index.js';
|
|
10
|
-
import { Button, Field, NumberInput, PasswordInput } from '../../../../ui/index.js';
|
|
7
|
+
import { useCreateMayaWithdrawalMutation, useLocaleInfo, useMobileNumberParser, usePaymentSettingsQuery, } from '../../../../client/hooks/index.js';
|
|
8
|
+
import { AlertCircleIcon, ChevronDownIcon, ChevronUpIcon, EyeIcon, EyeOffIcon, SpinnerIcon, XIcon, } from '../../../../icons/index.js';
|
|
9
|
+
import { AlertDialog, Button, Field, NumberInput, PasswordInput, } from '../../../../ui/index.js';
|
|
11
10
|
import { parseDecimal } from '../../../../utils/index.js';
|
|
12
11
|
import { AmountChoices } from '../../AmountChoices.js';
|
|
13
12
|
export function MayaWithdrawal() {
|
|
14
|
-
const
|
|
15
|
-
depositWithdrawal: ctx.depositWithdrawal,
|
|
16
|
-
})));
|
|
13
|
+
const [status, setStatus] = useState('waiting');
|
|
17
14
|
const localeInfo = useLocaleInfo();
|
|
18
15
|
const mobileNumberParser = useMobileNumberParser();
|
|
19
16
|
const createWithdrawalMutation = useCreateMayaWithdrawalMutation({
|
|
17
|
+
onMutate() {
|
|
18
|
+
setStatus('processing');
|
|
19
|
+
},
|
|
20
20
|
onSuccess() {
|
|
21
21
|
form.reset();
|
|
22
|
-
|
|
23
|
-
toaster.success({
|
|
24
|
-
description: 'Withdrawal request submitted successfully.',
|
|
25
|
-
});
|
|
22
|
+
setStatus('success');
|
|
26
23
|
},
|
|
27
|
-
onError(
|
|
28
|
-
|
|
29
|
-
description: error.message,
|
|
30
|
-
});
|
|
24
|
+
onError() {
|
|
25
|
+
setStatus('failed');
|
|
31
26
|
},
|
|
32
27
|
});
|
|
33
28
|
const paymentSettingsQuery = usePaymentSettingsQuery();
|
|
@@ -101,5 +96,14 @@ export function MayaWithdrawal() {
|
|
|
101
96
|
shouldDirty: true,
|
|
102
97
|
shouldValidate: true,
|
|
103
98
|
});
|
|
104
|
-
}, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx("button", { type: "button", className: "underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children:
|
|
99
|
+
}, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx("button", { type: "button", className: "underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
|
|
100
|
+
if (!details.open) {
|
|
101
|
+
setStatus('waiting');
|
|
102
|
+
}
|
|
103
|
+
}, lazyMount: true, unmountOnExit: true, 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.CloseTrigger, { disabled: status === 'processing', children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "text-text-brand-primary-600 size-12" })), status === 'success' && (_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "bg-bg-error-secondary text-text-featured-icon-light-error flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Withdraw', status === 'success' && 'Withdrawal Submitted', status === 'failed' && 'Withdraw Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
|
|
104
|
+
"We're verifying your account and amount. Please hold a moment.", status === 'success' &&
|
|
105
|
+
'Your withdrawal request has been submitted successfully and is awaiting confirmation. You won’t have to wait long — once approved, the funds will be credited to your account.', status === 'failed' &&
|
|
106
|
+
'Something went wrong while processing your withdrawal. Please try again or contact support.'] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
|
|
107
|
+
api.setOpen(false);
|
|
108
|
+
}, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
|
|
105
109
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { useShallow } from 'zustand/shallow';
|
|
4
|
-
import { useAccountQuery, useGlobalStore, useOnMMA, usePaymentSettingsQuery, useWalletQuery, } from '../../../client/hooks/index.js';
|
|
4
|
+
import { useAccountQuery, useGlobalStore, useIsMayaSessionValidQuery, useOnMMA, usePaymentSettingsQuery, useWalletQuery, } from '../../../client/hooks/index.js';
|
|
5
5
|
import { AlertCircleIcon, SpinnerIcon } from '../../../icons/index.js';
|
|
6
6
|
import { Button } from '../../../ui/index.js';
|
|
7
7
|
import { onMobileDevice, parseDecimal } from '../../../utils/index.js';
|
|
@@ -18,6 +18,8 @@ export function Withdrawal() {
|
|
|
18
18
|
const account = accountQuery.data;
|
|
19
19
|
const paymentSettingsQuery = usePaymentSettingsQuery();
|
|
20
20
|
const paymentSettings = paymentSettingsQuery.data;
|
|
21
|
+
const isMayaSessionValidQuery = useIsMayaSessionValidQuery();
|
|
22
|
+
const isMayaSessionValid = isMayaSessionValidQuery.data ?? true;
|
|
21
23
|
const enabledPaymentMethods = (() => {
|
|
22
24
|
const l = [];
|
|
23
25
|
if (onMMA) {
|
|
@@ -55,9 +57,13 @@ export function Withdrawal() {
|
|
|
55
57
|
}, [enabledPaymentMethods, paymentMethod]);
|
|
56
58
|
if (accountQuery.isLoading ||
|
|
57
59
|
walletQuery.isLoading ||
|
|
58
|
-
paymentSettingsQuery.isLoading
|
|
60
|
+
paymentSettingsQuery.isLoading ||
|
|
61
|
+
isMayaSessionValidQuery.isLoading) {
|
|
59
62
|
return _jsx(SpinnerIcon, { className: "mx-auto size-6" });
|
|
60
63
|
}
|
|
64
|
+
if (!isMayaSessionValid) {
|
|
65
|
+
return _jsx(MayaSessionSessionExpired, {});
|
|
66
|
+
}
|
|
61
67
|
if (parseDecimal(wallet?.balance, 0) < 1) {
|
|
62
68
|
return _jsx(InsufficientBalance, {});
|
|
63
69
|
}
|
|
@@ -80,3 +86,6 @@ function InsufficientBalance() {
|
|
|
80
86
|
function NoAvailablePaymentMethods() {
|
|
81
87
|
return (_jsxs("div", { className: "py-xl", children: [_jsx("div", { className: "bg-bg-warning-secondary mx-auto flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, { className: "text-text-featured-icon-light-warning size-6" }) }), _jsx("h2", { className: "mt-lg text-center text-lg font-semibold", children: "Not Available" }), _jsx("p", { className: "text-text-tertiary-600 mx-auto mt-xs max-w-[25rem] text-center text-sm", children: "Withdrawal is not available at this time. Please try again later or contact support for assistance." })] }));
|
|
82
88
|
}
|
|
89
|
+
function MayaSessionSessionExpired() {
|
|
90
|
+
return (_jsxs("div", { className: "py-xl", children: [_jsx("div", { className: "bg-bg-warning-secondary mx-auto flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, { className: "text-text-featured-icon-light-warning size-6" }) }), _jsx("h2", { className: "mt-lg text-center text-lg font-semibold", children: "Session Expired" }), _jsx("p", { className: "text-text-tertiary-600 mx-auto mt-xs max-w-[25rem] text-center text-sm", children: "Your session has timed out. To continue with deposits or withdrawals, Please try reloading the app." })] }));
|
|
91
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
export function SpinnerIcon(props) {
|
|
4
|
-
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "
|
|
4
|
+
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", ...props, children: [_jsx("path", { d: "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z", className: "fill-bg-tertiary" }), _jsx("path", { d: "M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z", className: "fill-text-brand-primary-600", children: _jsx("animateTransform", { attributeName: "transform", dur: "0.75s", repeatCount: "indefinite", type: "rotate", values: "0 12 12;360 12 12" }) })] }));
|
|
5
5
|
}
|
|
Binary file
|
package/dist/images/gcash.png
CHANGED
|
Binary file
|
package/dist/styles/theme.css
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
@layer base {
|
|
5
5
|
html {
|
|
6
|
-
@apply scheme-dark scroll-smooth;
|
|
6
|
+
@apply scheme-light dark:scheme-dark scroll-smooth;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
body {
|
|
@@ -193,9 +193,11 @@
|
|
|
193
193
|
--color-success-400: #47cd89;
|
|
194
194
|
--color-success-700: #067647;
|
|
195
195
|
--color-success-800: #085d3a;
|
|
196
|
+
--color-cyan-950: #0d2d3a;
|
|
196
197
|
|
|
197
198
|
--color-button-primary-bg: #fac515;
|
|
198
199
|
--color-button-primary-fg: #542c0d;
|
|
200
|
+
--color-button-primary-border: #fac515;
|
|
199
201
|
--color-button-secondary-bg: #13161b;
|
|
200
202
|
--color-button-secondary-fg: #fac515;
|
|
201
203
|
--color-button-secondary-border: #fac515;
|
|
@@ -216,6 +218,8 @@
|
|
|
216
218
|
--color-bg-disabled-subtle: #f9fafb;
|
|
217
219
|
--color-bg-success-secondary: #079455;
|
|
218
220
|
--color-bg-overlay: #22262f;
|
|
221
|
+
--color-bg-error-secondary: #d92d20;
|
|
222
|
+
--color-bg-warning-secondary: #dc6803;
|
|
219
223
|
|
|
220
224
|
--color-text-brand: #feee95;
|
|
221
225
|
--color-text-brand-primary-600: #eaaa08;
|
|
@@ -237,9 +241,11 @@
|
|
|
237
241
|
--color-text-success-primary: #17b26a;
|
|
238
242
|
--color-text-success-primary-600: #47cd89;
|
|
239
243
|
--color-text-warning-primary: #f79009;
|
|
244
|
+
--color-text-warning-primary-600: #fdb022;
|
|
240
245
|
--color-text-error-primary: #f04438;
|
|
241
246
|
--color-text-featured-icon-light-success: #abefc6;
|
|
242
247
|
--color-text-featured-icon-light-error: #fecdca;
|
|
248
|
+
--color-text-featured-icon-light-warning: #fedf89;
|
|
243
249
|
|
|
244
250
|
--color-border-primary: #373a41;
|
|
245
251
|
--color-border-secondary: #22262f;
|
|
@@ -351,6 +357,8 @@
|
|
|
351
357
|
--animate-slide-in-right: slide-in-right 400ms cubic-bezier(0.05, 0.7, 0.1, 1);
|
|
352
358
|
--animate-slide-out-right: slide-out-right 250ms
|
|
353
359
|
cubic-bezier(0.3, 0, 0.8, 0.15);
|
|
360
|
+
--animate-slide-in-down: slide-in-down 400ms cubic-bezier(0.05, 0.7, 0.1, 1);
|
|
361
|
+
--animate-slide-out-down: slide-out-down 250ms cubic-bezier(0.3, 0, 0.8, 0.15);
|
|
354
362
|
--animate-marquee: marquee 10s linear infinite forwards;
|
|
355
363
|
|
|
356
364
|
@keyframes fade-in {
|
|
@@ -597,6 +605,24 @@
|
|
|
597
605
|
}
|
|
598
606
|
}
|
|
599
607
|
|
|
608
|
+
@keyframes slide-in-down {
|
|
609
|
+
from {
|
|
610
|
+
transform: translateY(-100%);
|
|
611
|
+
}
|
|
612
|
+
to {
|
|
613
|
+
transform: translateY(0);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
@keyframes slide-out-down {
|
|
618
|
+
from {
|
|
619
|
+
transform: translateY(0);
|
|
620
|
+
}
|
|
621
|
+
to {
|
|
622
|
+
transform: translateY(-100%);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
600
626
|
@keyframes marquee {
|
|
601
627
|
to {
|
|
602
628
|
transform: translateX(-100%);
|
|
@@ -624,3 +650,4 @@
|
|
|
624
650
|
@custom-variant scrollbar (&::-webkit-scrollbar);
|
|
625
651
|
@custom-variant scrollbar-thumb (&::-webkit-scrollbar-thumb);
|
|
626
652
|
@custom-variant scrollbar-track (&::-webkit-scrollbar-track);
|
|
653
|
+
@custom-variant dark (&:where(.dark, .dark *));
|