@opexa/portal-components 0.0.864 → 0.0.866
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/DateOfBirthField.d.ts +10 -0
- package/dist/components/DateOfBirthField.js +65 -0
- 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__legacy/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/useQRPHDeposit.d.ts +1 -1
- 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/KYC.d.ts +2 -1
- package/dist/components/KYC/KYC.js +7 -0
- package/dist/components/KYC/KYCNonPagCor/IdentityVerification.d.ts +1 -0
- package/dist/components/KYC/KYCNonPagCor/IdentityVerification.js +166 -0
- package/dist/components/KYC/KYCNonPagCor/Indicator.d.ts +1 -0
- package/dist/components/KYC/KYCNonPagCor/Indicator.js +8 -0
- package/dist/components/KYC/KYCNonPagCor/KYCNonPagcor.d.ts +8 -0
- package/dist/components/KYC/KYCNonPagCor/KYCNonPagcor.js +26 -0
- package/dist/components/KYC/KYCNonPagCor/KYCNonPagcorContext.d.ts +6 -0
- package/dist/components/KYC/KYCNonPagCor/KYCNonPagcorContext.js +2 -0
- package/dist/components/KYC/KYCNonPagCor/KYCVerificationStatus.d.ts +1 -0
- package/dist/components/KYC/KYCNonPagCor/KYCVerificationStatus.js +10 -0
- package/dist/components/KYC/KYCNonPagCor/KYCVerificationStatus.lazy.d.ts +1 -0
- package/dist/components/KYC/KYCNonPagCor/KYCVerificationStatus.lazy.js +38 -0
- package/dist/components/KYC/KYCNonPagCor/PersonalInformation.d.ts +1 -0
- package/dist/components/KYC/KYCNonPagCor/PersonalInformation.js +141 -0
- package/dist/components/KYC/KYCNonPagCor/index.d.ts +1 -0
- package/dist/components/KYC/KYCNonPagCor/index.js +1 -0
- package/dist/components/KYC/KYCNonPagCor/useKYCNonPagCor.d.ts +26 -0
- package/dist/components/KYC/KYCNonPagCor/useKYCNonPagCor.js +45 -0
- 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/CrazyWin/MobileNumberSignIn.d.ts +1 -0
- package/dist/components/SignIn/CrazyWin/MobileNumberSignIn.js +259 -0
- package/dist/components/SignIn/CrazyWin/NameAndPasswordSignIn.d.ts +1 -0
- package/dist/components/SignIn/CrazyWin/NameAndPasswordSignIn.js +301 -0
- package/dist/components/SignIn/CrazyWin/SignInForm.d.ts +1 -0
- package/dist/components/SignIn/CrazyWin/SignInForm.js +10 -0
- package/dist/components/SignIn/CrazyWin/SignInMethod.d.ts +1 -0
- package/dist/components/SignIn/CrazyWin/SignInMethod.js +28 -0
- package/dist/components/SignIn/HappyBingo/MobileNumberSignIn.d.ts +1 -0
- package/dist/components/SignIn/HappyBingo/MobileNumberSignIn.js +256 -0
- package/dist/components/SignIn/HappyBingo/NameAndPasswordSignIn.d.ts +1 -0
- package/dist/components/SignIn/HappyBingo/NameAndPasswordSignIn.js +295 -0
- package/dist/components/SignIn/HappyBingo/SignInForm.d.ts +1 -0
- package/dist/components/SignIn/HappyBingo/SignInForm.js +30 -0
- package/dist/components/SignIn/SignIn.lazy.d.ts +1 -0
- package/dist/components/SignIn/SignIn.lazy.js +3 -1
- package/dist/components/SignIn/utils.d.ts +8 -0
- package/dist/components/SignIn/utils.js +26 -0
- package/dist/components/SignUp/SignUpDefault/SignUpDefault.lazy.d.ts +1 -0
- package/dist/components/SignUp/SignUpDefault/SignUpDefaultForm.js +83 -132
- package/dist/constants/Branches.d.ts +2 -0
- package/dist/constants/Branches.js +42 -0
- package/dist/images/phone-icon.svg +10 -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/AlertDialog/AlertDialog.d.ts +88 -88
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
- 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 +306 -306
- 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/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
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ImageProps } from 'next/image';
|
|
2
|
+
export interface BannerEntry {
|
|
3
|
+
src: ImageProps['src'];
|
|
4
|
+
redirectUrl?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface BannerProps {
|
|
7
|
+
banners: BannerEntry[];
|
|
8
|
+
imageWidth?: number | [mobile: number, desktop: number];
|
|
9
|
+
imageHeight?: number | [mobile: number, desktop: number];
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function Banner__client(props: BannerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import emblaCarouselAutoplay from 'embla-carousel-autoplay';
|
|
4
|
+
import useEmblaCarousel, {} from 'embla-carousel-react';
|
|
5
|
+
import isMobile from 'is-mobile';
|
|
6
|
+
import Image from 'next/image';
|
|
7
|
+
import Link from 'next/link';
|
|
8
|
+
import { Fragment, useEffect, useState } from 'react';
|
|
9
|
+
import { twMerge } from 'tailwind-merge';
|
|
10
|
+
import { dataAttr } from '../../utils/dataAttr.js';
|
|
11
|
+
export function Banner__client(props) {
|
|
12
|
+
const [emblaRef, emblaApi] = useEmblaCarousel({
|
|
13
|
+
loop: true,
|
|
14
|
+
align: 'start',
|
|
15
|
+
}, [
|
|
16
|
+
emblaCarouselAutoplay({
|
|
17
|
+
playOnInit: true,
|
|
18
|
+
delay: 5000,
|
|
19
|
+
}),
|
|
20
|
+
]);
|
|
21
|
+
const [currentIndex, setCurrentIndex] = useState(0);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
function handler(detail) {
|
|
24
|
+
setCurrentIndex(detail?.selectedScrollSnap() ?? 0);
|
|
25
|
+
}
|
|
26
|
+
emblaApi?.on('scroll', handler);
|
|
27
|
+
emblaApi?.on('init', handler);
|
|
28
|
+
return () => {
|
|
29
|
+
emblaApi?.on('init', handler);
|
|
30
|
+
emblaApi?.off('scroll', handler);
|
|
31
|
+
};
|
|
32
|
+
}, [emblaApi]);
|
|
33
|
+
const imageWidth = !props.imageWidth
|
|
34
|
+
? [400, 1200]
|
|
35
|
+
: Array.isArray(props.imageWidth)
|
|
36
|
+
? props.imageWidth
|
|
37
|
+
: [props.imageWidth, props.imageWidth];
|
|
38
|
+
const imageHeight = !props.imageHeight
|
|
39
|
+
? [225, 300]
|
|
40
|
+
: Array.isArray(props.imageHeight)
|
|
41
|
+
? props.imageHeight
|
|
42
|
+
: [props.imageHeight, props.imageHeight];
|
|
43
|
+
return (_jsxs("div", { className: twMerge('relative', props.className), children: [_jsx("div", { ref: emblaRef, className: "overflow-hidden", children: _jsx("div", { className: "flex gap-2", children: props.banners.map((banner, index) => {
|
|
44
|
+
const img = (_jsx(Image, { src: banner.src, alt: "", width: isMobile() ? imageWidth[0] : imageWidth[1], height: isMobile() ? imageHeight[0] : imageHeight[1], className: "block h-auto w-full", priority: index === 0 }));
|
|
45
|
+
return (_jsx(Fragment, { children: !banner.redirectUrl ? (_jsx("div", { className: "w-full shrink-0", children: img })) : (_jsx(Link, { href: banner.redirectUrl, className: "block w-full shrink-0", "aria-label": `Open ${banner.redirectUrl}`, children: img })) }, index));
|
|
46
|
+
}) }) }), _jsx("div", { className: "absolute bottom-lg left-1/2 flex w-fit -translate-x-1/2 gap-2", children: props.banners.map((_, index) => (_jsx("button", { type: "button", className: "ui-active:bg-brand-500 bg-gray-300 size-3 shrink-0 rounded-full border border-white transition-all duration-300 ui-active:w-9", onClick: () => {
|
|
47
|
+
emblaApi?.scrollTo(index);
|
|
48
|
+
}, "aria-label": `Go to slide ${index + 1}`, "data-active": dataAttr(index === currentIndex) }, index))) })] }));
|
|
49
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FocusEventHandler } from 'react';
|
|
2
|
+
interface DateOfBirthFieldProps {
|
|
3
|
+
value?: Date | null;
|
|
4
|
+
onChange?: (value: Date | null) => void;
|
|
5
|
+
defaultValue?: Date | null;
|
|
6
|
+
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
7
|
+
onFocus?: FocusEventHandler<HTMLInputElement>;
|
|
8
|
+
}
|
|
9
|
+
export default function DateOfBirthField(props: DateOfBirthFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { parseDate } from '@ark-ui/react';
|
|
3
|
+
import { useControllableState } from '../client/hooks/useControllableState.js';
|
|
4
|
+
import { CalendarIcon } from '../icons/CalendarIcon.js';
|
|
5
|
+
import { ChevronLeftIcon } from '../icons/ChevronLeftIcon.js';
|
|
6
|
+
import { ChevronRightIcon } from '../icons/ChevronRightIcon.js';
|
|
7
|
+
import { DatePicker } from '../ui/DatePicker/index.js';
|
|
8
|
+
const DEVICE_TIMEZONE = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
9
|
+
export default function DateOfBirthField(props) {
|
|
10
|
+
const [value, setValue] = useControllableState({
|
|
11
|
+
value: props.value,
|
|
12
|
+
defaultValue: props.defaultValue ?? null,
|
|
13
|
+
onChange: props.onChange,
|
|
14
|
+
});
|
|
15
|
+
// Custom input handler to automatically add slashes
|
|
16
|
+
const handleInput = (e) => {
|
|
17
|
+
const input = e.currentTarget;
|
|
18
|
+
const oldValue = input.value;
|
|
19
|
+
const oldCursorPosition = input.selectionStart ?? 0;
|
|
20
|
+
// Get digits only from the current input value string
|
|
21
|
+
const digitsOnly = input.value.replace(/\D/g, '');
|
|
22
|
+
let formattedValue = '';
|
|
23
|
+
// Format MM/DD/YYYY
|
|
24
|
+
if (digitsOnly.length > 0) {
|
|
25
|
+
formattedValue += digitsOnly.substring(0, 2);
|
|
26
|
+
if (digitsOnly.length > 2) {
|
|
27
|
+
formattedValue += `/${digitsOnly.substring(2, 4)}`;
|
|
28
|
+
}
|
|
29
|
+
if (digitsOnly.length > 4) {
|
|
30
|
+
formattedValue += `/${digitsOnly.substring(4, 8)}`;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
formattedValue = formattedValue.substring(0, 10); // Limit length
|
|
34
|
+
if (formattedValue !== oldValue) {
|
|
35
|
+
input.value = formattedValue;
|
|
36
|
+
let newCursorPosition = oldCursorPosition;
|
|
37
|
+
// Calculate the number of slashes before the old cursor position in the old value
|
|
38
|
+
const oldSlashesBeforeCursor = (oldValue.substring(0, oldCursorPosition).match(/\//g) || []).length;
|
|
39
|
+
// Calculate the number of slashes before the new cursor position in the new formatted value
|
|
40
|
+
// We take the substring of the new formatted value up to where the cursor *would* be based on the old digits
|
|
41
|
+
const digitsBeforeOldCursor = oldValue
|
|
42
|
+
.substring(0, oldCursorPosition)
|
|
43
|
+
.replace(/\D/g, '').length;
|
|
44
|
+
const newSlashesBeforeCursor = (formattedValue
|
|
45
|
+
.substring(0, digitsBeforeOldCursor + oldSlashesBeforeCursor)
|
|
46
|
+
.match(/\//g) || []).length;
|
|
47
|
+
// Adjust newCursorPosition based on the difference in slash count
|
|
48
|
+
newCursorPosition += newSlashesBeforeCursor - oldSlashesBeforeCursor;
|
|
49
|
+
// Ensure cursor stays within bounds
|
|
50
|
+
newCursorPosition = Math.min(newCursorPosition, formattedValue.length);
|
|
51
|
+
newCursorPosition = Math.max(0, newCursorPosition);
|
|
52
|
+
setTimeout(() => {
|
|
53
|
+
input.setSelectionRange(newCursorPosition, newCursorPosition);
|
|
54
|
+
}, 0);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
return (_jsxs(DatePicker.Root, { size: "md", variant: "outline", placeholder: "MM/DD/YYYY", lazyMount: true, unmountOnExit: true, fixedWeeks: true, selectionMode: "single", value: value ? [parseDate(value)] : [], onValueChange: (details) => {
|
|
58
|
+
const value = details.value.at(0)?.toDate(DEVICE_TIMEZONE);
|
|
59
|
+
setValue(value ?? null);
|
|
60
|
+
}, children: [_jsx(DatePicker.Label, { children: "Date of Birth" }), _jsxs(DatePicker.Control, { children: [_jsx(DatePicker.Input, { onBlur: props.onBlur, onFocus: props.onFocus, onInput: handleInput }), _jsx(DatePicker.Trigger, { children: _jsx(CalendarIcon, {}) })] }), _jsx(DatePicker.Positioner, { children: _jsxs(DatePicker.Content, { children: [_jsx(DatePicker.View, { view: "day", children: _jsx(DatePicker.Context, { children: (api) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsxs(DatePicker.Table, { children: [_jsx(DatePicker.TableHead, { children: _jsx(DatePicker.TableRow, { children: api.weekDays.map((weekDay, id) => (_jsx(DatePicker.TableHeader, { children: weekDay.short.substring(0, 2) }, id))) }) }), _jsx(DatePicker.TableBody, { children: api.weeks.map((week, id) => (_jsx(DatePicker.TableRow, { children: week.map((day, id) => (_jsx(DatePicker.TableCell, { value: day, children: _jsx(DatePicker.TableCellTrigger, { children: day.day }) }, id))) }, id))) })] })] })) }) }), _jsx(DatePicker.View, { view: "month", children: _jsx(DatePicker.Context, { children: (datePicker) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsx(DatePicker.Table, { children: _jsx(DatePicker.TableBody, { children: datePicker
|
|
61
|
+
.getMonthsGrid({ columns: 4, format: 'short' })
|
|
62
|
+
.map((months, id) => (_jsx(DatePicker.TableRow, { children: months.map((month, id) => (_jsx(DatePicker.TableCell, { value: month.value, children: _jsx(DatePicker.TableCellTrigger, { className: "w-[4.425rem]", children: month.label }) }, id))) }, id))) }) })] })) }) }), _jsx(DatePicker.View, { view: "year", children: _jsx(DatePicker.Context, { children: (datePicker) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsx(DatePicker.Table, { children: _jsx(DatePicker.TableBody, { children: datePicker
|
|
63
|
+
.getYearsGrid({ columns: 4 })
|
|
64
|
+
.map((years, id) => (_jsx(DatePicker.TableRow, { children: years.map((year, id) => (_jsx(DatePicker.TableCell, { value: year.value, children: _jsx(DatePicker.TableCellTrigger, { className: "w-[4.425rem]", children: year.label }) }, id))) }, id))) }) })] })) }) })] }) })] }));
|
|
65
|
+
}
|
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: "waiting" | "failed" | "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: "waiting" | "failed" | "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: "waiting" | "failed" | "processing" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
6
6
|
verify: () => void;
|
|
7
7
|
reset: () => void;
|
|
8
8
|
deposit: Deposit | null;
|
package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositContext.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const QRPHDepositContext: (props: {
|
|
2
2
|
value: {
|
|
3
3
|
view: "form" | "qrCode";
|
|
4
|
-
status: "
|
|
4
|
+
status: "waiting" | "failed" | "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 QRPHDepositContext: (props: {
|
|
|
14
14
|
children?: import("react").ReactNode | undefined;
|
|
15
15
|
}) => React.ReactNode, useQRPHDepositContext: () => {
|
|
16
16
|
view: "form" | "qrCode";
|
|
17
|
-
status: "
|
|
17
|
+
status: "waiting" | "failed" | "processing" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
18
18
|
verify: () => void;
|
|
19
19
|
reset: () => void;
|
|
20
20
|
deposit: import("../../../../types").Deposit | null;
|
|
@@ -2,7 +2,7 @@ import type { Deposit } from '../../../../types';
|
|
|
2
2
|
export type UseQRPHDepositReturn = ReturnType<typeof useQRPHDeposit>;
|
|
3
3
|
export declare function useQRPHDeposit(): {
|
|
4
4
|
view: "form" | "qrCode";
|
|
5
|
-
status: "
|
|
5
|
+
status: "waiting" | "failed" | "processing" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
6
6
|
verify: () => void;
|
|
7
7
|
reset: () => void;
|
|
8
8
|
deposit: Deposit | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const OnlineBankDepositContext: (props: {
|
|
2
2
|
value: {
|
|
3
3
|
view: "form" | "vca";
|
|
4
|
-
status: "
|
|
4
|
+
status: "waiting" | "failed" | "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: "waiting" | "failed" | "processing" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
18
18
|
verify: () => void;
|
|
19
19
|
reset: () => void;
|
|
20
20
|
deposit: import("../../../../types").Deposit | null;
|
|
@@ -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: "waiting" | "failed" | "processing" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
6
6
|
verify: () => void;
|
|
7
7
|
reset: () => void;
|
|
8
8
|
deposit: Deposit | null;
|
package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositContext.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const QRPHDepositContext: (props: {
|
|
2
2
|
value: {
|
|
3
3
|
view: "form" | "qrCode";
|
|
4
|
-
status: "
|
|
4
|
+
status: "waiting" | "failed" | "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 QRPHDepositContext: (props: {
|
|
|
14
14
|
children?: import("react").ReactNode | undefined;
|
|
15
15
|
}) => React.ReactNode, useQRPHDepositContext: () => {
|
|
16
16
|
view: "form" | "qrCode";
|
|
17
|
-
status: "
|
|
17
|
+
status: "waiting" | "failed" | "processing" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
18
18
|
verify: () => void;
|
|
19
19
|
reset: () => void;
|
|
20
20
|
deposit: import("../../../../types").Deposit | null;
|
|
@@ -2,7 +2,7 @@ import type { Deposit } from '../../../../types';
|
|
|
2
2
|
export type UseQRPHDepositReturn = ReturnType<typeof useQRPHDeposit>;
|
|
3
3
|
export declare function useQRPHDeposit(): {
|
|
4
4
|
view: "form" | "qrCode";
|
|
5
|
-
status: "
|
|
5
|
+
status: "waiting" | "failed" | "processing" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
6
6
|
verify: () => void;
|
|
7
7
|
reset: () => void;
|
|
8
8
|
deposit: Deposit | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { KYCDefaultProps } from './KYCDefault';
|
|
2
|
+
import type { KYCNonPagcorProps } from './KYCNonPagCor';
|
|
2
3
|
import type { KYCSumsubProps } from './KYCSumsub';
|
|
3
|
-
export type KYCProps = KYCDefaultProps | KYCSumsubProps;
|
|
4
|
+
export type KYCProps = KYCDefaultProps | KYCSumsubProps | KYCNonPagcorProps;
|
|
4
5
|
export declare function KYC(props: KYCProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,10 +9,17 @@ const KYCSumsub = dynamic(() => import('./KYCSumsub.js').then((m) => m.KYCSumsub
|
|
|
9
9
|
ssr: false,
|
|
10
10
|
loading: () => null,
|
|
11
11
|
});
|
|
12
|
+
const KYCNonPagcor = dynamic(() => import('./KYCNonPagCor/index.js').then((m) => m.KYCNonPagcor), {
|
|
13
|
+
ssr: false,
|
|
14
|
+
loading: () => null,
|
|
15
|
+
});
|
|
12
16
|
export function KYC(props) {
|
|
13
17
|
if (props.provider === 'sumsub') {
|
|
14
18
|
return _jsx(KYCSumsub, { ...props });
|
|
15
19
|
}
|
|
20
|
+
else if (props.provider === 'unregulated') {
|
|
21
|
+
return _jsx(KYCNonPagcor, { ...props });
|
|
22
|
+
}
|
|
16
23
|
else {
|
|
17
24
|
return _jsx(KYCDefault, { ...props });
|
|
18
25
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function IdentityVerification(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Capacitor } from '@capacitor/core';
|
|
4
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
5
|
+
import { useRouter } from 'next/navigation';
|
|
6
|
+
import { useEffect } from 'react';
|
|
7
|
+
import { Controller, useForm } from 'react-hook-form';
|
|
8
|
+
import invariant from 'tiny-invariant';
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { useShallow } from 'zustand/shallow';
|
|
11
|
+
import { useCreateMemberVerificationMutation } from '../../../client/hooks/useCreateMemberVerificationMutation.js';
|
|
12
|
+
import { useGlobalStore } from '../../../client/hooks/useGlobalStore.js';
|
|
13
|
+
import { useMemberVerificationQuery } from '../../../client/hooks/useMemberVerificationQuery.js';
|
|
14
|
+
import { useSignOutMutation } from '../../../client/hooks/useSignOutMutation.js';
|
|
15
|
+
import { useUpdateMemberVerificationMutation } from '../../../client/hooks/useUpdateMemberVerificationMutation.js';
|
|
16
|
+
import { getSession } from '../../../client/services/getSession.js';
|
|
17
|
+
import { toaster } from '../../../client/utils/toaster.js';
|
|
18
|
+
import { unregisterFCMDevice } from '../../../services/trigger.js';
|
|
19
|
+
import { Button } from '../../../ui/Button/index.js';
|
|
20
|
+
import { Dialog } from '../../../ui/Dialog/index.js';
|
|
21
|
+
import { Field } from '../../../ui/Field/index.js';
|
|
22
|
+
import { getQueryClient } from '../../../utils/getQueryClient.js';
|
|
23
|
+
import { getMemberVerificationQueryKey, getSessionQueryKey, } from '../../../utils/queryKeys.js';
|
|
24
|
+
import { IdFrontImageField } from '../../shared/IdFrontImageField/index.js';
|
|
25
|
+
import { SelfieImageField } from '../../shared/SelfieImageField/index.js';
|
|
26
|
+
import { useKYCNonPagcorContext } from './KYCNonPagcorContext.js';
|
|
27
|
+
const formSchema = z.object({
|
|
28
|
+
selfieImage: z.string().min(1, 'Selfie image is required.'),
|
|
29
|
+
idFrontImage: z.string().min(1, 'Front image of ID is required.'),
|
|
30
|
+
});
|
|
31
|
+
export function IdentityVerification() {
|
|
32
|
+
const kyc = useKYCNonPagcorContext();
|
|
33
|
+
const router = useRouter();
|
|
34
|
+
const signOutMutation = useSignOutMutation({
|
|
35
|
+
async onSuccess() {
|
|
36
|
+
localStorage.clear();
|
|
37
|
+
sessionStorage.clear();
|
|
38
|
+
router.replace('/');
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
const { mutate: createMemberVerification, isPending: createPending } = useCreateMemberVerificationMutation({
|
|
42
|
+
onSuccess: () => {
|
|
43
|
+
const queryClient = getQueryClient();
|
|
44
|
+
toaster.success({
|
|
45
|
+
title: 'ID Front Image & Selfie Image uploaded successfully',
|
|
46
|
+
});
|
|
47
|
+
sessionStorage.removeItem('hasSeenKycModal');
|
|
48
|
+
queryClient.setQueryData(getMemberVerificationQueryKey(), (prev) => {
|
|
49
|
+
if (!prev)
|
|
50
|
+
return prev;
|
|
51
|
+
return {
|
|
52
|
+
...prev,
|
|
53
|
+
status: 'UNVERIFIED',
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
kyc.setDone(true);
|
|
57
|
+
globalStore.kyc.setOpen(false);
|
|
58
|
+
},
|
|
59
|
+
onError: (error) => {
|
|
60
|
+
toaster.error({
|
|
61
|
+
title: 'Failed to upload ID Front Image & Selfie Image',
|
|
62
|
+
description: error.message,
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
const { mutate: updateMemberVerification, isPending: updatePending } = useUpdateMemberVerificationMutation({
|
|
67
|
+
onSuccess: () => {
|
|
68
|
+
const queryClient = getQueryClient();
|
|
69
|
+
toaster.success({
|
|
70
|
+
title: 'ID Front Image & Selfie Image updated successfully',
|
|
71
|
+
});
|
|
72
|
+
sessionStorage.removeItem('hasSeenKycModal');
|
|
73
|
+
queryClient.setQueryData(getMemberVerificationQueryKey(), (prev) => {
|
|
74
|
+
if (!prev)
|
|
75
|
+
return prev;
|
|
76
|
+
return {
|
|
77
|
+
...prev,
|
|
78
|
+
status: 'UNVERIFIED',
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
kyc.setDone(true);
|
|
82
|
+
globalStore.kyc.setOpen(false);
|
|
83
|
+
},
|
|
84
|
+
onError: (error) => {
|
|
85
|
+
toaster.error({
|
|
86
|
+
title: 'Failed to upload ID Front Image & Selfie Image',
|
|
87
|
+
description: error.message,
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
const memberVerification = useMemberVerificationQuery();
|
|
92
|
+
const memberId = memberVerification.data?.id;
|
|
93
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
94
|
+
kyc: ctx.kyc,
|
|
95
|
+
kycReminder: ctx.kycReminder,
|
|
96
|
+
})));
|
|
97
|
+
const form = useForm({
|
|
98
|
+
resolver: zodResolver(formSchema),
|
|
99
|
+
defaultValues: {
|
|
100
|
+
idFrontImage: '',
|
|
101
|
+
selfieImage: '',
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
async function onSubmit(values) {
|
|
105
|
+
if (!memberId) {
|
|
106
|
+
createMemberVerification({
|
|
107
|
+
selfieImage: values.selfieImage,
|
|
108
|
+
idFrontImage: values.idFrontImage,
|
|
109
|
+
address: '',
|
|
110
|
+
nationality: '',
|
|
111
|
+
natureOfWork: '',
|
|
112
|
+
permanentAddress: '',
|
|
113
|
+
placeOfBirth: '',
|
|
114
|
+
sourceOfIncome: '',
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
updateMemberVerification({
|
|
119
|
+
id: memberId,
|
|
120
|
+
data: {
|
|
121
|
+
selfieImage: values.selfieImage,
|
|
122
|
+
idFrontImage: values.idFrontImage,
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
useEffect(() => {
|
|
128
|
+
if (kyc.selfieImageId)
|
|
129
|
+
form.setValue('selfieImage', kyc.selfieImageId);
|
|
130
|
+
if (kyc.idFrontImageId)
|
|
131
|
+
form.setValue('idFrontImage', kyc.idFrontImageId);
|
|
132
|
+
}, [form, kyc.idFrontImageId, kyc.selfieImageId]);
|
|
133
|
+
return (_jsxs("div", { children: [_jsx(Dialog.Title, { className: "text-center font-semibold text-lg", children: "Verify your identity" }), _jsx(Dialog.Description, { className: "mt-xs text-center text-sm text-text-secondary-700", children: "Verify your details to confirm your identity and secure your access." }), _jsxs("div", { className: "mt-7 rounded-xl border border-border-primary bg-bg-primary p-lg text-text-placeholder text-xs leading-tight", children: [_jsx("h3", { className: "font-semibold", children: "Instructions" }), _jsxs("ol", { className: "mt-2 list-inside list-decimal", children: [_jsx("li", { children: "Upload a full photo of your ID." }), _jsx("li", { children: "Please ensure that all details in the uploaded image are legible." }), _jsx("li", { children: "Please ensure that the ID uploaded is within the validity period." })] })] }), _jsxs("form", { className: "mt-xl", onSubmit: form.handleSubmit(onSubmit), children: [_jsx(Controller, { control: form.control, name: "idFrontImage", render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, children: [_jsx(Field.Label, { children: "Front of your ID" }), _jsx(IdFrontImageField, { value: o.field.value, onChange: o.field.onChange, onError: (error) => {
|
|
134
|
+
form.setValue('idFrontImage', '');
|
|
135
|
+
form.setError('idFrontImage', {
|
|
136
|
+
type: 'validate',
|
|
137
|
+
message: error.message,
|
|
138
|
+
});
|
|
139
|
+
} }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsx(Controller, { control: form.control, name: "selfieImage", render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, className: "mt-3", children: [_jsx(Field.Label, { children: "Selfie holding your ID" }), _jsx(SelfieImageField, { value: o.field.value, onChange: o.field.onChange, onError: (error) => {
|
|
140
|
+
form.setValue('selfieImage', '');
|
|
141
|
+
form.setError('selfieImage', {
|
|
142
|
+
type: 'validate',
|
|
143
|
+
message: error.message,
|
|
144
|
+
});
|
|
145
|
+
} }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-6", disabled: createPending || updatePending, children: "Continue" }), kyc.isSkippable && (_jsx(Button, { variant: "outline", colorScheme: "gray", className: "mt-lg", type: "button", onClick: () => {
|
|
146
|
+
globalStore.kyc.setOpen(false);
|
|
147
|
+
globalStore.kycReminder.setOpen(true);
|
|
148
|
+
}, children: "Skip for now" })), _jsx(Button, { className: "bg-transparent text-text-brand-primary-600", onClick: async () => {
|
|
149
|
+
if (Capacitor.isNativePlatform()) {
|
|
150
|
+
const session = await getQueryClient().fetchQuery({
|
|
151
|
+
queryKey: getSessionQueryKey(),
|
|
152
|
+
queryFn: async () => getSession(),
|
|
153
|
+
});
|
|
154
|
+
invariant(session.status === 'authenticated');
|
|
155
|
+
await unregisterFCMDevice({
|
|
156
|
+
type: ['IOS', 'ANDROID'],
|
|
157
|
+
}, {
|
|
158
|
+
headers: {
|
|
159
|
+
Authorization: `Bearer ${session.token}`,
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
signOutMutation.mutate();
|
|
164
|
+
router.push('/');
|
|
165
|
+
}, children: "Log Out" })] })] }));
|
|
166
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Indicator(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { noop } from 'lodash-es';
|
|
3
|
+
import { Progress } from '../../../ui/Progress/index.js';
|
|
4
|
+
import { useKYCNonPagcorContext } from './KYCNonPagcorContext.js';
|
|
5
|
+
export function Indicator() {
|
|
6
|
+
const kyc = useKYCNonPagcorContext();
|
|
7
|
+
return (_jsxs("div", { className: "flex items-center justify-center gap-1.5 py-3", children: [_jsx(Progress.Root, { className: "w-10 shrink-0", value: kyc.step >= 1 ? 100 : 0, onValueChange: noop, children: _jsx(Progress.Track, { className: "bg-bg-primary-hover", children: _jsx(Progress.Range, {}) }) }), _jsx(Progress.Root, { className: "w-10 shrink-0", value: kyc.step === 2 ? 100 : 0, onValueChange: noop, children: _jsx(Progress.Track, { className: "bg-bg-primary-hover", children: _jsx(Progress.Range, {}) }) })] }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ImageProps } from 'next/image';
|
|
2
|
+
import { type KYCReminderProps } from '../KYCReminder';
|
|
3
|
+
export interface KYCNonPagcorProps extends KYCReminderProps {
|
|
4
|
+
provider: 'unregulated';
|
|
5
|
+
logo: ImageProps['src'];
|
|
6
|
+
isSkippable?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function KYCNonPagcor(props: KYCNonPagcorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import Image from 'next/image';
|
|
3
|
+
import { useShallow } from 'zustand/shallow';
|
|
4
|
+
import { useGlobalStore } from '../../../client/hooks/useGlobalStore.js';
|
|
5
|
+
import { useSessionQuery } from '../../../client/hooks/useSessionQuery.js';
|
|
6
|
+
import { Dialog } from '../../../ui/Dialog/index.js';
|
|
7
|
+
import { Portal } from '../../../ui/Portal/index.js';
|
|
8
|
+
import { KYCReminder } from '../KYCReminder.js';
|
|
9
|
+
import { IdentityVerification } from './IdentityVerification.js';
|
|
10
|
+
import { Indicator } from './Indicator.js';
|
|
11
|
+
import { KYCNonPagcorContext } from './KYCNonPagcorContext.js';
|
|
12
|
+
import { PersonalInformation } from './PersonalInformation.js';
|
|
13
|
+
import { useKYCNonPagCor } from './useKYCNonPagCor.js';
|
|
14
|
+
export function KYCNonPagcor(props) {
|
|
15
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
16
|
+
kyc: ctx.kyc,
|
|
17
|
+
kycReminder: ctx.kycReminder,
|
|
18
|
+
responsibleGamingReminder: ctx.responsibleGamingReminder,
|
|
19
|
+
})));
|
|
20
|
+
const kyc = useKYCNonPagCor(props?.isSkippable ?? false);
|
|
21
|
+
const { isLoading: sessionLoading } = useSessionQuery();
|
|
22
|
+
const isDialogOpen = !globalStore.kycReminder.open && globalStore.kyc.open && !sessionLoading;
|
|
23
|
+
return (_jsxs(_Fragment, { children: [_jsx(KYCNonPagcorContext, { value: kyc, children: _jsx(Dialog.Root, { open: isDialogOpen, onOpenChange: (details) => {
|
|
24
|
+
globalStore.kyc.setOpen(details.open);
|
|
25
|
+
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: kyc.reset, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { className: "fixed top-[57px] overflow-hidden", children: _jsx(Dialog.Content, { className: "mx-auto h-full w-full overflow-y-auto bg-bg-primary-alt md:max-h-[95vh] lg:w-fit", children: _jsxs("div", { className: "mt-[calc(var(--safe-area-inset-top)*3)] flex h-dvh w-full flex-col overflow-y-auto p-3xl sm:h-fit lg:w-[400px]", children: [_jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto mb-5 block h-7.5 w-auto", draggable: false }), _jsx(Indicator, {}), kyc.step === 1 && _jsx(PersonalInformation, {}), kyc.step === 2 && _jsx(IdentityVerification, {})] }) }) })] }) }) }), _jsx(KYCReminder, { ...props })] }));
|
|
26
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { UseKycNonPagcorReturn } from './useKYCNonPagCor';
|
|
2
|
+
export declare const KYCNonPagcorContext: (props: {
|
|
3
|
+
value: UseKycNonPagcorReturn;
|
|
4
|
+
} & {
|
|
5
|
+
children?: import("react").ReactNode | undefined;
|
|
6
|
+
}) => React.ReactNode, useKYCNonPagcorContext: () => UseKycNonPagcorReturn;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function KYCVerificationStatus(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import dynamic from 'next/dynamic';
|
|
4
|
+
const Component = dynamic(() => import('./KYCVerificationStatus.lazy.js').then((m) => m.KYCVerificationStatus), {
|
|
5
|
+
ssr: false,
|
|
6
|
+
loading: () => null,
|
|
7
|
+
});
|
|
8
|
+
export function KYCVerificationStatus() {
|
|
9
|
+
return _jsx(Component, {});
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function KYCVerificationStatus(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Image from 'next/image';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { useShallow } from 'zustand/shallow';
|
|
5
|
+
import { useGlobalStore } from '../../../client/hooks/useGlobalStore.js';
|
|
6
|
+
import { useMemberVerificationQuery } from '../../../client/hooks/useMemberVerificationQuery.js';
|
|
7
|
+
import alertIcon from '../../../images/kyc-verification-status/alert-icon.png';
|
|
8
|
+
import bellIcon from '../../../images/kyc-verification-status/bell-icon.png';
|
|
9
|
+
import { Button } from '../../../ui/Button/index.js';
|
|
10
|
+
import { Dialog } from '../../../ui/Dialog/index.js';
|
|
11
|
+
import { Portal } from '../../../ui/Portal/index.js';
|
|
12
|
+
export function KYCVerificationStatus() {
|
|
13
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
14
|
+
kycVerificationStatus: ctx.kycVerificationStatus,
|
|
15
|
+
kyc: ctx.kyc,
|
|
16
|
+
depositWithdrawal: ctx.depositWithdrawal,
|
|
17
|
+
})));
|
|
18
|
+
const verificationQuery = useMemberVerificationQuery();
|
|
19
|
+
const status = verificationQuery.data?.status ?? 'UNVERIFIED';
|
|
20
|
+
const isUnverified = verificationQuery?.data === null ||
|
|
21
|
+
status === 'UNVERIFIED' ||
|
|
22
|
+
status === 'CREATED';
|
|
23
|
+
const icons = status === 'PENDING' ? bellIcon : alertIcon;
|
|
24
|
+
return (_jsx(Dialog.Root, { open: globalStore.kycVerificationStatus.open, onOpenChange: (details) => {
|
|
25
|
+
globalStore.kycVerificationStatus.setOpen(details.open);
|
|
26
|
+
}, 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: _jsx(Dialog.Content, { className: "mx-auto h-fit w-[450px] overflow-y-auto rounded-lg bg-bg-primary", children: _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mb-3xl grid h-[200px] w-full place-items-center rounded-xl bg-radial from-40% from-button-primary-bg to-bg-brand-solid", children: _jsx(Image, { src: icons, alt: "icon", width: 240, height: 0, className: "w-60 object-contain", draggable: false }) }), _jsxs("h1", { className: "font-semibold text-lg text-white", children: [status === 'PENDING' && 'Verification in Progress', status === 'REJECTED' && 'Verification Rejected', isUnverified && 'Verification Required'] }), _jsxs("p", { className: "mb-4xl text-[#94969C] text-base", children: [status === 'PENDING' &&
|
|
27
|
+
`Your account verification is still under review. Please wait
|
|
28
|
+
until it's approved before you can continue playing or
|
|
29
|
+
depositing.`, status === 'REJECTED' &&
|
|
30
|
+
'Your account verification was not approved. Please resubmit your verification to regain full access.', isUnverified &&
|
|
31
|
+
'Your account is not yet verified. Please complete the verification process to continue playing or depositing.'] }), _jsxs(Button, { variant: "solid", className: twMerge('mb-2 w-full', status === 'PENDING' && 'hidden'), onClick: () => {
|
|
32
|
+
globalStore.kycVerificationStatus.setOpen(false);
|
|
33
|
+
globalStore.depositWithdrawal.setOpen(false);
|
|
34
|
+
globalStore.kyc.setOpen(true);
|
|
35
|
+
}, children: [status === 'REJECTED' && 'Resubmit Verification', isUnverified && 'Verify Now'] }), _jsx(Button, { type: "button", variant: "outline", onClick: () => {
|
|
36
|
+
globalStore.kycVerificationStatus.setOpen(false);
|
|
37
|
+
}, children: "Close" })] }) }) })] }) }));
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function PersonalInformation(): import("react/jsx-runtime").JSX.Element;
|