@opexa/portal-components 0.0.1118 → 0.0.1120
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/__tests__/utils/mocks.d.ts +1 -1
- 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/Withdrawal/VentajaWithdrawal/VentajaWithdrawal.js +5 -1
- package/dist/components/KYC/KYCReview.js +4 -30
- package/dist/constants/GameProvider.js +6 -0
- package/dist/lib/components/UpdateMobilePhoneNumber/UpdateMobilePhoneNumber.d.ts +1 -0
- package/dist/lib/components/{UpdateMobileNumber/UpdateMobileNumber.js → UpdateMobilePhoneNumber/UpdateMobilePhoneNumber.js} +3 -5
- package/dist/lib/components/UpdateMobilePhoneNumber/index.d.ts +1 -0
- package/dist/lib/components/UpdateMobilePhoneNumber/index.js +1 -0
- package/dist/schemas/forgotPasswordSchema.d.ts +4 -4
- package/dist/types/index.d.ts +1 -1
- 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 +99 -99
- package/dist/ui/Carousel/carousel.recipe.d.ts +11 -11
- 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/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/Field/Field.d.ts +21 -21
- package/dist/ui/Field/field.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/NumberInput/NumberInput.d.ts +24 -24
- package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +121 -121
- package/dist/ui/Popover/popover.recipe.d.ts +11 -11
- 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/dist/utils/getProviderData.js +5 -0
- package/package.json +1 -1
- package/dist/components/DigitainLauncher/DigitainAuthWall.d.ts +0 -7
- package/dist/components/DigitainLauncher/DigitainAuthWall.js +0 -20
- package/dist/components/UpdateMobileNumber/UpdateMobileNumber.d.ts +0 -3
- package/dist/components/UpdateMobileNumber/UpdateMobileNumber.js +0 -141
- package/dist/components/UpdateMobileNumber/index.d.ts +0 -1
- package/dist/components/UpdateMobileNumber/index.js +0 -1
- package/dist/lib/components/UpdateMobileNumber/UpdateMobileNumber.d.ts +0 -1
- package/dist/lib/components/UpdateMobileNumber/index.d.ts +0 -1
- package/dist/lib/components/UpdateMobileNumber/index.js +0 -1
|
@@ -304,6 +304,11 @@ const GAME_PROVIDER_MAP = {
|
|
|
304
304
|
value: 'RUBYPLAY',
|
|
305
305
|
image: [providerRubyPlay.src, providerRubyPlay.src],
|
|
306
306
|
},
|
|
307
|
+
EVOLUTION_TAP_A_ROO: {
|
|
308
|
+
label: 'Evolution Tap A Roo',
|
|
309
|
+
value: 'EVOLUTION_TAP_A_ROO',
|
|
310
|
+
image: [providerEvolution.src, providerEvolution.src],
|
|
311
|
+
},
|
|
307
312
|
};
|
|
308
313
|
export function getProviderData(provider) {
|
|
309
314
|
return GAME_PROVIDER_MAP[provider];
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ImageProps } from 'next/image';
|
|
2
|
-
export interface DigitainAuthWallProps {
|
|
3
|
-
signInUrl?: string | null;
|
|
4
|
-
fallbackBackgroundImage?: ImageProps['src'] | null;
|
|
5
|
-
}
|
|
6
|
-
/** Shown when the user must sign in before opening the sportsbook. */
|
|
7
|
-
export declare function DigitainAuthWall(props: DigitainAuthWallProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import Image from 'next/image';
|
|
4
|
-
import { useShallow } from 'zustand/shallow';
|
|
5
|
-
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
6
|
-
import { Button } from '../../ui/Button/index.js';
|
|
7
|
-
/** Shown when the user must sign in before opening the sportsbook. */
|
|
8
|
-
export function DigitainAuthWall(props) {
|
|
9
|
-
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
10
|
-
signIn: ctx.signIn,
|
|
11
|
-
})));
|
|
12
|
-
return (_jsxs("div", { className: "relative w-full min-h-[calc(100dvh-4rem)]", children: [props.fallbackBackgroundImage && (_jsx(Image, { src: props.fallbackBackgroundImage, alt: "Background", fill: true, className: "rounded-xl object-cover", sizes: "100vw" })), _jsx("div", { className: "absolute right-0 bottom-0 left-0 hidden h-1/2 rounded-xl bg-gradient-to-b from-[#00000000] to-bg-primary-alt lg:block" }), _jsx("div", { className: "pointer-events-none absolute inset-0 z-[1] rounded-xl bg-gradient-to-b from-black/45 via-black/20 to-black/50 lg:hidden", "aria-hidden": true }), _jsx("div", { className: "absolute inset-0 z-10 flex flex-col justify-center px-4 py-8 sm:px-6 lg:justify-end lg:pb-12 lg:pt-8", children: _jsxs("div", { className: "mx-auto w-full max-w-[42.5rem] text-center", children: [_jsxs("div", { className: "mb-8 space-y-3", children: [_jsx("h2", { className: "font-bold text-gray-900 text-xl uppercase lg:text-[40px]", children: "Sports Book Login Required" }), _jsx("p", { className: "text-gray-600 text-xs leading-relaxed lg:text-lg", children: "The Sports Book is our online platform where you can explore real-time betting odds, place bets on a wide range of sports, and track your activity." }), _jsx("p", { className: "text-gray-600 text-xs leading-relaxed lg:text-lg", children: "Access is restricted to authenticated users. Please login to continue and unlock full access to the platform." })] }), _jsx(Button, { className: "mx-auto w-fit", onClick: () => {
|
|
13
|
-
if (props.signInUrl) {
|
|
14
|
-
window.location.href = props.signInUrl;
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
globalStore.signIn.setOpen(true);
|
|
18
|
-
}
|
|
19
|
-
}, children: "Login" })] }) })] }));
|
|
20
|
-
}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { zodResolver } from '@hookform/resolvers/zod';
|
|
4
|
-
import Image from 'next/image';
|
|
5
|
-
import { useRef, useState } from 'react';
|
|
6
|
-
import { Controller, useForm } from 'react-hook-form';
|
|
7
|
-
import z from 'zod';
|
|
8
|
-
import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
|
|
9
|
-
import { useCooldown } from '../../client/hooks/useCooldown.js';
|
|
10
|
-
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
11
|
-
import { useMobileNumberParser } from '../../client/hooks/useMobileNumberParser.js';
|
|
12
|
-
import { useSendVerificationCodeMutation } from '../../client/hooks/useSendVerificationCodeMutation.js';
|
|
13
|
-
import { useUpdateMobileNumber } from '../../client/hooks/useUpdateMobileNumber.js';
|
|
14
|
-
import { toaster } from '../../client/utils/toaster.js';
|
|
15
|
-
import { ArrowLeftIcon } from '../../icons/ArrowLeftIcon.js';
|
|
16
|
-
import inplayLogo from '../../images/inplay-logo.png';
|
|
17
|
-
import lightBg from '../../images/light-bg.png';
|
|
18
|
-
import { Button } from '../../ui/Button/index.js';
|
|
19
|
-
import { Dialog } from '../../ui/Dialog/index.js';
|
|
20
|
-
import { Field } from '../../ui/Field/index.js';
|
|
21
|
-
import { PinInput } from '../../ui/PinInput/index.js';
|
|
22
|
-
import { Portal } from '../../ui/Portal/index.js';
|
|
23
|
-
export function UpdateMobileNumber({ onClose }) {
|
|
24
|
-
const accountQuery = useAccountQuery();
|
|
25
|
-
const account = accountQuery.data;
|
|
26
|
-
const isAccountLoading = accountQuery.isLoading;
|
|
27
|
-
const hasMobileNumber = !!account?.mobileNumber;
|
|
28
|
-
const isDialogOpen = !isAccountLoading && !!account && !hasMobileNumber;
|
|
29
|
-
const [step, setStep] = useState(1);
|
|
30
|
-
const sendVerificationCodeMutation = useSendVerificationCodeMutation({
|
|
31
|
-
onSuccess: () => {
|
|
32
|
-
setStep(2);
|
|
33
|
-
cooldown.start();
|
|
34
|
-
},
|
|
35
|
-
onError: (err) => {
|
|
36
|
-
toaster.error({
|
|
37
|
-
title: 'Sign In Failed',
|
|
38
|
-
description: err.message,
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
const updateMobileNumberMutation = useUpdateMobileNumber({
|
|
43
|
-
onSuccess: async () => {
|
|
44
|
-
step1Form.reset();
|
|
45
|
-
step2Form.reset();
|
|
46
|
-
setStep(1);
|
|
47
|
-
toaster.success({
|
|
48
|
-
title: 'Verification Successful',
|
|
49
|
-
description: 'Your mobile number has been verified.',
|
|
50
|
-
});
|
|
51
|
-
onClose?.();
|
|
52
|
-
},
|
|
53
|
-
onError: (err) => {
|
|
54
|
-
const errorMessage = err.message === 'Internal Server Error'
|
|
55
|
-
? `mobile number ${mobileNumberParser.format(step1Form.getValues('mobileNumber'))} is not available`
|
|
56
|
-
: err.message;
|
|
57
|
-
toaster.error({
|
|
58
|
-
title: 'Sign In Failed',
|
|
59
|
-
description: errorMessage,
|
|
60
|
-
});
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
const localeInfo = useLocaleInfo();
|
|
64
|
-
const mobileNumberParser = useMobileNumberParser();
|
|
65
|
-
const Step1Definition = z.object({
|
|
66
|
-
mobileNumber: z
|
|
67
|
-
.string()
|
|
68
|
-
.min(1, 'Mobile number is required')
|
|
69
|
-
.superRefine((v, ctx) => {
|
|
70
|
-
if (!mobileNumberParser.validate(v)) {
|
|
71
|
-
ctx.addIssue({
|
|
72
|
-
code: z.ZodIssueCode.custom,
|
|
73
|
-
message: 'Invalid mobile number',
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}),
|
|
77
|
-
});
|
|
78
|
-
const Step2Definition = z.object({
|
|
79
|
-
verificationCode: z.array(z.string()).superRefine((val, ctx) => {
|
|
80
|
-
if (val.length !== 6 || val.some((v) => v.length !== 1)) {
|
|
81
|
-
ctx.addIssue({
|
|
82
|
-
code: z.ZodIssueCode.custom,
|
|
83
|
-
message: 'Please enter your 6-digit verification code.',
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}),
|
|
87
|
-
});
|
|
88
|
-
const step1Form = useForm({
|
|
89
|
-
resolver: zodResolver(Step1Definition),
|
|
90
|
-
defaultValues: {
|
|
91
|
-
mobileNumber: '',
|
|
92
|
-
},
|
|
93
|
-
});
|
|
94
|
-
const step2Form = useForm({
|
|
95
|
-
resolver: zodResolver(Step2Definition),
|
|
96
|
-
defaultValues: {
|
|
97
|
-
verificationCode: Array.from({ length: 6 }).fill(''),
|
|
98
|
-
},
|
|
99
|
-
});
|
|
100
|
-
const cooldown = useCooldown({
|
|
101
|
-
max: 60,
|
|
102
|
-
duration: 1000 * 60,
|
|
103
|
-
});
|
|
104
|
-
const formRef = useRef(null);
|
|
105
|
-
return (_jsx(Dialog.Root, { open: isDialogOpen, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { className: "flex items-center", children: _jsxs(Dialog.Content, { className: "flex w-[375px] flex-col items-center space-y-4 rounded-xl bg-[#111827] p-6 text-center", style: {
|
|
106
|
-
backgroundImage: `url(${lightBg.src})`,
|
|
107
|
-
}, children: [_jsx(Image, { src: inplayLogo, alt: "inplay logo", width: 82, height: 34, className: "h-auto w-[82px]" }), _jsxs("div", { children: [step === 1 && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "font-bold text-sm", children: ["Get ", _jsx("span", { className: "text-[#F05127]", children: "\u20B150 Bonus" }), " when you verify your account and play."] }), _jsxs("form", { className: "mt-3xl", onSubmit: step1Form.handleSubmit(async (data) => {
|
|
108
|
-
sendVerificationCodeMutation.mutateAsync({
|
|
109
|
-
channel: 'SMS',
|
|
110
|
-
recipient: mobileNumberParser.format(data.mobileNumber),
|
|
111
|
-
});
|
|
112
|
-
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, className: "text-left", children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsx("div", { className: "-translate-y-1/2 absolute top-1/2 left-3.5 flex shrink-0 items-center gap-md", children: _jsx("span", { className: "text-text-placeholder", children: localeInfo.mobileNumber.areaCode }) }), _jsx(Field.Input, { style: {
|
|
113
|
-
paddingLeft: `calc(1.25rem + ${localeInfo.mobileNumber.areaCode.length}ch)`,
|
|
114
|
-
}, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Send Code" })] })] })), step === 2 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center font-semibold text-lg", children: "Check your Phone" }), _jsxs("p", { className: "mt-xs text-center text-sm text-text-secondary-700", children: ["We\u2019ve sent a verification code to your mobile number", ' ', _jsx("span", { className: "font-semibold text-[#F05127]", children: mobileNumberParser.format(step1Form.getValues('mobileNumber')) }), ' ', "via text"] }), _jsxs("form", { ref: formRef, className: "mt-5", onSubmit: step2Form.handleSubmit(async ({ verificationCode }) => {
|
|
115
|
-
updateMobileNumberMutation.mutateAsync({
|
|
116
|
-
mobileNumber: mobileNumberParser.format(step1Form.getValues('mobileNumber')),
|
|
117
|
-
verificationCode: verificationCode.join(''),
|
|
118
|
-
});
|
|
119
|
-
}), children: [_jsx(Controller, { name: "verificationCode", control: step2Form.control, render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, children: [_jsxs(PinInput.Root, { placeholder: "0", onKeyDown: (e) => {
|
|
120
|
-
if (e.key === 'Backspace') {
|
|
121
|
-
step2Form.reset();
|
|
122
|
-
}
|
|
123
|
-
}, value: o.field.value, onValueChange: (details) => {
|
|
124
|
-
o.field.onChange(details.value);
|
|
125
|
-
o.field.onBlur();
|
|
126
|
-
}, otp: true, onValueComplete: () => {
|
|
127
|
-
formRef.current?.requestSubmit();
|
|
128
|
-
}, blurOnComplete: true, readOnly: step2Form.formState.isSubmitting, type: "numeric", children: [_jsxs(PinInput.Control, { className: "grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md", children: [_jsx(PinInput.Input, { index: 0 }), _jsx(PinInput.Input, { index: 1 }), _jsx(PinInput.Input, { index: 2 }), _jsx("span", { className: "font-medium text-2xl text-text-placeholder-subtle", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: step2Form.formState.isSubmitting, children: "Verify" }), _jsxs("div", { className: "mt-4 flex w-full items-center justify-center gap-xs text-xs", children: [_jsx("span", { className: "text-[#9CA3AF]", children: "Didn't receive the code?" }), _jsx("button", { type: "button", className: "font-semibold text-[#C084FC]", disabled: cooldown.cooling, onClick: async () => {
|
|
129
|
-
await sendVerificationCodeMutation.mutateAsync({
|
|
130
|
-
channel: 'SMS',
|
|
131
|
-
recipient: mobileNumberParser.format(step1Form.getValues('mobileNumber')),
|
|
132
|
-
});
|
|
133
|
-
cooldown.start();
|
|
134
|
-
}, children: cooldown.cooling
|
|
135
|
-
? `Resend in ${cooldown.countdown}s`
|
|
136
|
-
: 'Resend' })] }), _jsx("button", { type: "button", className: "absolute top-0 left-6 mx-auto mt-3xl flex h-8 w-8 items-center gap-1 rounded-full bg-[#1f2638] font-semibold text-sm text-text-tertiary-600", onClick: () => {
|
|
137
|
-
setStep(1);
|
|
138
|
-
step2Form.reset();
|
|
139
|
-
cooldown.stop();
|
|
140
|
-
}, children: _jsx(ArrowLeftIcon, { className: "mx-auto size-5" }) })] })] }))] })] }) })] }) }));
|
|
141
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './UpdateMobileNumber';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './UpdateMobileNumber.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function UpdateMobileNumber(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './UpdateMobileNumber';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './UpdateMobileNumber.js';
|