@opexa/portal-components 0.0.681 → 0.0.682
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.js +1 -0
- package/dist/client/hooks/useSignOutMutation.js +15 -0
- package/dist/components/AccountInfo/GoogleDisconnect.d.ts +7 -0
- package/dist/components/AccountInfo/GoogleDisconnect.js +11 -0
- package/dist/components/DepositWithdrawal/AiOPaymentMethods.js +4 -4
- package/dist/components/DepositWithdrawal/PaymentMethods.js +4 -3
- package/dist/components/GameLaunch/GameLaunchTrigger.js +1 -1
- package/dist/components/KYC/KYCVerificationStatus.lazy.js +4 -7
- package/dist/components/PortalProvider/CXDTokenObserver.js +11 -11
- package/dist/components/SignIn/MobileNumberSignIn.js +13 -1
- package/dist/components/SignIn/NameAndPasswordSignIn.js +23 -3
- package/dist/components/TopWins/TopWins.client.js +1 -1
- package/dist/icons/LinkBrokenIcon.d.ts +2 -0
- package/dist/icons/LinkBrokenIcon.js +4 -0
- package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
- package/dist/ui/AlertDialog/alertDialog.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/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 +252 -252
- package/dist/ui/Menu/menu.recipe.d.ts +14 -14
- package/dist/ui/Popover/Popover.d.ts +88 -88
- package/dist/ui/Popover/popover.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/Tooltip/Tooltip.d.ts +30 -30
- package/dist/ui/Tooltip/tooltip.recipe.d.ts +5 -5
- package/package.json +1 -1
- package/dist/components/Banner/Banner.client.d.ts +0 -12
- package/dist/components/Banner/Banner.client.js +0 -49
- package/dist/components/PortalProvider/AndroidOnlyComponents.d.ts +0 -1
- package/dist/components/PortalProvider/AndroidOnlyComponents.js +0 -12
- package/dist/components/SignIn/utils.d.ts +0 -8
- package/dist/components/SignIn/utils.js +0 -26
- package/dist/constants/Branches.d.ts +0 -2
- package/dist/constants/Branches.js +0 -42
- package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +0 -4
- package/dist/third-parties/FacebookPixel/FacebookPixel.js +0 -4
- package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
- package/dist/third-parties/FacebookPixel/api.js +0 -1
- package/dist/third-parties/FacebookPixel/index.d.ts +0 -1
- package/dist/third-parties/FacebookPixel/index.js +0 -1
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +0 -4
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +0 -4
- package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
- package/dist/third-parties/GoogleRecaptcha/api.js +0 -1
- package/dist/third-parties/GoogleRecaptcha/index.d.ts +0 -1
- package/dist/third-parties/GoogleRecaptcha/index.js +0 -1
- package/dist/third-parties/index.d.ts +0 -2
- package/dist/third-parties/index.js +0 -2
|
@@ -79,6 +79,7 @@ export function useCamera(options = {}) {
|
|
|
79
79
|
setLoading(false);
|
|
80
80
|
}
|
|
81
81
|
}, [options, desktop]);
|
|
82
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: Intentional empty deps: we need a stable openNativeCamera reference.
|
|
82
83
|
const openNativeCamera = useCallback(async () => {
|
|
83
84
|
setData(null);
|
|
84
85
|
setError(null);
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { useMutation } from '@tanstack/react-query';
|
|
2
|
+
import invariant from 'tiny-invariant';
|
|
3
|
+
import { unregisterFCMDevice } from '../../services/trigger.js';
|
|
2
4
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
3
5
|
import { getSignOutMutationKey } from '../../utils/mutationKeys.js';
|
|
4
6
|
import { getSessionQueryKey } from '../../utils/queryKeys.js';
|
|
7
|
+
import { getSession } from '../services/getSession.js';
|
|
5
8
|
import { signOut } from '../services/signOut.js';
|
|
6
9
|
const IDLE_TIMESTAMP_KEY = 'idle-logout-timestamp';
|
|
7
10
|
export const useSignOutMutation = (config) => {
|
|
@@ -10,6 +13,18 @@ export const useSignOutMutation = (config) => {
|
|
|
10
13
|
...config,
|
|
11
14
|
mutationKey: getSignOutMutationKey(),
|
|
12
15
|
mutationFn: async () => {
|
|
16
|
+
const session = await getQueryClient().fetchQuery({
|
|
17
|
+
queryKey: getSessionQueryKey(),
|
|
18
|
+
queryFn: async () => getSession(),
|
|
19
|
+
});
|
|
20
|
+
invariant(session.status === 'authenticated');
|
|
21
|
+
await unregisterFCMDevice({
|
|
22
|
+
type: ['IOS', 'ANDROID'],
|
|
23
|
+
}, {
|
|
24
|
+
headers: {
|
|
25
|
+
Authorization: `Bearer ${session.token}`,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
13
28
|
await signOut();
|
|
14
29
|
await queryClient.invalidateQueries({ queryKey: getSessionQueryKey() });
|
|
15
30
|
queryClient.removeQueries();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type UseDisclosureReturn } from '../../client/hooks/useDisclosure';
|
|
2
|
+
interface GoogleDisconnectProps {
|
|
3
|
+
onConfirmAction?: (ctx: UseDisclosureReturn) => React.ReactNode;
|
|
4
|
+
children?: (ctx: UseDisclosureReturn) => React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare function GoogleDisconnect(props: GoogleDisconnectProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useDisclosure, } from '../../client/hooks/useDisclosure.js';
|
|
4
|
+
import { LinkBrokenIcon } from '../../icons/LinkBrokenIcon.js';
|
|
5
|
+
import { XIcon } from '../../icons/XIcon.js';
|
|
6
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
7
|
+
import { Portal } from '../../ui/Portal/index.js';
|
|
8
|
+
export function GoogleDisconnect(props) {
|
|
9
|
+
const disclosure = useDisclosure();
|
|
10
|
+
return (_jsxs(_Fragment, { children: [props.children?.(disclosure), _jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: disclosure.open, onOpenChange: (details) => disclosure.setOpen(details.open), closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "mx-auto min-h-auto max-w-[25rem] overflow-y-auto rounded-xl p-6", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "flex flex-col ", children: [_jsx("div", { className: "mx-auto flex size-12 items-center justify-center rounded-full bg-bg-brand-secondary text-text-brand", children: _jsx(LinkBrokenIcon, {}) }), _jsx("h2", { className: "mb-1 text-center font-semibold text-lg xl:mt-xl", children: "Disconnect Google Account" }), _jsx("p", { className: "text-center text-sm text-text-tertiary-600 leading-2xl", children: "Are you sure you want to disconnect your Google account? This may affect your ability to log in or sync data." })] }), _jsx("div", { className: "pt-6", children: props.onConfirmAction?.(disclosure) })] }) })] }) })] }));
|
|
11
|
+
}
|
|
@@ -4,12 +4,12 @@ import { twMerge } from 'tailwind-merge';
|
|
|
4
4
|
import { useControllableState } from '../../client/hooks/useControllableState.js';
|
|
5
5
|
import { CheckIcon } from '../../icons/CheckIcon.js';
|
|
6
6
|
import gcash from '../../images/gcash.png';
|
|
7
|
-
import maya from '../../images/maya.png';
|
|
8
7
|
import grabPay from '../../images/grabpay.png';
|
|
8
|
+
import maya from '../../images/maya.png';
|
|
9
9
|
import palawanPay from '../../images/palawanpay.png';
|
|
10
10
|
import { Checkbox } from '../../ui/Checkbox/index.js';
|
|
11
11
|
import { Field } from '../../ui/Field/index.js';
|
|
12
|
-
import { AiOeWalletPaymentMethodDefinition } from './utils.js';
|
|
12
|
+
import { AiOeWalletPaymentMethodDefinition, } from './utils.js';
|
|
13
13
|
const AIO_EWALLET_OPTIONS = [
|
|
14
14
|
{
|
|
15
15
|
value: 'AIO_GCASH',
|
|
@@ -50,6 +50,6 @@ export function AiOPaymentMethods(props) {
|
|
|
50
50
|
return;
|
|
51
51
|
setValue(parseValue(lastValue));
|
|
52
52
|
}, className: "grid grid-cols-2 gap-x-4 gap-y-3", children: options.map((option) => (_jsxs(Checkbox.Root, { value: option.value, className: "flex cursor-pointer items-center justify-between rounded-xl border border-border-secondary ui-checked:border-border-brand-solid p-lg", children: [_jsx("div", { className: twMerge('rounded-xs', option.value === 'AIO_GRAB_PAY'
|
|
53
|
-
? 'bg-transparent
|
|
54
|
-
: 'bg-white py-[0.688rem]
|
|
53
|
+
? 'bg-transparent px-0 py-0'
|
|
54
|
+
: 'bg-white px-sm py-[0.688rem]', option.value === 'AIO_GCASH' && 'bg-[#017EFF]', option.value === 'AIO_PALAWAN_PAY' && 'bg-[#026308]', option.value === 'AIO_PAY_MAYA' && 'bg-black'), children: _jsx(Image, { src: option.image, alt: "", width: 200, height: 40, className: twMerge('h-[1.063rem] w-auto', option.value === 'AIO_GRAB_PAY' && 'h-[3rem] rounded-[4px]', option.value === 'AIO_PALAWAN_PAY' && 'h-[2rem]'), draggable: false }) }), _jsx(Checkbox.Control, { className: "shrink-0", children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.HiddenInput, {})] }, option.value))) })] }));
|
|
55
55
|
}
|
|
@@ -3,13 +3,13 @@ import Image from 'next/image';
|
|
|
3
3
|
import { twMerge } from 'tailwind-merge';
|
|
4
4
|
import { useControllableState } from '../../client/hooks/useControllableState.js';
|
|
5
5
|
import { CheckIcon } from '../../icons/CheckIcon.js';
|
|
6
|
-
import qrph from '../../images/QRPH.png';
|
|
7
6
|
import gcash from '../../images/gcash.png';
|
|
8
7
|
import instapay from '../../images/instapay.png';
|
|
9
8
|
import libangan from '../../images/libangan.png';
|
|
10
9
|
import maya from '../../images/maya.png';
|
|
11
10
|
import onlineBank from '../../images/online-bank.png';
|
|
12
11
|
import pisoPay from '../../images/piso-pay.png';
|
|
12
|
+
import qrph from '../../images/QRPH.png';
|
|
13
13
|
import wallet from '../../images/wallet.png';
|
|
14
14
|
import { Checkbox } from '../../ui/Checkbox/index.js';
|
|
15
15
|
import { Field } from '../../ui/Field/index.js';
|
|
@@ -80,8 +80,9 @@ export function PaymentMethods(props) {
|
|
|
80
80
|
if (!lastValue)
|
|
81
81
|
return;
|
|
82
82
|
setValue(PaymentMethodDefinition.parse(lastValue));
|
|
83
|
-
}, className: "grid grid-cols-2 gap-x-4 gap-y-3", children: options.map((option) => (_jsxs(Checkbox.Root, { value: option.value, className: "flex cursor-pointer items-center justify-between rounded-xl border border-border-secondary ui-checked:border-border-brand-solid p-lg", children: [_jsxs("div", { className: twMerge('rounded-xs bg-white px-sm py-[0.688rem]', option.value === 'GCASH' && 'bg-[#017EFF]', option.value === 'AIO_EWALLET' &&
|
|
83
|
+
}, className: "grid grid-cols-2 gap-x-4 gap-y-3", children: options.map((option) => (_jsxs(Checkbox.Root, { value: option.value, className: "flex cursor-pointer items-center justify-between rounded-xl border border-border-secondary ui-checked:border-border-brand-solid p-lg", children: [_jsxs("div", { className: twMerge('rounded-xs bg-white px-sm py-[0.688rem]', option.value === 'GCASH' && 'bg-[#017EFF]', option.value === 'AIO_EWALLET' &&
|
|
84
|
+
'flex items-center space-x-sm bg-bg-secondary'), children: [_jsx(Image, { src: option.image, alt: "", width: 200, height: 40, className: twMerge('w-auto', option.value === 'LIBANGAN_PAY_IN' ||
|
|
84
85
|
option.value === 'VENTAJA_DISBURSEMENT'
|
|
85
86
|
? 'h-[2.5rem]'
|
|
86
|
-
: 'h-[1.063rem]'), draggable: false }), option.value === 'AIO_EWALLET' && _jsx("p", { className:
|
|
87
|
+
: 'h-[1.063rem]'), draggable: false }), option.value === 'AIO_EWALLET' && (_jsx("p", { className: "text-text-secondary-700 text-xs leading-tight", children: "AIO eWallet" }))] }), _jsx(Checkbox.Control, { className: "shrink-0", children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.HiddenInput, {})] }, option.value))) })] }));
|
|
87
88
|
}
|
|
@@ -83,7 +83,7 @@ export function GameLaunchTrigger(props) {
|
|
|
83
83
|
token: credentials.password,
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
catch
|
|
86
|
+
catch {
|
|
87
87
|
toaster.error({
|
|
88
88
|
title: 'Biometric sign-in token has expired.',
|
|
89
89
|
description: 'Please sign in with your mobile number or username to re-enable biometric login.',
|
|
@@ -19,18 +19,15 @@ export function KYCVerificationStatus() {
|
|
|
19
19
|
const icons = status === 'PENDING' ? bellIcon : alertIcon;
|
|
20
20
|
return (_jsx(Dialog.Root, { open: globalStore.kycVerificationStatus.open, onOpenChange: (details) => {
|
|
21
21
|
globalStore.kycVerificationStatus.setOpen(details.open);
|
|
22
|
-
}, 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", className: "w-60 object-contain", draggable: false, width: 120, height: 120 }) }), _jsxs("h1", { className: "font-semibold text-lg text-white", children: [status === 'PENDING' && 'Verification in Progress', status === 'REJECTED' && 'Verification Rejected', status === 'UNVERIFIED'
|
|
23
|
-
(status === 'CREATED' && 'Verification Required')] }), _jsxs("p", { className: "mb-4xl text-[#94969C] text-base", children: [status === 'PENDING' &&
|
|
22
|
+
}, 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", className: "w-60 object-contain", draggable: false, width: 120, height: 120 }) }), _jsxs("h1", { className: "font-semibold text-lg text-white", children: [status === 'PENDING' && 'Verification in Progress', status === 'REJECTED' && 'Verification Rejected', status === 'UNVERIFIED' && 'Verification Required'] }), _jsxs("p", { className: "mb-4xl text-[#94969C] text-base", children: [status === 'PENDING' &&
|
|
24
23
|
`Your account verification is still under review. Please wait
|
|
25
24
|
until it's approved before you can continue playing or
|
|
26
25
|
depositing.`, status === 'REJECTED' &&
|
|
27
|
-
'Your account verification was not approved. Please resubmit your verification to regain full access.', status === 'UNVERIFIED'
|
|
28
|
-
(status === '
|
|
29
|
-
'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: () => {
|
|
26
|
+
'Your account verification was not approved. Please resubmit your verification to regain full access.', status === 'UNVERIFIED' &&
|
|
27
|
+
'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: () => {
|
|
30
28
|
globalStore.kycVerificationStatus.setOpen(false);
|
|
31
29
|
globalStore.kyc.setOpen(true);
|
|
32
|
-
}, children: [status === 'REJECTED' && 'Resubmit Verification', status === 'UNVERIFIED'
|
|
33
|
-
(status === 'CREATED' && 'Verify Now')] }), _jsx(Button, { type: "button", variant: "outline", onClick: () => {
|
|
30
|
+
}, children: [status === 'REJECTED' && 'Resubmit Verification', status === 'UNVERIFIED' && 'Verify Now'] }), _jsx(Button, { type: "button", variant: "outline", onClick: () => {
|
|
34
31
|
globalStore.kycVerificationStatus.setOpen(false);
|
|
35
32
|
}, children: "Close" })] }) }) })] }) }));
|
|
36
33
|
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { addHours } from 'date-fns';
|
|
3
3
|
import { clamp } from 'lodash-es';
|
|
4
|
+
import { useSearchParams } from 'next/navigation';
|
|
4
5
|
import { useLocalStorage, useTimeout } from 'usehooks-ts';
|
|
5
6
|
import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
|
|
6
7
|
export function CXDTokenObserver() {
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const [cxd, setCxd, removeCxd] = useLocalStorage('
|
|
8
|
+
const searchParams = useSearchParams();
|
|
9
|
+
const cxdToken = searchParams.get('cxd');
|
|
10
|
+
const accountQuery = useAccountQuery();
|
|
11
|
+
const account = accountQuery.data;
|
|
12
|
+
const [cxd, setCxd, removeCxd] = useLocalStorage('WebPortalCellxpertCxd', null);
|
|
12
13
|
const now = new Date();
|
|
14
|
+
const shouldTimeoutRun = cxdToken && account;
|
|
13
15
|
const removeCxdUntilInMs = cxd?.timestamp
|
|
14
16
|
? clamp(cxd.timestamp - now.getTime(), 0, Infinity)
|
|
15
17
|
: 0;
|
|
16
18
|
useTimeout(() => {
|
|
17
|
-
const isSame = cxd?.cxd ===
|
|
19
|
+
const isSame = cxd?.cxd === cxdToken;
|
|
18
20
|
if (!isSame) {
|
|
19
21
|
const extendedTimestamp = addHours(new Date(), 6).getTime();
|
|
20
22
|
setCxd({
|
|
21
|
-
cxd:
|
|
23
|
+
cxd: cxdToken,
|
|
22
24
|
timestamp: extendedTimestamp,
|
|
23
25
|
});
|
|
24
26
|
}
|
|
25
|
-
},
|
|
26
|
-
useTimeout(() =>
|
|
27
|
-
removeCxd();
|
|
28
|
-
}, account ? removeCxdUntilInMs : null);
|
|
27
|
+
}, shouldTimeoutRun ? 100 : null);
|
|
28
|
+
useTimeout(() => removeCxd(), shouldTimeoutRun ? removeCxdUntilInMs : null);
|
|
29
29
|
return null;
|
|
30
30
|
}
|
|
@@ -6,6 +6,7 @@ import { useRouter } from 'next/navigation';
|
|
|
6
6
|
import { useRef } from 'react';
|
|
7
7
|
import { Controller, useForm } from 'react-hook-form';
|
|
8
8
|
import { twMerge } from 'tailwind-merge';
|
|
9
|
+
import invariant from 'tiny-invariant';
|
|
9
10
|
import { z } from 'zod';
|
|
10
11
|
import { useShallow } from 'zustand/shallow';
|
|
11
12
|
import { useCooldown } from '../../client/hooks/useCooldown.js';
|
|
@@ -14,12 +15,14 @@ import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
|
14
15
|
import { useMobileNumberParser } from '../../client/hooks/useMobileNumberParser.js';
|
|
15
16
|
import { useSendVerificationCodeMutation } from '../../client/hooks/useSendVerificationCodeMutation.js';
|
|
16
17
|
import { useSignInMutation } from '../../client/hooks/useSignInMutation.js';
|
|
18
|
+
import { getSession } from '../../client/services/getSession.js';
|
|
17
19
|
import { hasSavedBiometry } from '../../client/utils/biometric.js';
|
|
18
20
|
import { toaster } from '../../client/utils/toaster.js';
|
|
19
21
|
import { ArrowLeftIcon } from '../../icons/ArrowLeftIcon.js';
|
|
20
22
|
import { CheckIcon } from '../../icons/CheckIcon.js';
|
|
21
23
|
import pagcorLogo from '../../images/pagcor-round-icon.png';
|
|
22
24
|
import responsibleGamingLogo from '../../images/responsible-gaming-gold.png';
|
|
25
|
+
import { unregisterFCMDevice } from '../../services/trigger.js';
|
|
23
26
|
import { Button } from '../../ui/Button/index.js';
|
|
24
27
|
import { Checkbox } from '../../ui/Checkbox/index.js';
|
|
25
28
|
import { Field } from '../../ui/Field/index.js';
|
|
@@ -45,11 +48,20 @@ export function MobileNumberSignIn() {
|
|
|
45
48
|
registerBiometrics: ctx.registerBiometrics,
|
|
46
49
|
})));
|
|
47
50
|
const signInMutation = useSignInMutation({
|
|
48
|
-
onSuccess: () => {
|
|
51
|
+
onSuccess: async () => {
|
|
49
52
|
step1Form.reset();
|
|
50
53
|
step2Form.reset();
|
|
51
54
|
context.setStep(1);
|
|
52
55
|
globalStore.signIn.setOpen(false);
|
|
56
|
+
const session = await getSession();
|
|
57
|
+
invariant(session.status === 'authenticated');
|
|
58
|
+
await unregisterFCMDevice({
|
|
59
|
+
type: ['IOS', 'ANDROID'],
|
|
60
|
+
}, {
|
|
61
|
+
headers: {
|
|
62
|
+
Authorization: `Bearer ${session.token}`,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
53
65
|
if (signInProps.shouldShowResponsibleGamingReminder) {
|
|
54
66
|
globalStore.responsibleGamingReminder.setOpen(true);
|
|
55
67
|
}
|
|
@@ -6,11 +6,13 @@ import Image from 'next/image';
|
|
|
6
6
|
import { useRouter } from 'next/navigation';
|
|
7
7
|
import { Controller, useForm } from 'react-hook-form';
|
|
8
8
|
import { twMerge } from 'tailwind-merge';
|
|
9
|
+
import invariant from 'tiny-invariant';
|
|
9
10
|
import { z } from 'zod';
|
|
10
11
|
import { useShallow } from 'zustand/shallow';
|
|
11
12
|
import { useAuthenticateMutation } from '../../client/hooks/useAuthenticateMutation.js';
|
|
12
13
|
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
13
14
|
import { useSignInMutation } from '../../client/hooks/useSignInMutation.js';
|
|
15
|
+
import { getSession } from '../../client/services/getSession.js';
|
|
14
16
|
import { hasSavedBiometry } from '../../client/utils/biometric.js';
|
|
15
17
|
import { toaster } from '../../client/utils/toaster.js';
|
|
16
18
|
import { SECRET_QUESTIONS, SECRET_QUESTIONS_MAP } from '../../constants/index.js';
|
|
@@ -19,6 +21,7 @@ import { EyeIcon } from '../../icons/EyeIcon.js';
|
|
|
19
21
|
import { EyeOffIcon } from '../../icons/EyeOffIcon.js';
|
|
20
22
|
import pagcorLogo from '../../images/pagcor-round-icon.png';
|
|
21
23
|
import responsibleGamingLogo from '../../images/responsible-gaming-gold.png';
|
|
24
|
+
import { unregisterFCMDevice } from '../../services/trigger.js';
|
|
22
25
|
import { Button } from '../../ui/Button/index.js';
|
|
23
26
|
import { Checkbox } from '../../ui/Checkbox/index.js';
|
|
24
27
|
import { Field } from '../../ui/Field/index.js';
|
|
@@ -45,12 +48,20 @@ export function NameAndPasswordSignIn() {
|
|
|
45
48
|
registerBiometrics: ctx.registerBiometrics,
|
|
46
49
|
})));
|
|
47
50
|
const signInMutation = useSignInMutation({
|
|
48
|
-
onSuccess(authenticator) {
|
|
51
|
+
onSuccess: async (authenticator) => {
|
|
49
52
|
if (authenticator) {
|
|
50
53
|
context.setStep(2);
|
|
51
54
|
}
|
|
52
55
|
else {
|
|
53
|
-
|
|
56
|
+
const session = await getSession();
|
|
57
|
+
invariant(session.status === 'authenticated');
|
|
58
|
+
await unregisterFCMDevice({
|
|
59
|
+
type: ['IOS', 'ANDROID'],
|
|
60
|
+
}, {
|
|
61
|
+
headers: {
|
|
62
|
+
Authorization: `Bearer ${session.token}`,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
54
65
|
if (!hasSavedBiometry()) {
|
|
55
66
|
globalStore.registerBiometrics.setOpen(true);
|
|
56
67
|
}
|
|
@@ -72,12 +83,21 @@ export function NameAndPasswordSignIn() {
|
|
|
72
83
|
},
|
|
73
84
|
});
|
|
74
85
|
const authenticateMutation = useAuthenticateMutation({
|
|
75
|
-
onSuccess() {
|
|
86
|
+
onSuccess: async () => {
|
|
76
87
|
globalStore.signIn.setOpen(false);
|
|
77
88
|
authenticateMutation.reset();
|
|
78
89
|
signInMutation.reset();
|
|
79
90
|
context.setStep(0);
|
|
80
91
|
form.reset();
|
|
92
|
+
const session = await getSession();
|
|
93
|
+
invariant(session.status === 'authenticated');
|
|
94
|
+
await unregisterFCMDevice({
|
|
95
|
+
type: ['IOS', 'ANDROID'],
|
|
96
|
+
}, {
|
|
97
|
+
headers: {
|
|
98
|
+
Authorization: `Bearer ${session.token}`,
|
|
99
|
+
},
|
|
100
|
+
});
|
|
81
101
|
if (signInProps.shouldShowResponsibleGamingReminder) {
|
|
82
102
|
globalStore.responsibleGamingReminder.setOpen(true);
|
|
83
103
|
}
|
|
@@ -24,7 +24,7 @@ export function TopWins__client(props) {
|
|
|
24
24
|
return (_jsxs("div", { className: twMerge('w-full', classNames.root), children: [_jsx("div", { className: twMerge('mb-3 font-semibold text-lg md:mb-4'), children: props.heading ?? 'Recent Big Wins' }), _jsx("div", { ref: emblaRef, className: twMerge('relative lg:overflow-hidden'), children: _jsx("div", { className: twMerge('flex gap-sm lg:gap-md'), children: topWins.map((topWin) => (_jsxs("div", { className: twMerge('flex w-[calc((100%-(0.375rem*2))/3)] shrink-0 flex-col space-y-2 rounded-sm border border-border-primary bg-bg-tertiary p-2 text-center lg:w-[calc((100%-(0.5rem*5))/6)] xl:w-[calc((100%-(0.5rem*9))/10)]', classNames.card), children: [_jsx("div", { className: twMerge('mx-auto aspect-square w-full', classNames.image), children: topWin.game && (_jsx(Image, { src: getGameImageUrl({
|
|
25
25
|
id: topWin.game.id,
|
|
26
26
|
provider: topWin.game.provider,
|
|
27
|
-
}), alt:
|
|
27
|
+
}), alt: topWin.game.name, width: 120, height: 120, loading: "lazy", unoptimized: true, className: twMerge('size-full rounded-sm object-cover', classNames.image) })) }), _jsxs("div", { className: twMerge('space-y-0.5'), children: [_jsx("div", { className: twMerge('text-text-secondary-700 text-xs', classNames.playerName), children: topWin.member.name }), _jsx("div", { className: twMerge('break-words font-semibold text-sm text-text-primary-brand', classNames.amount), children: formatNumber(topWin.payout, {
|
|
28
28
|
currency: localeInfo.currency.code,
|
|
29
29
|
minDecimalPlaces: 2,
|
|
30
30
|
}) }), _jsxs("div", { className: twMerge('break-words text-text-secondary-700 text-xs', classNames.multiplier), children: [formatNumber(topWin.multiplier, {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function LinkBrokenIcon(props) {
|
|
3
|
+
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", ...props, children: _jsx("path", { d: "M8.5 15.5L15.5 8.49998M9 4V2M15 20V22M4 9H2M20 15H22M4.91421 4.91421L3.5 3.5M19.0858 19.0857L20.5 20.4999M12 17.6568L9.87871 19.7781C8.31662 21.3402 5.78396 21.3402 4.22186 19.7781C2.65976 18.216 2.65976 15.6833 4.22186 14.1212L6.34318 11.9999M17.6569 11.9999L19.7782 9.87859C21.3403 8.31649 21.3403 5.78383 19.7782 4.22174C18.2161 2.65964 15.6835 2.65964 14.1214 4.22174L12 6.34306", stroke: "#FEDF89", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }) }));
|
|
4
|
+
}
|