@opexa/portal-components 0.0.251 → 0.0.253
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.
|
@@ -21,7 +21,9 @@ export function KYCReminder(props) {
|
|
|
21
21
|
const isUploadCompleted = verification &&
|
|
22
22
|
verification.idFrontImage !== null &&
|
|
23
23
|
verification.selfieImage !== null;
|
|
24
|
-
const isVerified = verification?.status === 'VERIFIED'
|
|
24
|
+
const isVerified = Boolean(verification?.status === 'VERIFIED') ||
|
|
25
|
+
Boolean(verification?.status === 'PENDING') ||
|
|
26
|
+
Boolean(verification?.status === 'APPROVED');
|
|
25
27
|
const hasMissingData = !isBasicInfoCompleted || !isUploadCompleted || !isVerified;
|
|
26
28
|
return (_jsx(Dialog.Root, { open: globalStore.kycReminder.open &&
|
|
27
29
|
!sessionLoading &&
|
|
@@ -30,7 +32,7 @@ export function KYCReminder(props) {
|
|
|
30
32
|
session?.status === 'authenticated' &&
|
|
31
33
|
hasMissingData, onOpenChange: (details) => {
|
|
32
34
|
globalStore.kycReminder.setOpen(details.open);
|
|
33
|
-
}, closeOnEscape: false, closeOnInteractOutside: false, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "bg-bg-primary-alt mx-auto h-fit max-w-[calc(100dvw-1rem)] rounded-lg lg:max-w-[400px]
|
|
35
|
+
}, closeOnEscape: false, closeOnInteractOutside: false, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "bg-bg-primary-alt mx-auto h-fit max-w-[calc(100dvw-1rem)] overflow-y-auto rounded-lg lg:max-w-[400px]", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "bg-bg-warning-secondary mx-auto w-fit rounded-full p-2", children: _jsx(FileCheck02Icon, { className: "text-[#FEDF89]" }) }), _jsx("h2", { className: "mt-4 text-lg text-white", children: "Personal Verification" }), _jsxs("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: ["All new users are required to complete identity verification to access the full range of ", props.siteName, " services, including withdrawals."] }), _jsx(Dialog.Context, { children: (api) => (_jsxs("div", { className: "mt-3xl space-y-lg", children: [_jsx(Button, { onClick: () => {
|
|
34
36
|
api.setOpen(false);
|
|
35
37
|
globalStore.kyc.setOpen(true);
|
|
36
38
|
}, children: "Verify Now" }), _jsx(Button, { type: "button", variant: "outline", fullWidth: true, onClick: () => api.setOpen(false), children: "Do it later" })] })) })] })] }) })] }) }));
|
|
@@ -34,6 +34,8 @@ import { CheckIcon } from '../../../icons/CheckIcon.js';
|
|
|
34
34
|
import { ChevronDownIcon } from '../../../icons/ChevronDownIcon.js';
|
|
35
35
|
import { ChevronLeftIcon } from '../../../icons/ChevronLeftIcon.js';
|
|
36
36
|
import { ChevronRightIcon } from '../../../icons/ChevronRightIcon.js';
|
|
37
|
+
import { EyeIcon } from '../../../icons/EyeIcon.js';
|
|
38
|
+
import { EyeOffIcon } from '../../../icons/EyeOffIcon.js';
|
|
37
39
|
import pagcorLogo from '../../../images/pagcor.png';
|
|
38
40
|
import responsibleGamingLogo from '../../../images/responsible-gaming-yellow.png';
|
|
39
41
|
import { ObjectType } from '../../../services/ObjectType.js';
|
|
@@ -41,6 +43,7 @@ import { Button } from '../../../ui/Button/index.js';
|
|
|
41
43
|
import { Checkbox } from '../../../ui/Checkbox/index.js';
|
|
42
44
|
import { DatePicker } from '../../../ui/DatePicker/index.js';
|
|
43
45
|
import { Field } from '../../../ui/Field/index.js';
|
|
46
|
+
import { PasswordInput } from '../../../ui/PasswordInput/index.js';
|
|
44
47
|
import { PinInput } from '../../../ui/PinInput/index.js';
|
|
45
48
|
import { Select } from '../../../ui/Select/index.js';
|
|
46
49
|
import { createPoll } from '../../../utils/createPoll.js';
|
|
@@ -105,13 +108,13 @@ export function SignUpFormKYC() {
|
|
|
105
108
|
.trim(),
|
|
106
109
|
middleName: z
|
|
107
110
|
.string()
|
|
108
|
-
.min(2, '
|
|
109
|
-
.max(50, '
|
|
111
|
+
.min(2, 'Middle name must be 2 or more characters')
|
|
112
|
+
.max(50, 'Middle name must not be more than 50 characters')
|
|
110
113
|
.trim(),
|
|
111
114
|
lastName: z
|
|
112
115
|
.string()
|
|
113
|
-
.min(2, '
|
|
114
|
-
.max(50, '
|
|
116
|
+
.min(2, 'Last name must be 2 or more characters')
|
|
117
|
+
.max(50, 'Last name must not be more than 50 characters')
|
|
115
118
|
.trim(),
|
|
116
119
|
birthDay: z
|
|
117
120
|
.date({
|
|
@@ -233,7 +236,7 @@ export function SignUpFormKYC() {
|
|
|
233
236
|
: 'Failed to send verification code',
|
|
234
237
|
});
|
|
235
238
|
}
|
|
236
|
-
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.name, className: "mt-xl", children: [_jsx(Field.Label, { children: "Account Username" }), _jsx(Field.Input, { placeholder: "Enter Username", ...step1Form.register('name') }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.name?.message })] }),
|
|
239
|
+
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.name, className: "mt-xl", children: [_jsx(Field.Label, { children: "Account Username" }), _jsx(Field.Input, { placeholder: "Enter Username", ...step1Form.register('name') }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.name?.message })] }), _jsx(Field.Root, { invalid: !!step1Form.formState.errors.password, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter your password", ...step1Form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.password?.message })] }) }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, className: "mt-xl", children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "absolute left-3.5 top-1/2 flex shrink-0 -translate-y-1/2 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: {
|
|
237
240
|
paddingLeft: `calc(2.75rem + ${localeInfo.mobileNumber.areaCode.length}ch)`,
|
|
238
241
|
}, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.firstName, className: "mt-xl", children: [_jsx(Field.Label, { children: "First Name" }), _jsx(Field.Input, { placeholder: "Enter your First Name", ...step1Form.register('firstName') }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.firstName?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.middleName, className: "mt-xl", children: [_jsx(Field.Label, { children: "Middle Name" }), _jsx(Field.Input, { placeholder: "Enter your Middle Name", ...step1Form.register('middleName') }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.middleName?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.lastName, className: "mt-xl", children: [_jsx(Field.Label, { children: "Last Name" }), _jsx(Field.Input, { placeholder: "Enter your Last Name", ...step1Form.register('lastName') }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.lastName?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.birthDay, className: "mt-xl", children: [_jsx(DateOfBirthField, { value: birthDay, onChange: (value) => {
|
|
239
242
|
if (!value)
|
|
@@ -328,7 +331,8 @@ export function SignUpFormKYC() {
|
|
|
328
331
|
}
|
|
329
332
|
}, {
|
|
330
333
|
until: (ok) => ok,
|
|
331
|
-
maxAttempt:
|
|
334
|
+
maxAttempt: 5,
|
|
335
|
+
interval: 300,
|
|
332
336
|
});
|
|
333
337
|
const pollImageUpload = createPoll(async () => {
|
|
334
338
|
const uploadImage = (file) => new Promise((resolve, reject) => {
|
|
@@ -380,7 +384,8 @@ export function SignUpFormKYC() {
|
|
|
380
384
|
}
|
|
381
385
|
}, {
|
|
382
386
|
until: (ok) => ok,
|
|
383
|
-
maxAttempt:
|
|
387
|
+
maxAttempt: 5,
|
|
388
|
+
interval: 300,
|
|
384
389
|
});
|
|
385
390
|
await pollUpdateAccount();
|
|
386
391
|
await pollImageUpload();
|