@opexa/portal-components 0.0.959 → 0.0.960
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/hooks/useCamera.d.ts +1 -1
- package/dist/client/hooks/useCamera.js +22 -66
- package/dist/components/AccountInfo/AccountInfo.js +1 -1
- package/dist/components/AccountSecurity/AccountSecurity.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/AiOGCashDeposit/AiOGCashDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/AiOGrabPayDeposit/AiOGrabPayDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/AiOPayMayaDeposit/AiOPayMayaDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/AurixPayGCashDeposit/AurixPayGCashDeposit.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/AurixPayGrabPayDeposit/AurixPayGrabPayDeposit.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayPayMayaDeposit.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/Form.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/Deposit.js +20 -10
- package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/GCashWebpayDeposit/GCashWebpayDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/LibanganDeposit/LibanganDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/MayaWebpayDeposit/MayaWebpayDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/PisoPayDeposit/PisoPayDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/Form.js +1 -1
- package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.d.ts +1 -0
- package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.js +2 -1
- package/dist/components/DepositWithdrawal/Withdrawal/GCashStandardCashInWithdrawal/GCashStandardCashInWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayGCashWithdrawal/InstapayGcashWithdrawal.js +2 -2
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayPaymayaWithdrawal/InstapayPaymayaWithdrawal.js +2 -2
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/VentajaWithdrawal/VentajaWithdrawal.js +1 -1
- package/dist/components/Disclaimer/DisclaimerV3.js +21 -12
- package/dist/components/ForgotPassword/Crazywin/CWForgotPassword.js +1 -1
- package/dist/components/ForgotPassword/Crazywin/CWForgotPasswordForm.js +2 -2
- package/dist/components/ForgotPassword/ForgotPasswordForm.js +3 -3
- package/dist/components/GameProviders/GameProvidersCarousel.d.ts +8 -0
- package/dist/components/GameProviders/GameProvidersCarousel.js +32 -0
- package/dist/components/Games/Game.js +6 -1
- package/dist/components/Jackpots/JackpotsCarouselNext/JackpotsCarouselStageItem.js +1 -1
- package/dist/components/Quests/Crazywin/components/Countdown.js +1 -1
- package/dist/components/SignUp/SignUpKYC/SelfieImageField/useSelfieImageField.js +0 -1
- package/dist/components/TermsOfUse/TermsOfUseV2.lazy.d.ts +1 -1
- package/dist/components/TermsOfUse/TermsOfUseV2.lazy.js +1 -1
- package/dist/components/TermsOfUse/TermsOfUseV3.lazy.d.ts +1 -1
- package/dist/components/TermsOfUse/TermsOfUseV3.lazy.js +1 -1
- package/dist/components/shared/SelfieImageField/useSelfieImageField.js +1 -3
- package/dist/handlers/index.d.ts +2 -2
- package/dist/lib/components/Banner/Banner.test.js +1 -1
- package/dist/lib/components/Disclaimer/Disclaimer.test.js +7 -7
- package/dist/lib/components/Games/Game.js +1 -5
- package/dist/lib/components/SignIn/MobileNumberSignIn.test.js +9 -8
- package/dist/lib/components/SignIn/NameAndPasswordSignIn.test.js +14 -10
- package/dist/lib/components/SignIn/SignIn.test.js +4 -3
- package/dist/schemas/forgotPasswordSchema.d.ts +4 -4
- package/dist/ui/AlertDialog/AlertDialog.d.ts +154 -154
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +14 -14
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Carousel/Carousel.d.ts +72 -72
- package/dist/ui/Carousel/carousel.recipe.d.ts +8 -8
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Dialog/Dialog.d.ts +33 -33
- package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +198 -198
- package/dist/ui/Menu/menu.recipe.d.ts +11 -11
- package/dist/ui/Popover/Popover.d.ts +88 -88
- package/dist/ui/Popover/popover.recipe.d.ts +8 -8
- package/dist/ui/QrCode/QrCode.d.ts +25 -25
- package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/package.json +1 -1
- package/dist/client/hooks/useVerifyMobileNumber.d.ts +0 -3
- package/dist/client/hooks/useVerifyMobileNumber.js +0 -20
- package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.js +0 -241
- package/dist/components/SingleSignOn/SingleSignOn.d.ts +0 -4
- package/dist/components/SingleSignOn/SingleSignOn.js +0 -185
- package/dist/components/SingleSignOn/index.d.ts +0 -1
- package/dist/components/SingleSignOn/index.js +0 -1
|
@@ -8,6 +8,7 @@ import { twMerge } from 'tailwind-merge';
|
|
|
8
8
|
import { useShallow } from 'zustand/shallow';
|
|
9
9
|
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
10
10
|
import { useSessionQuery } from '../../client/hooks/useSessionQuery.js';
|
|
11
|
+
import { useSignOutMutation } from '../../client/hooks/useSignOutMutation.js';
|
|
11
12
|
import { AlertCircleIcon } from '../../icons/AlertCircleIcon.js';
|
|
12
13
|
import { CheckIcon } from '../../icons/CheckIcon.js';
|
|
13
14
|
import pagcorLogo from '../../images/pagcor2.png';
|
|
@@ -30,12 +31,26 @@ export function DisclaimerV3(props) {
|
|
|
30
31
|
const isAuthenticated = sessionQuery.data?.status === 'authenticated';
|
|
31
32
|
const checked = globalStore.termsOfUse.accepted && globalStore.responsibleGaming.accepted;
|
|
32
33
|
const [showWarning, setShowWarning] = useState(false);
|
|
33
|
-
|
|
34
|
+
const signOutMutation = useSignOutMutation();
|
|
35
|
+
const handleExit = () => {
|
|
36
|
+
if (props.redirectUrlOnNoConsent) {
|
|
37
|
+
if (Capacitor.isNativePlatform()) {
|
|
38
|
+
App.exitApp();
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
window.location.href = props.redirectUrlOnNoConsent;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
disclaimer.close();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return (_jsx(Dialog.Root, { open: disclaimer.open, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { "aria-label": `${props.siteName} Player Disclaimer`, "aria-labelledby": "disclaimer-title", "aria-describedby": "disclaimer-description", className: twMerge('flex h-full scrollbar:h-2 scrollbar:w-2 w-full flex-col items-start overflow-y-auto scrollbar-thumb:rounded-full scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent p-3xl lg:mx-auto lg:h-auto lg:max-h-[85vh] lg:w-[500px] lg:rounded-xl'), children: [_jsx("div", { className: "mx-auto h-auto max-w-[120px]", children: _jsx(Image, { src: props.logo, alt: `${props.siteName} logo`, width: 200, height: 100, className: "h-full w-full object-cover", draggable: false, unoptimized: true }) }), _jsxs("div", { className: "my-4 grid w-full grid-cols-2 items-center justify-center gap-3xl", children: [_jsx(Image, { src: props.pagcorLogo ?? pagcorLogo, alt: "PAGCOR logo", height: 50, width: 186, className: "mx-auto h-[43px] w-auto shrink-0 object-contain", draggable: false, unoptimized: true }), _jsx(Image, { src: props.responsibleGamingLogo ?? responsibleGamingLogo, alt: "Responsible Gaming logo", height: 50, width: 186, className: "mx-auto h-[50px] w-auto shrink-0", draggable: false, unoptimized: true })] }), _jsx("div", { className: "w-full text-center font-semibold text-2xl uppercase", id: "disclaimer-title", children: "Notice" }), _jsx("div", { className: "mt-2 mb-1 text-sm text-text-secondary-700", id: "disclaimer-description", children: "By entering this website, you acknowledge and confirm:" }), _jsx("div", { className: "mt-4 w-full grow", children: _jsxs(Dialog.Description, { className: "space-y-4 text-sm", children: [_jsxs("ul", { className: "space-y-1.5 text-left", "aria-label": "Restricted persons list", children: [_jsxs("li", { className: "flex gap-4 text-text-placeholder", children: [_jsx(Circle, {}), "You are 21 years old and above."] }), _jsxs("li", { className: "flex gap-4 text-text-placeholder", children: [_jsx(Circle, {}), "You are not a government official, or employee connected directly with the operation of the Government or any of its agencies, member of the Armed Forces of the Philippines including the Army, Navy, Air Force, or the Philippine Nationa Police."] }), _jsxs("li", { className: "flex gap-4 text-text-placeholder", children: [_jsx(Circle, {}), "You are not included in the PAGCOR's National Database Restricted Persons (NDRP)."] }), _jsxs("li", { className: "flex gap-4 text-text-placeholder", children: [_jsx(Circle, {}), "Funds or credits in the account of player who is found ineligible to play shall mean forfeiture of said funds/credits in favor of the Government."] }), _jsxs("li", { className: "flex gap-4 text-text-placeholder", children: [_jsx(Circle, {}), "You are prohibited from playing in open and public places."] }), _jsxs(Checkbox.Root, { checked: checked, onCheckedChange: (e) => {
|
|
34
49
|
if (e.checked === 'indeterminate')
|
|
35
50
|
return;
|
|
36
51
|
globalStore.termsOfUse.setAccepted(e.checked);
|
|
37
52
|
globalStore.responsibleGaming.setAccepted(e.checked);
|
|
38
|
-
}, className: "pt-2.5 pb-2 text-sm", children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["You agree and read the", ' ', _jsx("button", { type: "button", className: "text-brand-400 underline underline-offset-2", onClick: () => {
|
|
53
|
+
}, className: "pt-2.5 pb-2 text-sm", colorScheme: "neutral", children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["You agree and read the", ' ', _jsx("button", { type: "button", className: "text-brand-400 underline underline-offset-2", onClick: () => {
|
|
39
54
|
globalStore.termsOfUse.setOpen(true);
|
|
40
55
|
globalStore.termsOfUse.setNext('DISCLAIMER');
|
|
41
56
|
disclaimer.close();
|
|
@@ -58,17 +73,11 @@ export function DisclaimerV3(props) {
|
|
|
58
73
|
globalStore.onboarding.setOpen(true);
|
|
59
74
|
}
|
|
60
75
|
}, children: "I Agree" }), _jsx(Button, { type: "button", onClick: () => {
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
window.location.href = props.redirectUrlOnNoConsent;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
disclaimer.close();
|
|
76
|
+
if (isAuthenticated && !checked) {
|
|
77
|
+
signOutMutation.mutate();
|
|
78
|
+
handleExit();
|
|
71
79
|
}
|
|
80
|
+
handleExit();
|
|
72
81
|
}, variant: "outline", children: "Exit" })] })] }) })] }) }));
|
|
73
82
|
}
|
|
74
83
|
const Circle = () => (_jsx("div", { children: _jsx("div", { className: "flex h-4.5 w-4.5 items-center justify-center rounded-full border-[5px] border-brand-400", children: _jsx("div", { className: "h-2 w-2 rounded-full bg-bg-disabled" }) }) }));
|
|
@@ -6,6 +6,6 @@ import { Dialog } from '../../../ui/Dialog/index.js';
|
|
|
6
6
|
import CWForgotPasswordForm from './CWForgotPasswordForm.js';
|
|
7
7
|
import styles from './ForgotPassword.module.css';
|
|
8
8
|
const ForgotPassword = ({ logo }) => {
|
|
9
|
-
return (_jsx(Dialog.Content, { className: "
|
|
9
|
+
return (_jsx(Dialog.Content, { className: "overflow-y-invisible top-0 left-0 flex h-full w-full items-center bg-transparent", children: _jsxs("div", { className: "flex h-[90dvh] w-full flex-col justify-center scroll-smooth", children: [_jsxs("div", { className: "relative mx-auto w-full max-w-[22.5rem]", children: [_jsx(Image, { src: logo, alt: "", width: 200, height: 100, className: "mx-auto mt-8 h-auto w-[12.04544rem]", draggable: false }), _jsx(Dialog.CloseTrigger, { className: 'h-fit w-fit rounded-md bg-gradient-to-t from-[#FFE5AF] to-[#EAC467] p-0.5 text-[#6C5200]', children: _jsx(XIcon, {}) })] }), _jsx("h2", { className: "mx-auto mt-10 w-fit bg-[linear-gradient(50deg,#c7802d_-5.1%,#ffe585_44.95%,#c7802d_109.05%)] bg-clip-text font-bold text-2xl text-transparent uppercase", children: "Forgot Password" }), _jsx("div", { className: twMerge('mx-auto mt-7.5 max-w-[20.6875rem] p-7.5', styles.card), children: _jsx(CWForgotPasswordForm, {}) })] }) }));
|
|
10
10
|
};
|
|
11
11
|
export default ForgotPassword;
|
|
@@ -59,7 +59,7 @@ const CWForgotPasswordForm = () => {
|
|
|
59
59
|
verificationCode: data.verificationCode,
|
|
60
60
|
});
|
|
61
61
|
};
|
|
62
|
-
return (_jsx("form", { autoComplete: 'off', onSubmit: handleSubmit(onSubmit), children: _jsxs("div", { className: "space-y-4", children: [_jsxs(Field.Root, { invalid: !!errors.mobileNumber, children: [_jsx(Field.Label, { className: "text-xs", children: "Phone Number" }), _jsxs("div", { className: "relative flex h-10 gap-3", children: [_jsxs("div", { className: "flex h-full items-center gap-2 rounded-full bg-black/40 px-3.5 text-xs", children: [_jsx(localeInfo.country.flag, { className: "size-5" }), _jsx("span", { className: "text-text-placeholder", children: localeInfo.mobileNumber.areaCode })] }), _jsx(Field.Input, { className: commonInputClass, placeholder: "Enter Phone Number", ...register('mobileNumber') })] }), _jsx(Field.ErrorText, { className: "text-[#ff2525b3] text-xs", children: errors.mobileNumber?.message })] }), _jsx(Field.Root, { invalid: !!errors.password, children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { className: "text-xs", children: "Password" }), _jsxs("div", { children: [_jsxs(PasswordInput.Control, { className: "relative flex h-10 items-center rounded-full
|
|
62
|
+
return (_jsx("form", { autoComplete: 'off', onSubmit: handleSubmit(onSubmit), children: _jsxs("div", { className: "space-y-4", children: [_jsxs(Field.Root, { invalid: !!errors.mobileNumber, children: [_jsx(Field.Label, { className: "text-xs", children: "Phone Number" }), _jsxs("div", { className: "relative flex h-10 gap-3", children: [_jsxs("div", { className: "flex h-full items-center gap-2 rounded-full bg-black/40 px-3.5 text-xs", children: [_jsx(localeInfo.country.flag, { className: "size-5" }), _jsx("span", { className: "text-text-placeholder", children: localeInfo.mobileNumber.areaCode })] }), _jsx(Field.Input, { className: commonInputClass, placeholder: "Enter Phone Number", ...register('mobileNumber') })] }), _jsx(Field.ErrorText, { className: "text-[#ff2525b3] text-xs", children: errors.mobileNumber?.message })] }), _jsx(Field.Root, { invalid: !!errors.password, children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { className: "text-xs", children: "Password" }), _jsxs("div", { children: [_jsxs(PasswordInput.Control, { className: "relative flex h-10 items-center rounded-full border-0 bg-black/40 text-xs", children: [_jsx(Image, { src: lockIcon, alt: "lock icon", width: 20, height: 20, className: "-translate-y-1/2 pointer-events-none absolute top-1/2 left-3 h-5 w-5" }), _jsx(PasswordInput.Input, { className: "pl-10", placeholder: "8 - 20 characters", ...register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, { className: "text-white/50" }), asChild: true, children: _jsx(EyeIcon, { className: "text-white/50" }) }) })] }), _jsx(Field.ErrorText, { className: "text-[#ff2525b3] text-xs", children: errors.password?.message })] })] }) }), _jsx(Field.Root, { invalid: !!errors.confirmPassword, children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { className: "text-xs", children: "Confirm Password" }), _jsxs("div", { children: [_jsxs(PasswordInput.Control, { className: "relative flex h-10 items-center rounded-full border-0 bg-black/40 text-xs", children: [_jsx(Image, { src: lockIcon, alt: "lock icon", width: 20, height: 20, className: "-translate-y-1/2 pointer-events-none absolute top-1/2 left-3 h-5 w-5" }), _jsx(PasswordInput.Input, { className: "pl-10", placeholder: "8 - 20 characters", ...register('confirmPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, { className: "text-white/50" }), asChild: true, children: _jsx(EyeIcon, { className: "text-white/50" }) }) })] }), _jsx(Field.ErrorText, { className: "text-[#ff2525b3] text-xs", children: errors.confirmPassword?.message })] })] }) }), _jsxs(Field.Root, { invalid: !!errors.verificationCode, children: [_jsx(Field.Label, { className: "text-xs", children: "OTP Code" }), _jsxs("div", { className: "relative", children: [_jsx(Field.Input, { className: twMerge(commonInputClass, 'pr-[5.75rem]'), placeholder: "Enter OTP Code", ...register('verificationCode') }), _jsx(Button, { type: "button", className: "-translate-y-1/2 absolute top-1/2 right-1 h-fit w-fit rounded-full bg-[linear-gradient(89deg,#c7802d_-15.91%,#ffe585_28.75%,#ffeca6_49.46%,#c7802d_112.69%)] py-[0.375rem] text-sm shadow-[inset_0px_-1px_2px_1px_#fff7e1]", disabled: !mobileNumberValue || !!errors.mobileNumber || cooldown.cooling, onClick: async () => {
|
|
63
63
|
if (!cooldown.cooling) {
|
|
64
64
|
await sendVerificationCodeMutation.mutateAsync({
|
|
65
65
|
channel: 'SMS',
|
|
@@ -70,6 +70,6 @@ const CWForgotPasswordForm = () => {
|
|
|
70
70
|
description: `OTP sent to ${getValues('mobileNumber')}`
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
}, children: cooldown.cooling ? cooldown.countdown : 'Get OTP' })] }), _jsx(Field.ErrorText, { className: "text-[#ff2525b3] text-xs", children: errors.verificationCode?.message })] }), _jsx(Button, { type: "submit", className: "mt-7.5
|
|
73
|
+
}, children: cooldown.cooling ? cooldown.countdown : 'Get OTP' })] }), _jsx(Field.ErrorText, { className: "text-[#ff2525b3] text-xs", children: errors.verificationCode?.message })] }), _jsx(Button, { type: "submit", className: "mt-7.5 rounded-full bg-[linear-gradient(89deg,#c7802d_-15.91%,#ffe585_28.75%,#ffeca6_49.46%,#c7802d_112.69%)] text-sm shadow-[inset_0px_-1px_2px_1px_#fff7e1]", fullWidth: true, disabled: !isValid || !isDirty, children: "Change Password" })] }) }));
|
|
74
74
|
};
|
|
75
75
|
export default CWForgotPasswordForm;
|
|
@@ -113,9 +113,9 @@ export function ForgotPasswordForm({ layout }) {
|
|
|
113
113
|
newPassword: step1Form.getValues('newPassword'),
|
|
114
114
|
verificationCode: step1Form.getValues('verificationCode'),
|
|
115
115
|
});
|
|
116
|
-
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { className: 'text-[#344054] dark:text-[#CECFD2]', children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "-translate-y-1/2 absolute top-1/2 left-3.5 flex shrink-0 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, { className: '
|
|
116
|
+
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { className: 'text-[#344054] dark:text-[#CECFD2]', children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "-translate-y-1/2 absolute top-1/2 left-3.5 flex shrink-0 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, { className: 'border-[#D0D5DD] bg-transparent dark:border-[#333741]', style: {
|
|
117
117
|
paddingLeft: `calc(2.75rem + ${localeInfo.mobileNumber.areaCode.length}ch)`,
|
|
118
|
-
}, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsx(Field.Root, { invalid: !!step1Form.formState.errors.newPassword, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { className: 'text-[#344054] dark:text-[#CECFD2]', children: "New Password" }), _jsxs(PasswordInput.Control, { className: '
|
|
118
|
+
}, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsx(Field.Root, { invalid: !!step1Form.formState.errors.newPassword, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { className: 'text-[#344054] dark:text-[#CECFD2]', children: "New Password" }), _jsxs(PasswordInput.Control, { className: 'border-[#D0D5DD] bg-transparent dark:border-[#333741]', children: [_jsx(PasswordInput.Input, { placeholder: "Enter your new password", ...step1Form.register('newPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.newPassword?.message })] }) }), _jsx(Field.Root, { invalid: !!step1Form.formState.errors.confirmPassword, className: "mt-xl bg-transparent", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { className: 'text-[#344054] dark:text-[#CECFD2]', children: "Confirm Password" }), _jsxs(PasswordInput.Control, { className: 'border-[#D0D5DD] bg-transparent dark:border-[#333741]', children: [_jsx(PasswordInput.Input, { placeholder: "Confirm new password", ...step1Form.register('confirmPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.confirmPassword?.message })] }) }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.verificationCode, className: "mt-xl bg-transparent", children: [_jsx(Field.Label, { className: 'text-[#344054] dark:text-[#CECFD2]', children: "OTP Code" }), _jsxs("div", { className: "grid grid-cols-[1fr_104px] gap-2", children: [_jsx(Field.Input, { placeholder: "Enter OTP Code", ...step1Form.register('verificationCode'), className: 'border-[#D0D5DD] bg-transparent dark:border-[#333741]' }), _jsx(Button, { variant: 'outline', className: 'bg-transparent', type: 'button', disabled: !mobileNumberValue || !!step1Form.formState.errors.mobileNumber || cooldown.cooling, onClick: async () => {
|
|
119
119
|
if (!cooldown.cooling) {
|
|
120
120
|
try {
|
|
121
121
|
await sendVerificationCodeMutation.mutateAsync({
|
|
@@ -132,7 +132,7 @@ export function ForgotPasswordForm({ layout }) {
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
}, children: cooldown.cooling ? cooldown.countdown
|
|
135
|
+
}, children: cooldown.cooling ? `${cooldown.countdown} sec` : 'Get OTP' })] }), _jsx(Field.ErrorText, { className: "text-[#ff2525b3] text-xs", children: step1Form.formState.errors.verificationCode?.message })] }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting || !step1Form.formState.isValid || !step1Form.formState.isDirty, children: "Set up New Password" })] })] }));
|
|
136
136
|
}
|
|
137
137
|
return (_jsxs(_Fragment, { children: [step === 1 && (_jsxs(_Fragment, { children: [Header[step], _jsxs("form", { className: "mt-3xl", onSubmit: step1Form.handleSubmit(async (data) => {
|
|
138
138
|
try {
|
|
@@ -8,10 +8,18 @@ export interface ClassNameEntries {
|
|
|
8
8
|
thumbnailContainer?: string;
|
|
9
9
|
thumbnailRootContainer?: string;
|
|
10
10
|
}
|
|
11
|
+
export interface ActiveProvider {
|
|
12
|
+
activeProvider?: GameProvider | string;
|
|
13
|
+
jump?: boolean;
|
|
14
|
+
}
|
|
11
15
|
export interface GameProvidersCarouselProps {
|
|
12
16
|
layout: 'carousel';
|
|
13
17
|
gameProviders: GameProvider[];
|
|
14
18
|
heading?: string | ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Scrolls the carousel to the matching provider id or slug on load.
|
|
21
|
+
*/
|
|
22
|
+
scrollProvider?: ActiveProvider;
|
|
15
23
|
/**
|
|
16
24
|
* @default '/providers'
|
|
17
25
|
*/
|
|
@@ -56,9 +56,41 @@ export function GameProvidersCarousel({ hasSeeAll = true, ...props }) {
|
|
|
56
56
|
? [...props.gameProviders, ...(props.futureGameProviders ?? [])]
|
|
57
57
|
: props.gameProviders, [enabled, props.gameProviders, props.futureGameProviders]);
|
|
58
58
|
const gameProviders = useMemo(() => combinedProviders.map((provider) => GAME_PROVIDER_DATA[provider]), [combinedProviders]);
|
|
59
|
+
const resolvedActiveProvider = props.scrollProvider?.activeProvider;
|
|
60
|
+
const shouldJump = props.scrollProvider?.jump ?? false;
|
|
61
|
+
const activeProviderIndex = useMemo(() => {
|
|
62
|
+
if (!resolvedActiveProvider)
|
|
63
|
+
return -1;
|
|
64
|
+
return gameProviders.findIndex((provider) => provider.id === resolvedActiveProvider ||
|
|
65
|
+
provider.slug === resolvedActiveProvider);
|
|
66
|
+
}, [gameProviders, resolvedActiveProvider]);
|
|
59
67
|
const classNames = useMemo(() => isString(props.className)
|
|
60
68
|
? { root: props.className }
|
|
61
69
|
: (props.className ?? {}), [props.className]);
|
|
70
|
+
const getSlidesToScroll = useCallback(() => {
|
|
71
|
+
const desktopSlidesToScroll = props.carouselOptions?.breakpoints[1024]?.slidesToScroll ?? 6;
|
|
72
|
+
if (typeof window === 'undefined')
|
|
73
|
+
return 3;
|
|
74
|
+
return window.matchMedia('(min-width: 1024px)').matches
|
|
75
|
+
? desktopSlidesToScroll
|
|
76
|
+
: 3;
|
|
77
|
+
}, [props.carouselOptions?.breakpoints]);
|
|
78
|
+
const scrollToActiveProvider = useCallback(() => {
|
|
79
|
+
if (!emblaApi || activeProviderIndex < 0)
|
|
80
|
+
return;
|
|
81
|
+
const slidesToScroll = Math.max(1, getSlidesToScroll());
|
|
82
|
+
const snapIndex = Math.floor(activeProviderIndex / slidesToScroll);
|
|
83
|
+
emblaApi.scrollTo(snapIndex, shouldJump);
|
|
84
|
+
}, [emblaApi, activeProviderIndex, getSlidesToScroll, shouldJump]);
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (!emblaApi || activeProviderIndex < 0)
|
|
87
|
+
return;
|
|
88
|
+
scrollToActiveProvider();
|
|
89
|
+
emblaApi.on('reInit', scrollToActiveProvider);
|
|
90
|
+
return () => {
|
|
91
|
+
emblaApi.off('reInit', scrollToActiveProvider);
|
|
92
|
+
};
|
|
93
|
+
}, [emblaApi, activeProviderIndex, scrollToActiveProvider]);
|
|
62
94
|
return (_jsxs("div", { className: classNames.root, children: [_jsxs("div", { className: "flex items-center", children: [_jsx("h2", { className: "font-semibold text-lg", children: props.heading ?? 'Providers' }), _jsx("div", { className: "grow" }), _jsxs("div", { className: "flex items-center justify-center gap-xl", children: [hasSeeAll && (_jsxs(Link, { href: viewAllUrl, className: "flex gap-sm font-semibold text-button-tertiary-fg text-sm", children: ["See All", _jsx(ChevronRightIcon, { className: "size-5 lg:hidden" })] })), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { variant: "outline", colorScheme: "gray", className: "rounded-r-none border-r-0", onClick: onPrevButtonClick, disabled: prevBtnDisabled, "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsx(Button, { variant: "outline", colorScheme: "gray", className: "rounded-l-none", onClick: onNextButtonClick, disabled: nextBtnDisabled, "aria-label": "Next", children: _jsx(ArrowRightIcon, { className: "size-5" }) })] })] })] }), _jsx("div", { ref: emblaRef, className: twMerge('relative mt-lg overflow-hidden', classNames.thumbnailRootContainer), children: _jsx("div", { className: twMerge('grid auto-cols-[calc((100%-(0.375rem*2))/3)] grid-flow-col grid-rows-1 gap-sm lg:auto-cols-[calc((100%-(0.5rem*5))/6)] lg:gap-md', classNames.thumbnailContainer), children: gameProviders.map((provider) => {
|
|
63
95
|
const url = props.providerUrlMappings
|
|
64
96
|
? (props.providerUrlMappings
|
|
@@ -11,6 +11,7 @@ import { useSessionQuery } from '../../client/hooks/useSessionQuery.js';
|
|
|
11
11
|
import { useUnmarkGameAsFavoriteMutation } from '../../client/hooks/useUnmarkGameAsFavoriteMutation.js';
|
|
12
12
|
import { toaster } from '../../client/utils/toaster.js';
|
|
13
13
|
import { Star01Icon } from '../../icons/Star01Icon.js';
|
|
14
|
+
import RainbowballImg from '../../images/rainbow-ball-online.webp';
|
|
14
15
|
import { getGameImageUrl } from '../../utils/getGameImageUrl.js';
|
|
15
16
|
import { GameLaunchTrigger } from '../GameLaunch/index.js';
|
|
16
17
|
import { BadgeNew } from './BadgeNew.js';
|
|
@@ -88,7 +89,11 @@ function GameImage({ priority }) {
|
|
|
88
89
|
image: game.image,
|
|
89
90
|
}), [game.reference, game.provider, game.image]);
|
|
90
91
|
const [imgSrc, setImgSrc] = useState(initialImageUrl);
|
|
91
|
-
return (_jsx(Image, { src:
|
|
92
|
+
return (_jsx(Image, { src: game.name === 'Rainbow Ball' && game.id === '22wQ1YcMwrBaZH3Mx7'
|
|
93
|
+
? RainbowballImg
|
|
94
|
+
: imgSrc, alt: game.name, width: 200, height: 200, loading: priority ? undefined : 'lazy', priority: priority, unoptimized: true, sizes: "(max-width: 768px) 33vw, 200px", className: twMerge('aspect-square w-full rounded-t-md object-contain', game.name === 'Rainbow Ball' &&
|
|
95
|
+
game.id === '22wQ1YcMwrBaZH3Mx7' &&
|
|
96
|
+
'object-cover'), onError: () => {
|
|
92
97
|
const fallbackThumbnail = props.fallbackThumbnails?.[game.provider];
|
|
93
98
|
if (fallbackThumbnail) {
|
|
94
99
|
setImgSrc(fallbackThumbnail);
|
|
@@ -25,7 +25,7 @@ import { maskFirstLast } from '../../../utils/mask.js';
|
|
|
25
25
|
import styles from '../Jackpots.module.css';
|
|
26
26
|
import { useJackpotsCarouselItemContext } from './JackpotsCarouselContext.js';
|
|
27
27
|
export function JackpotsCarouselStageItem({ style, className, viewAllUrl, animate = true, customJackpotStageChest, medalImage, jackpotProfileShape = 'oval', }) {
|
|
28
|
-
const [ref,
|
|
28
|
+
const [ref, _inView] = useIntersectionObserver({
|
|
29
29
|
threshold: 0.75,
|
|
30
30
|
});
|
|
31
31
|
const jackpot = useJackpotsCarouselItemContext();
|
|
@@ -6,4 +6,4 @@ export interface TermsOfUseV2Props {
|
|
|
6
6
|
siteName: string;
|
|
7
7
|
responsibleGamingLogo?: ImageProps['src'];
|
|
8
8
|
}
|
|
9
|
-
export declare function TermsOfUseV2({ logo,
|
|
9
|
+
export declare function TermsOfUseV2({ logo, content }: TermsOfUseV2Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,7 +9,7 @@ import { ScrollToTopIcon } from '../../icons/ScrollToTopIcon.js';
|
|
|
9
9
|
import { Button } from '../../ui/Button/index.js';
|
|
10
10
|
import { Dialog } from '../../ui/Dialog/index.js';
|
|
11
11
|
import { Portal } from '../../ui/Portal/index.js';
|
|
12
|
-
export function TermsOfUseV2({ logo,
|
|
12
|
+
export function TermsOfUseV2({ logo, content }) {
|
|
13
13
|
const scrollableContentRef = useRef(null);
|
|
14
14
|
const [hasReachedBottom, setHasReachedBottom] = useState(false);
|
|
15
15
|
const [isAtBottom, setIsAtBottom] = useState(false);
|
|
@@ -6,4 +6,4 @@ export interface TermsOfUseV3Props {
|
|
|
6
6
|
siteName: string;
|
|
7
7
|
responsibleGamingLogo?: ImageProps['src'];
|
|
8
8
|
}
|
|
9
|
-
export declare function TermsOfUseV3({ logo,
|
|
9
|
+
export declare function TermsOfUseV3({ logo, content }: TermsOfUseV3Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,7 +10,7 @@ import decorativebackground from '../../images/decorative-patern.png';
|
|
|
10
10
|
import { Button } from '../../ui/Button/index.js';
|
|
11
11
|
import { Dialog } from '../../ui/Dialog/index.js';
|
|
12
12
|
import { Portal } from '../../ui/Portal/index.js';
|
|
13
|
-
export function TermsOfUseV3({ logo,
|
|
13
|
+
export function TermsOfUseV3({ logo, content }) {
|
|
14
14
|
const scrollableContentRef = useRef(null);
|
|
15
15
|
const [hasReachedBottom, setHasReachedBottom] = useState(false);
|
|
16
16
|
const [isAtBottom, setIsAtBottom] = useState(false);
|
|
@@ -2,7 +2,7 @@ import { useFieldContext } from '@ark-ui/react';
|
|
|
2
2
|
import { FaceDetector, FilesetResolver } from '@mediapipe/tasks-vision';
|
|
3
3
|
import { useRef, useState } from 'react';
|
|
4
4
|
import invariant from 'tiny-invariant';
|
|
5
|
-
import { useInterval
|
|
5
|
+
import { useInterval } from 'usehooks-ts';
|
|
6
6
|
import { useCamera } from '../../../client/hooks/useCamera.js';
|
|
7
7
|
import { useControllableState } from '../../../client/hooks/useControllableState.js';
|
|
8
8
|
import { useDisclosure } from '../../../client/hooks/useDisclosure.js';
|
|
@@ -11,7 +11,6 @@ import { useUploadPrivateImageFileMutation } from '../../../client/hooks/useUplo
|
|
|
11
11
|
import { toaster } from '../../../client/utils/toaster.js';
|
|
12
12
|
export function useSelfieImageField(props) {
|
|
13
13
|
const field = useFieldContext();
|
|
14
|
-
const desktop = useMediaQuery('(min-width: 1024px)');
|
|
15
14
|
const [value, setValue] = useControllableState({
|
|
16
15
|
value: props.value,
|
|
17
16
|
defaultValue: props.defaultValue ?? '',
|
|
@@ -88,7 +87,6 @@ export function useSelfieImageField(props) {
|
|
|
88
87
|
invariant(blob);
|
|
89
88
|
resolve(new File([blob], `front-image-${Date.now()}.jpeg`, {
|
|
90
89
|
type: 'image/jpeg',
|
|
91
|
-
endings: 'native',
|
|
92
90
|
lastModified: Date.now(),
|
|
93
91
|
}));
|
|
94
92
|
}, 'image/jpeg', 1.0));
|
package/dist/handlers/index.d.ts
CHANGED
|
@@ -18,14 +18,14 @@ export declare const GET: (req: NextRequest, { params }: Context) => Promise<Nex
|
|
|
18
18
|
__error?: unknown;
|
|
19
19
|
} | {
|
|
20
20
|
ok: true;
|
|
21
|
-
data:
|
|
21
|
+
data: Record<string, unknown>;
|
|
22
22
|
}> | NextResponse<{
|
|
23
23
|
ok: false;
|
|
24
24
|
message: string;
|
|
25
25
|
__error?: unknown;
|
|
26
26
|
} | {
|
|
27
27
|
ok: true;
|
|
28
|
-
data:
|
|
28
|
+
data: import("../types").Session;
|
|
29
29
|
}>>;
|
|
30
30
|
export declare const DELETE: (req: NextRequest, { params }: Context) => Promise<NextResponse<{
|
|
31
31
|
ok: true;
|
|
@@ -52,7 +52,7 @@ describe('Banner', () => {
|
|
|
52
52
|
expect(link2).toHaveAttribute('href', '/link2');
|
|
53
53
|
});
|
|
54
54
|
it('renders plain div for banners without redirectUrl', () => {
|
|
55
|
-
|
|
55
|
+
render(_jsx(Banner, { banners: mockBanners }));
|
|
56
56
|
// The 3rd banner image (index 2) should be present
|
|
57
57
|
const image3 = screen.getByTestId('banner-image-2');
|
|
58
58
|
expect(image3).toBeInTheDocument();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { screen, waitFor
|
|
2
|
+
import { fireEvent, screen, waitFor } from '@testing-library/react';
|
|
3
3
|
import userEvent from '@testing-library/user-event';
|
|
4
4
|
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
5
5
|
import { createMockGlobalStore, createMockSessionQuery, createMockSignOutMutation, createMockUseDisclaimer, } from '../../../__tests__/utils/mocks.js';
|
|
@@ -49,16 +49,19 @@ vi.mock('../../images/responsible-gaming-new.png', () => ({
|
|
|
49
49
|
}));
|
|
50
50
|
vi.mock('../../ui/Checkbox', () => {
|
|
51
51
|
const React = require('react');
|
|
52
|
-
const CheckboxContext = React.createContext({
|
|
52
|
+
const CheckboxContext = React.createContext({
|
|
53
|
+
onCheckedChange: (_) => { },
|
|
54
|
+
});
|
|
53
55
|
return {
|
|
54
56
|
Checkbox: {
|
|
55
57
|
Root: ({ children, onCheckedChange }) => (_jsx(CheckboxContext.Provider, { value: { onCheckedChange }, children: _jsx("div", { children: children }) })),
|
|
56
58
|
Control: ({ children }) => _jsx("div", { children: children }),
|
|
57
|
-
Label: ({ children }) => _jsx("label", { children: children }),
|
|
59
|
+
Label: ({ children, htmlFor, ...props }) => (_jsx("label", { htmlFor: htmlFor ?? 'checkbox-input', ...props, children: children })),
|
|
58
60
|
Indicator: ({ children }) => _jsx("div", { children: children }),
|
|
59
61
|
HiddenInput: React.forwardRef((props, ref) => {
|
|
60
62
|
const { onCheckedChange } = React.useContext(CheckboxContext);
|
|
61
|
-
|
|
63
|
+
const id = props.id ?? 'checkbox-input';
|
|
64
|
+
return (_jsx("input", { type: "checkbox", "data-testid": "checkbox-input", id: id, ref: ref, ...props, onChange: (e) => {
|
|
62
65
|
if (onCheckedChange)
|
|
63
66
|
onCheckedChange({ checked: e.target.checked });
|
|
64
67
|
} }));
|
|
@@ -106,7 +109,6 @@ describe('DisclaimerV1', () => {
|
|
|
106
109
|
expect(acceptButton).not.toBeDisabled();
|
|
107
110
|
});
|
|
108
111
|
it('checkbox toggles when clicked', async () => {
|
|
109
|
-
const user = userEvent.setup();
|
|
110
112
|
render(_jsx(DisclaimerV1, { ...defaultProps }));
|
|
111
113
|
const checkbox = screen.getByTestId('checkbox-input');
|
|
112
114
|
fireEvent.click(checkbox);
|
|
@@ -164,7 +166,6 @@ describe('DisclaimerV2', () => {
|
|
|
164
166
|
expect(list.querySelectorAll('li').length).toBeGreaterThan(0);
|
|
165
167
|
});
|
|
166
168
|
it('checkbox controls both termsOfUse and responsibleGaming', async () => {
|
|
167
|
-
const user = userEvent.setup();
|
|
168
169
|
render(_jsx(DisclaimerV2, { ...defaultProps }));
|
|
169
170
|
const checkbox = screen.getByTestId('checkbox-input');
|
|
170
171
|
fireEvent.click(checkbox);
|
|
@@ -228,7 +229,6 @@ describe('DisclaimerV3', () => {
|
|
|
228
229
|
expect(list.querySelectorAll('li').length).toBeGreaterThan(0);
|
|
229
230
|
});
|
|
230
231
|
it('checkbox controls both termsOfUse and responsibleGaming', async () => {
|
|
231
|
-
const user = userEvent.setup();
|
|
232
232
|
render(_jsx(DisclaimerV3, { ...defaultProps }));
|
|
233
233
|
const checkbox = screen.getByTestId('checkbox-input');
|
|
234
234
|
fireEvent.click(checkbox);
|
|
@@ -89,11 +89,7 @@ function GameImage({ priority }) {
|
|
|
89
89
|
image: game.image,
|
|
90
90
|
}), [game.reference, game.provider, game.image]);
|
|
91
91
|
const [imgSrc, setImgSrc] = useState(initialImageUrl);
|
|
92
|
-
return (_jsx(Image, { src: game.name === 'Rainbow Ball'
|
|
93
|
-
? RainbowballImg
|
|
94
|
-
: imgSrc, alt: game.name, width: 200, height: 200, loading: priority ? undefined : 'lazy', priority: priority, unoptimized: true, sizes: "(max-width: 768px) 33vw, 200px", className: twMerge('aspect-square w-full rounded-t-md object-contain', game.name === 'Rainbow Ball' &&
|
|
95
|
-
game.id === '22wQ1YcMwrBaZH3Mx7' &&
|
|
96
|
-
'object-cover'), onError: () => {
|
|
92
|
+
return (_jsx(Image, { src: game.name === 'Rainbow Ball' ? RainbowballImg : imgSrc, alt: game.name, width: 200, height: 200, loading: priority ? undefined : 'lazy', priority: priority, unoptimized: true, sizes: "(max-width: 768px) 33vw, 200px", className: twMerge('aspect-square w-full rounded-t-md object-contain', game.name === 'Rainbow Ball' && 'object-cover'), onError: () => {
|
|
97
93
|
const fallbackThumbnail = props.fallbackThumbnails?.[game.provider];
|
|
98
94
|
if (fallbackThumbnail) {
|
|
99
95
|
setImgSrc(fallbackThumbnail);
|
|
@@ -42,10 +42,10 @@ vi.mock('next/navigation', () => ({
|
|
|
42
42
|
}));
|
|
43
43
|
// Mock external components
|
|
44
44
|
vi.mock('./GoogleSignInTrigger', () => ({
|
|
45
|
-
GoogleSignInTrigger: () => _jsx("button", { children: "Google Sign In" }),
|
|
45
|
+
GoogleSignInTrigger: () => _jsx("button", { type: "button", children: "Google Sign In" }),
|
|
46
46
|
}));
|
|
47
47
|
vi.mock('../../FacebookSignInTrigger', () => ({
|
|
48
|
-
FacebookSignInTrigger: () => _jsx("button", { children: "Facebook Sign In" }),
|
|
48
|
+
FacebookSignInTrigger: () => _jsx("button", { type: "button", children: "Facebook Sign In" }),
|
|
49
49
|
}));
|
|
50
50
|
vi.mock('../../ui/Checkbox', () => {
|
|
51
51
|
const React = require('react');
|
|
@@ -54,11 +54,12 @@ vi.mock('../../ui/Checkbox', () => {
|
|
|
54
54
|
Checkbox: {
|
|
55
55
|
Root: ({ children, onCheckedChange }) => (_jsx(CheckboxContext.Provider, { value: { onCheckedChange }, children: _jsx("div", { children: children }) })),
|
|
56
56
|
Control: ({ children }) => _jsx("div", { children: children }),
|
|
57
|
-
Label: ({ children }) => _jsx("label", { children: children }),
|
|
57
|
+
Label: ({ children, htmlFor, ...props }) => (_jsx("label", { htmlFor: htmlFor ?? 'checkbox-input', ...props, children: children })),
|
|
58
58
|
Indicator: ({ children }) => _jsx("div", { children: children }),
|
|
59
59
|
HiddenInput: React.forwardRef((props, ref) => {
|
|
60
60
|
const { onCheckedChange } = React.useContext(CheckboxContext);
|
|
61
|
-
|
|
61
|
+
const id = props.id ?? 'checkbox-input';
|
|
62
|
+
return (_jsx("input", { type: "checkbox", "data-testid": "input-terms", id: id, ref: ref, ...props, onChange: (e) => {
|
|
62
63
|
if (onCheckedChange)
|
|
63
64
|
onCheckedChange({ checked: e.target.checked });
|
|
64
65
|
} }));
|
|
@@ -73,8 +74,8 @@ vi.mock('../../ui/Field', () => {
|
|
|
73
74
|
return {
|
|
74
75
|
Field: {
|
|
75
76
|
Root: ({ children }) => _jsx("div", { children: children }),
|
|
76
|
-
Label: ({ children }) => _jsx("label", { children: children }),
|
|
77
|
-
Input: React.forwardRef((props, ref) => _jsx("input", { "data-testid": `input-${props.name || 'field'}`, ref: ref, ...props })),
|
|
77
|
+
Label: ({ children, htmlFor, ...props }) => (_jsx("label", { htmlFor: htmlFor ?? props.name ?? 'field', ...props, children: children })),
|
|
78
|
+
Input: React.forwardRef((props, ref) => (_jsx("input", { "data-testid": `input-${props.name || 'field'}`, id: props.id ?? props.name ?? 'field', ref: ref, ...props }))),
|
|
78
79
|
ErrorText: ({ children }) => _jsx("div", { children: children }),
|
|
79
80
|
},
|
|
80
81
|
};
|
|
@@ -84,8 +85,8 @@ vi.mock('../../ui/PinInput', () => {
|
|
|
84
85
|
return {
|
|
85
86
|
PinInput: {
|
|
86
87
|
Root: ({ children }) => _jsx("div", { children: children }),
|
|
87
|
-
Label: ({ children }) => _jsx("label", { children: children }),
|
|
88
|
-
Input: React.forwardRef((props, ref) => _jsx("input", { "data-testid": "input-otp", ref: ref, ...props })),
|
|
88
|
+
Label: ({ children, htmlFor, ...props }) => (_jsx("label", { htmlFor: htmlFor ?? 'pin-input', ...props, children: children })),
|
|
89
|
+
Input: React.forwardRef((props, ref) => (_jsx("input", { "data-testid": "input-otp", id: props.id ?? 'pin-input', ref: ref, ...props }))),
|
|
89
90
|
Control: ({ children }) => _jsx("div", { children: children }),
|
|
90
91
|
HiddenInput: () => null,
|
|
91
92
|
},
|
|
@@ -36,10 +36,10 @@ vi.mock('@ark-ui/react/dialog', () => ({
|
|
|
36
36
|
}));
|
|
37
37
|
// Mock external components
|
|
38
38
|
vi.mock('./GoogleSignInTrigger', () => ({
|
|
39
|
-
GoogleSignInTrigger: () => _jsx("button", { children: "Google Sign In" }),
|
|
39
|
+
GoogleSignInTrigger: () => _jsx("button", { type: "button", children: "Google Sign In" }),
|
|
40
40
|
}));
|
|
41
41
|
vi.mock('./FacebookSignInTrigger', () => ({
|
|
42
|
-
FacebookSignInTrigger: () => _jsx("button", { children: "Facebook Sign In" }),
|
|
42
|
+
FacebookSignInTrigger: () => _jsx("button", { type: "button", children: "Facebook Sign In" }),
|
|
43
43
|
}));
|
|
44
44
|
vi.mock('../../ui/Checkbox', () => {
|
|
45
45
|
const React = require('react');
|
|
@@ -48,11 +48,12 @@ vi.mock('../../ui/Checkbox', () => {
|
|
|
48
48
|
Checkbox: {
|
|
49
49
|
Root: ({ children, onCheckedChange }) => (_jsx(CheckboxContext.Provider, { value: { onCheckedChange }, children: _jsx("div", { children: children }) })),
|
|
50
50
|
Control: ({ children }) => _jsx("div", { children: children }),
|
|
51
|
-
Label: ({ children }) => _jsx("label", { children: children }),
|
|
51
|
+
Label: ({ children, htmlFor, ...props }) => (_jsx("label", { htmlFor: htmlFor ?? 'checkbox-input', ...props, children: children })),
|
|
52
52
|
Indicator: ({ children }) => _jsx("div", { children: children }),
|
|
53
53
|
HiddenInput: React.forwardRef((props, ref) => {
|
|
54
54
|
const { onCheckedChange } = React.useContext(CheckboxContext);
|
|
55
|
-
|
|
55
|
+
const id = props.id ?? 'checkbox-input';
|
|
56
|
+
return (_jsx("input", { type: "checkbox", "data-testid": "input-terms", id: id, ref: ref, ...props, onChange: (e) => {
|
|
56
57
|
if (onCheckedChange)
|
|
57
58
|
onCheckedChange({ checked: e.target.checked });
|
|
58
59
|
} }));
|
|
@@ -69,8 +70,8 @@ vi.mock('../../ui/Field', () => {
|
|
|
69
70
|
return {
|
|
70
71
|
Field: {
|
|
71
72
|
Root: ({ children }) => _jsx("div", { children: children }),
|
|
72
|
-
Label: ({ children }) => _jsx("label", { children: children }),
|
|
73
|
-
Input: React.forwardRef((props, ref) => _jsx("input", { "data-testid": `input-${props.name}`, ref: ref, ...props })),
|
|
73
|
+
Label: ({ children, htmlFor, ...props }) => (_jsx("label", { htmlFor: htmlFor ?? props.name ?? 'field', ...props, children: children })),
|
|
74
|
+
Input: React.forwardRef((props, ref) => (_jsx("input", { "data-testid": `input-${props.name}`, id: props.id ?? props.name ?? 'field', ref: ref, ...props }))),
|
|
74
75
|
HelperText: ({ children }) => _jsx("div", { children: children }),
|
|
75
76
|
ErrorText: ({ children }) => _jsx("div", { children: children }),
|
|
76
77
|
},
|
|
@@ -79,18 +80,21 @@ vi.mock('../../ui/Field', () => {
|
|
|
79
80
|
vi.mock('../../ui/PasswordInput', () => {
|
|
80
81
|
const React = require('react');
|
|
81
82
|
const { useState, useContext, createContext } = React;
|
|
82
|
-
const VisibilityContext = createContext({
|
|
83
|
+
const VisibilityContext = createContext({
|
|
84
|
+
visible: false,
|
|
85
|
+
setVisible: (_v) => { },
|
|
86
|
+
});
|
|
83
87
|
return {
|
|
84
88
|
PasswordInput: {
|
|
85
89
|
Root: ({ children }) => {
|
|
86
90
|
const [visible, setVisible] = useState(false);
|
|
87
91
|
return (_jsx(VisibilityContext.Provider, { value: { visible, setVisible }, children: _jsx("div", { children: children }) }));
|
|
88
92
|
},
|
|
89
|
-
Label: ({ children }) => _jsx("label", { children: children }),
|
|
93
|
+
Label: ({ children, htmlFor, ...props }) => (_jsx("label", { htmlFor: htmlFor ?? 'password', ...props, children: children })),
|
|
90
94
|
Input: React.forwardRef((props, ref) => {
|
|
91
95
|
const { visible } = useContext(VisibilityContext);
|
|
92
96
|
// Ensure type is passed correctly if not overridden
|
|
93
|
-
return _jsx("input", { "data-testid": `input-${props.name || 'password'}`, ref: ref, type: visible ? 'text' : 'password', ...props });
|
|
97
|
+
return (_jsx("input", { "data-testid": `input-${props.name || 'password'}`, id: props.id ?? props.name ?? 'password', ref: ref, type: visible ? 'text' : 'password', ...props }));
|
|
94
98
|
}),
|
|
95
99
|
Control: ({ children }) => _jsx("div", { children: children }),
|
|
96
100
|
VisibilityTrigger: ({ children }) => {
|
|
@@ -197,7 +201,7 @@ describe('NameAndPasswordSignIn', () => {
|
|
|
197
201
|
expect(passwordInput).toHaveAttribute('type', 'password');
|
|
198
202
|
});
|
|
199
203
|
it('handles security question flow', async () => {
|
|
200
|
-
const
|
|
204
|
+
const _user = userEvent.setup();
|
|
201
205
|
// Mock SignInMutation returning a security question challenge
|
|
202
206
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
203
207
|
mockSignInMutation.data = {
|
|
@@ -26,7 +26,10 @@ vi.mock('./HappyBingo/SignInForm', () => ({
|
|
|
26
26
|
}));
|
|
27
27
|
// Mock Next.js Image since it's used in the wrapper
|
|
28
28
|
vi.mock('next/image', () => ({
|
|
29
|
-
default: (props) =>
|
|
29
|
+
default: (props) => {
|
|
30
|
+
// biome-ignore lint/performance/noImgElement: mock Next/Image with plain img in tests
|
|
31
|
+
return _jsx("img", { ...props, alt: props.alt || '' });
|
|
32
|
+
},
|
|
30
33
|
}));
|
|
31
34
|
const mockLogo = '/mock-logo.png';
|
|
32
35
|
describe('SignIn Wrapper', () => {
|
|
@@ -60,7 +63,6 @@ describe('SignIn Wrapper', () => {
|
|
|
60
63
|
expect(screen.getByTestId('mock-hb-sign-in-form')).toBeInTheDocument();
|
|
61
64
|
});
|
|
62
65
|
it('closes dialog when close trigger is clicked', async () => {
|
|
63
|
-
const user = require('@testing-library/user-event').default.setup();
|
|
64
66
|
render(_jsx(SignIn, { ...defaultProps }));
|
|
65
67
|
// Find close button (usually checking for label or class, assuming standard Dialog CloseTrigger)
|
|
66
68
|
// Our Dialog mock or real Dialog implementation needs to be checked.
|
|
@@ -74,7 +76,6 @@ describe('SignIn Wrapper', () => {
|
|
|
74
76
|
</Dialog.CloseTrigger>
|
|
75
77
|
*/
|
|
76
78
|
// Ark UI CloseTrigger usually renders a button.
|
|
77
|
-
const closeButtons = screen.getAllByRole('button');
|
|
78
79
|
// Assuming the first one or finding by icon logic?
|
|
79
80
|
// Actually, let's just use fireEvent on the overlay or trigger if finding it is hard without testId.
|
|
80
81
|
// But let's try finding by role.
|
|
@@ -8,23 +8,23 @@ export declare const createForgotPasswordSchema: (mobileNumberParser: MobileNumb
|
|
|
8
8
|
mobileNumber: z.ZodEffects<z.ZodString, string, string>;
|
|
9
9
|
verificationCode: z.ZodEffects<z.ZodString, string, string>;
|
|
10
10
|
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
verificationCode: string;
|
|
12
11
|
password: string;
|
|
12
|
+
verificationCode: string;
|
|
13
13
|
mobileNumber: string;
|
|
14
14
|
confirmPassword: string;
|
|
15
15
|
}, {
|
|
16
|
-
verificationCode: string;
|
|
17
16
|
password: string;
|
|
17
|
+
verificationCode: string;
|
|
18
18
|
mobileNumber: string;
|
|
19
19
|
confirmPassword: string;
|
|
20
20
|
}>, {
|
|
21
|
-
verificationCode: string;
|
|
22
21
|
password: string;
|
|
22
|
+
verificationCode: string;
|
|
23
23
|
mobileNumber: string;
|
|
24
24
|
confirmPassword: string;
|
|
25
25
|
}, {
|
|
26
|
-
verificationCode: string;
|
|
27
26
|
password: string;
|
|
27
|
+
verificationCode: string;
|
|
28
28
|
mobileNumber: string;
|
|
29
29
|
confirmPassword: string;
|
|
30
30
|
}>;
|