@opexa/portal-components 0.0.596 → 0.0.598
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/useGlobalStore.d.ts +3 -0
- package/dist/client/hooks/useGlobalStore.js +33 -0
- package/dist/components/Disclaimer/DisclaimerV3.d.ts +1 -0
- package/dist/components/Disclaimer/DisclaimerV3.js +4 -0
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.js +6 -2
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.js +2 -2
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.js +2 -2
- package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.d.ts +1 -0
- package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.js +6 -1
- package/dist/components/Onboarding/Onboarding.d.ts +1 -0
- package/dist/components/Onboarding/Onboarding.js +16 -0
- package/dist/components/Onboarding/OnboardingV1.lazy.d.ts +1 -0
- package/dist/components/Onboarding/OnboardingV1.lazy.js +127 -0
- package/dist/components/Onboarding/index.d.ts +1 -0
- package/dist/components/Onboarding/index.js +1 -0
- package/dist/images/88play-logo.png +0 -0
- package/dist/images/first-step-background.png +0 -0
- package/dist/images/fourth-step-background.png +0 -0
- package/dist/images/second-step-background.png +0 -0
- package/dist/images/third-step-background.png +0 -0
- package/package.json +1 -1
|
@@ -53,6 +53,8 @@ export interface TermsOfUseStore extends TermsAndConditionsStore {
|
|
|
53
53
|
}
|
|
54
54
|
export interface ResponsibleGamingStore extends TermsAndConditionsStore {
|
|
55
55
|
}
|
|
56
|
+
export interface OnboardingStore extends TermsAndConditionsStore {
|
|
57
|
+
}
|
|
56
58
|
export interface ResponsibleGamingReminderStore extends PopupStore {
|
|
57
59
|
}
|
|
58
60
|
export interface HasPendingBonusStore {
|
|
@@ -82,6 +84,7 @@ export interface GlobalStore {
|
|
|
82
84
|
termsAndConditions: TermsAndConditionsStore;
|
|
83
85
|
termsOfUse: TermsOfUseStore;
|
|
84
86
|
responsibleGaming: ResponsibleGamingStore;
|
|
87
|
+
onboarding: OnboardingStore;
|
|
85
88
|
responsibleGamingReminder: ResponsibleGamingReminderStore;
|
|
86
89
|
pendingBonus: HasPendingBonusStore;
|
|
87
90
|
}
|
|
@@ -372,6 +372,39 @@ export const useGlobalStore = create()(devtools(subscribeWithSelector((set) => (
|
|
|
372
372
|
},
|
|
373
373
|
'~touched': false,
|
|
374
374
|
},
|
|
375
|
+
onboarding: {
|
|
376
|
+
open: false,
|
|
377
|
+
setOpen(open) {
|
|
378
|
+
set((prev) => ({
|
|
379
|
+
onboarding: {
|
|
380
|
+
...prev.onboarding,
|
|
381
|
+
open,
|
|
382
|
+
'~touched': true,
|
|
383
|
+
},
|
|
384
|
+
}));
|
|
385
|
+
},
|
|
386
|
+
next: null,
|
|
387
|
+
setNext(next) {
|
|
388
|
+
set((prev) => ({
|
|
389
|
+
onboarding: {
|
|
390
|
+
...prev.onboarding,
|
|
391
|
+
next,
|
|
392
|
+
'~touched': true,
|
|
393
|
+
},
|
|
394
|
+
}));
|
|
395
|
+
},
|
|
396
|
+
accepted: false,
|
|
397
|
+
setAccepted(accepted) {
|
|
398
|
+
set((prev) => ({
|
|
399
|
+
onboarding: {
|
|
400
|
+
...prev.onboarding,
|
|
401
|
+
accepted,
|
|
402
|
+
'~touched': true,
|
|
403
|
+
},
|
|
404
|
+
}));
|
|
405
|
+
},
|
|
406
|
+
'~touched': false,
|
|
407
|
+
},
|
|
375
408
|
responsibleGamingReminder: {
|
|
376
409
|
open: false,
|
|
377
410
|
setOpen(open) {
|
|
@@ -6,5 +6,6 @@ export interface DisclaimerV3Props {
|
|
|
6
6
|
responsibleGamingLogo?: ImageProps['src'];
|
|
7
7
|
pagcorLogo?: ImageProps['src'];
|
|
8
8
|
redirectUrlOnNoConsent?: string;
|
|
9
|
+
openOnboardingOnAgree?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare function DisclaimerV3(props: DisclaimerV3Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -17,6 +17,7 @@ export function DisclaimerV3(props) {
|
|
|
17
17
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
18
18
|
termsOfUse: ctx.termsOfUse,
|
|
19
19
|
responsibleGaming: ctx.responsibleGaming,
|
|
20
|
+
onboarding: ctx.onboarding,
|
|
20
21
|
})));
|
|
21
22
|
const checked = (globalStore.termsOfUse.accepted &&
|
|
22
23
|
globalStore.responsibleGaming.accepted) ||
|
|
@@ -37,6 +38,9 @@ export function DisclaimerV3(props) {
|
|
|
37
38
|
return;
|
|
38
39
|
}
|
|
39
40
|
disclaimer.close();
|
|
41
|
+
if (props.openOnboardingOnAgree) {
|
|
42
|
+
globalStore.onboarding.setOpen(true);
|
|
43
|
+
}
|
|
40
44
|
}, children: "I Agree" }), _jsx(Button, { type: "button", onClick: () => {
|
|
41
45
|
if (props.redirectUrlOnNoConsent) {
|
|
42
46
|
window.location.href = props.redirectUrlOnNoConsent;
|
|
@@ -7,6 +7,7 @@ import Image from 'next/image';
|
|
|
7
7
|
import Link from 'next/link';
|
|
8
8
|
import { useCallback, useEffect, useId, useMemo, useState, } from 'react';
|
|
9
9
|
import { twMerge } from 'tailwind-merge';
|
|
10
|
+
import { useIntersectionObserver } from 'usehooks-ts';
|
|
10
11
|
import { useJackpotPayoutsQuery } from '../../../client/hooks/useJackpotPayoutsQuery.js';
|
|
11
12
|
import { useLocaleInfo } from '../../../client/hooks/useLocaleInfo.js';
|
|
12
13
|
import { ArrowNarrowUpRightIcon } from '../../../icons/ArrowNarrowUpRightIcon.js';
|
|
@@ -27,6 +28,9 @@ import { parseDecimal } from '../../../utils/parseDecimal.js';
|
|
|
27
28
|
import styles from '../Jackpots.module.css';
|
|
28
29
|
import { useJackpotsCarouselItemContext } from './JackpotsCarouselContext.js';
|
|
29
30
|
export function JackpotsCarouselItem({ style, className, viewAllUrl, animate = true, customJackpotChestImage, jackpotProfileShape = 'oval', }) {
|
|
31
|
+
const [ref, inView] = useIntersectionObserver({
|
|
32
|
+
threshold: 0.75,
|
|
33
|
+
});
|
|
30
34
|
const jackpot = useJackpotsCarouselItemContext();
|
|
31
35
|
const jackpotPayoutsQuery = useJackpotPayoutsQuery({
|
|
32
36
|
first: 30,
|
|
@@ -36,7 +40,7 @@ export function JackpotsCarouselItem({ style, className, viewAllUrl, animate = t
|
|
|
36
40
|
},
|
|
37
41
|
},
|
|
38
42
|
}, {
|
|
39
|
-
enabled: typeof window !== 'undefined',
|
|
43
|
+
enabled: typeof window !== 'undefined' && inView,
|
|
40
44
|
});
|
|
41
45
|
const jackpotPayouts = jackpotPayoutsQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
|
|
42
46
|
const latestJackpotPayout = jackpotPayouts[0] ?? [];
|
|
@@ -88,7 +92,7 @@ export function JackpotsCarouselItem({ style, className, viewAllUrl, animate = t
|
|
|
88
92
|
if (jackpot.status === 'DISABLED' && jackpot.drawing !== true) {
|
|
89
93
|
return null;
|
|
90
94
|
}
|
|
91
|
-
return (_jsxs("div", { className: twMerge('relative flex w-full shrink-0 rounded-2xl border border-border-primary bg-bg-tertiary p-3 text-center lg:gap-4 lg:p-5', className?.itemRoot), style: style, children: [_jsxs("div", { className: "relative z-1 flex flex-1 flex-col", children: [_jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsxs("div", { className: "flex w-full flex-col", children: [_jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { children: [isPayingOut ? (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-success-200 bg-utility-success-50 px-2 py-0.5 font-medium text-utility-success-700 text-xs", children: [_jsx("span", { className: "full size-1.5 animate-pulse rounded bg-utility-success-500" }), "Paying Out"] })) : (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-blue-200 bg-utility-blue-50 px-2 py-0.5 font-medium text-utility-blue-700 text-xs", children: [_jsx(ArrowNarrowUpRightIcon, { className: "size-3.5 text-utility-blue-500" }), "Accumulating"] })), _jsx("div", { className: "mt-1 text-left font-medium text-lg text-text-primary-900 lg:mt-5 lg:text-2xl", children: jackpot.name }), _jsx("div", { className: twMerge('mt-1.5 w-fit rounded-md bg-bg-primary px-2 py-1 font-bold text-2xl text-brand-400 lg:mt-2 lg:text-4xl', className?.jackpotAmountRoot), children: formatNumber(jackpotAmount, {
|
|
95
|
+
return (_jsxs("div", { ref: ref, className: twMerge('relative flex w-full shrink-0 rounded-2xl border border-border-primary bg-bg-tertiary p-3 text-center lg:gap-4 lg:p-5', className?.itemRoot), style: style, children: [_jsxs("div", { className: "relative z-1 flex flex-1 flex-col", children: [_jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsxs("div", { className: "flex w-full flex-col", children: [_jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { children: [isPayingOut ? (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-success-200 bg-utility-success-50 px-2 py-0.5 font-medium text-utility-success-700 text-xs", children: [_jsx("span", { className: "full size-1.5 animate-pulse rounded bg-utility-success-500" }), "Paying Out"] })) : (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-blue-200 bg-utility-blue-50 px-2 py-0.5 font-medium text-utility-blue-700 text-xs", children: [_jsx(ArrowNarrowUpRightIcon, { className: "size-3.5 text-utility-blue-500" }), "Accumulating"] })), _jsx("div", { className: "mt-1 text-left font-medium text-lg text-text-primary-900 lg:mt-5 lg:text-2xl", children: jackpot.name }), _jsx("div", { className: twMerge('mt-1.5 w-fit rounded-md bg-bg-primary px-2 py-1 font-bold text-2xl text-brand-400 lg:mt-2 lg:text-4xl', className?.jackpotAmountRoot), children: formatNumber(jackpotAmount, {
|
|
92
96
|
currency: localeInfo.currency.code,
|
|
93
97
|
minDecimalPlaces: 2,
|
|
94
98
|
maxDecimalPlaces: 2,
|
|
@@ -25,7 +25,7 @@ import { JackpotsListItemRules } from './JackpotsListItemRules.js';
|
|
|
25
25
|
import { useJackpotsListItemData } from './useJackpotsListItemData.js';
|
|
26
26
|
export function JackpotsListItemDesktop({ animate = true, customJackpotChestImage, jackpotProfileShape = 'oval', className, ...props }) {
|
|
27
27
|
const jackpot = useJackpotsListItemContext();
|
|
28
|
-
const { jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, getAccumulatingJackpotDescription, } = useJackpotsListItemData();
|
|
28
|
+
const { rootRef, jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, getAccumulatingJackpotDescription, } = useJackpotsListItemData();
|
|
29
29
|
const ProfileIcon = () => jackpotProfileShape === 'oval' ? (_jsxs("div", { className: "relative flex h-18 w-18 items-center justify-center rounded-full bg-bg-tertiary", children: [_jsx(User01Icon, { className: "size-9 text-text-quarterary-500" }), _jsx("div", { className: twMerge('absolute right-0 bottom-0 flex h-6 w-6 items-center justify-center rounded-full border-[1.5px] border-bg-primary bg-yellow-400 font-bold text-brand-950 text-xs', className?.latestPayoutRankRoot), children: "1st" })] })) : (_jsxs("div", { className: "relative grid h-18 w-18", children: [_jsx(StarIcon, { className: "col-start-1 row-start-1 h-full w-full" }), _jsx(User01Icon, { className: "z-10 col-start-1 row-start-1 size-9 place-self-center text-text-quarterary-500" }), _jsx("div", { className: twMerge('-right-0 absolute bottom-0 z-20 flex h-7 w-7 items-center justify-center rounded-full border-[1.5px] border-bg-primary bg-yellow-400 text-center font-bold text-brand-950 text-xs', className?.latestPayoutRankRoot), children: "1st" })] }));
|
|
30
30
|
const PayoutBadge = () => (_jsxs("div", { className: twMerge('flex h-fit w-fit items-center gap-1 rounded-sm border border-utility-brand-200 bg-utility-brand-50 px-2 py-0.5 font-medium text-utility-brand-700 text-xs', className?.latestPayoutBadgeRoot), children: [_jsx(Trophy01Icon, { className: twMerge('size-3.5 text-utility-brand-600', className?.latestPayoutBadgeIcon) }), "Latest Payout"] }));
|
|
31
31
|
const ProgressBar = () => (_jsxs("div", { className: "mt-3 lg:mt-4", children: [_jsxs("div", { className: "mb-1 flex justify-between", children: [_jsx("div", { className: "font-semibold text-text-primary-900 text-xs", children: formatNumber(0, {
|
|
@@ -68,7 +68,7 @@ export function JackpotsListItemDesktop({ animate = true, customJackpotChestImag
|
|
|
68
68
|
if (jackpot.status === 'DISABLED' && jackpot.drawing !== true) {
|
|
69
69
|
return null;
|
|
70
70
|
}
|
|
71
|
-
return (_jsxs("div", { className: twMerge('rounded-2xl border border-border-primary bg-bg-tertiary', className?.itemRoot), children: [_jsxs("div", { style: props.style, className: twMerge('relative flex shrink-0 rounded-2xl p-3 text-center lg:gap-4 lg:p-5'), children: [_jsxs("div", { className: "relative z-1 flex flex-1 flex-col", children: [_jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsxs("div", { className: "flex w-full flex-col", children: [_jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { children: [isPayingOut ? (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-success-200 bg-utility-success-50 px-2 py-0.5 font-medium text-utility-success-700 text-xs", children: [_jsx("span", { className: "full size-1.5 animate-pulse rounded bg-utility-success-500" }), "Paying Out"] })) : (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-blue-200 bg-utility-blue-50 px-2 py-0.5 font-medium text-utility-blue-700 text-xs", children: [_jsx(ArrowNarrowUpRightIcon, { className: "size-3.5 text-utility-blue-500" }), "Accumulating"] })), _jsx("div", { className: "mt-1 text-left font-medium text-lg text-text-primary-900 lg:mt-5 lg:text-2xl", children: jackpot.name }), _jsx("div", { className: twMerge('mt-1.5 w-fit rounded-md bg-bg-primary px-2 py-1 font-bold text-2xl text-brand-400 lg:mt-2 lg:text-4xl', className?.jackpotAmountRoot), children: formatNumber(jackpotAmount, {
|
|
71
|
+
return (_jsxs("div", { ref: rootRef, className: twMerge('rounded-2xl border border-border-primary bg-bg-tertiary', className?.itemRoot), children: [_jsxs("div", { style: props.style, className: twMerge('relative flex shrink-0 rounded-2xl p-3 text-center lg:gap-4 lg:p-5'), children: [_jsxs("div", { className: "relative z-1 flex flex-1 flex-col", children: [_jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsxs("div", { className: "flex w-full flex-col", children: [_jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { children: [isPayingOut ? (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-success-200 bg-utility-success-50 px-2 py-0.5 font-medium text-utility-success-700 text-xs", children: [_jsx("span", { className: "full size-1.5 animate-pulse rounded bg-utility-success-500" }), "Paying Out"] })) : (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-blue-200 bg-utility-blue-50 px-2 py-0.5 font-medium text-utility-blue-700 text-xs", children: [_jsx(ArrowNarrowUpRightIcon, { className: "size-3.5 text-utility-blue-500" }), "Accumulating"] })), _jsx("div", { className: "mt-1 text-left font-medium text-lg text-text-primary-900 lg:mt-5 lg:text-2xl", children: jackpot.name }), _jsx("div", { className: twMerge('mt-1.5 w-fit rounded-md bg-bg-primary px-2 py-1 font-bold text-2xl text-brand-400 lg:mt-2 lg:text-4xl', className?.jackpotAmountRoot), children: formatNumber(jackpotAmount, {
|
|
72
72
|
currency: localeInfo.currency.code,
|
|
73
73
|
minDecimalPlaces: 2,
|
|
74
74
|
maxDecimalPlaces: 2,
|
|
@@ -33,7 +33,7 @@ function getPercentage(value, total) {
|
|
|
33
33
|
}
|
|
34
34
|
export function JackpotsListItemMobile({ animate = true, customJackpotChestImage, jackpotProfileShape = 'oval', className, ...props }) {
|
|
35
35
|
const jackpot = useJackpotsListItemContext();
|
|
36
|
-
const { jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, getAccumulatingJackpotDescription, } = useJackpotsListItemData();
|
|
36
|
+
const { rootRef, jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, getAccumulatingJackpotDescription, } = useJackpotsListItemData();
|
|
37
37
|
const [isDetailsVisible, setIsDetailsVisible] = useState(false);
|
|
38
38
|
const [mainTooltipOpen, setMainTooltipOpen] = useState(false);
|
|
39
39
|
const [minLimitTooltipOpen, setMinLimitTooltipOpen] = useState(false);
|
|
@@ -103,7 +103,7 @@ export function JackpotsListItemMobile({ animate = true, customJackpotChestImage
|
|
|
103
103
|
if (jackpot.status === 'DISABLED' && jackpot.drawing !== true) {
|
|
104
104
|
return null;
|
|
105
105
|
}
|
|
106
|
-
return (_jsxs("div", { className: twMerge('rounded-2xl border border-border-primary bg-bg-primary', className?.itemRoot), children: [_jsxs("div", { style: props.style, className: "relative flex shrink-0 rounded-2xl bg-bg-tertiary p-3 text-center lg:gap-4 lg:p-5", children: [_jsxs("div", { className: "relative z-1 flex flex-1 flex-col", children: [_jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsx("div", { className: "flex w-full flex-col", children: _jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { children: [isPayingOut ? (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-success-200 bg-utility-success-50 px-2 py-0.5 font-medium text-utility-success-700 text-xs", children: [_jsx("span", { className: "full size-1.5 animate-pulse rounded bg-utility-success-500" }), "Paying Out"] })) : (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-blue-200 bg-utility-blue-50 px-2 py-0.5 font-medium text-utility-blue-700 text-xs", children: [_jsx(ArrowNarrowUpRightIcon, { className: "size-3.5 text-utility-blue-500" }), "Accumulating"] })), _jsx("div", { className: "mt-1 text-left font-medium text-lg text-text-primary-900 lg:mt-5 lg:text-2xl", children: jackpot.name }), _jsx("div", { className: twMerge('mt-1.5 w-fit rounded-md bg-bg-primary px-2 py-1 font-bold text-2xl text-brand-400 lg:mt-2 lg:text-4xl', className?.jackpotAmountRoot), children: formatNumber(jackpotAmount, {
|
|
106
|
+
return (_jsxs("div", { ref: rootRef, className: twMerge('rounded-2xl border border-border-primary bg-bg-primary', className?.itemRoot), children: [_jsxs("div", { style: props.style, className: "relative flex shrink-0 rounded-2xl bg-bg-tertiary p-3 text-center lg:gap-4 lg:p-5", children: [_jsxs("div", { className: "relative z-1 flex flex-1 flex-col", children: [_jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsx("div", { className: "flex w-full flex-col", children: _jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { children: [isPayingOut ? (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-success-200 bg-utility-success-50 px-2 py-0.5 font-medium text-utility-success-700 text-xs", children: [_jsx("span", { className: "full size-1.5 animate-pulse rounded bg-utility-success-500" }), "Paying Out"] })) : (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-blue-200 bg-utility-blue-50 px-2 py-0.5 font-medium text-utility-blue-700 text-xs", children: [_jsx(ArrowNarrowUpRightIcon, { className: "size-3.5 text-utility-blue-500" }), "Accumulating"] })), _jsx("div", { className: "mt-1 text-left font-medium text-lg text-text-primary-900 lg:mt-5 lg:text-2xl", children: jackpot.name }), _jsx("div", { className: twMerge('mt-1.5 w-fit rounded-md bg-bg-primary px-2 py-1 font-bold text-2xl text-brand-400 lg:mt-2 lg:text-4xl', className?.jackpotAmountRoot), children: formatNumber(jackpotAmount, {
|
|
107
107
|
currency: localeInfo.currency.code,
|
|
108
108
|
minDecimalPlaces: 2,
|
|
109
109
|
maxDecimalPlaces: 2,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function useJackpotsListItemData(): {
|
|
2
|
+
rootRef: (node?: Element | null) => void;
|
|
2
3
|
jackpotPayouts: import("../../../types").JackpotPayout[];
|
|
3
4
|
topJackpotPayout: import("../../../types").JackpotPayout;
|
|
4
5
|
filteredGameProviders: import("../../../types").GameProviderData[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useMemo } from 'react';
|
|
3
3
|
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { useIntersectionObserver } from 'usehooks-ts';
|
|
4
5
|
import { useJackpotPayoutsQuery } from '../../../client/hooks/useJackpotPayoutsQuery.js';
|
|
5
6
|
import { useLocaleInfo } from '../../../client/hooks/useLocaleInfo.js';
|
|
6
7
|
import { GAME_PROVIDER_DATA } from '../../../constants/index.js';
|
|
@@ -12,6 +13,9 @@ export function useJackpotsListItemData() {
|
|
|
12
13
|
const jackpotsListProps = useJackpotsListPropsContext();
|
|
13
14
|
const jackpot = useJackpotsListItemContext();
|
|
14
15
|
const gameProviders = jackpotsListProps.gameProviders.map((provider) => GAME_PROVIDER_DATA[provider]);
|
|
16
|
+
const [rootRef, inView] = useIntersectionObserver({
|
|
17
|
+
threshold: 0.5,
|
|
18
|
+
});
|
|
15
19
|
const jackpotPayoutsQuery = useJackpotPayoutsQuery({
|
|
16
20
|
first: 30,
|
|
17
21
|
filter: {
|
|
@@ -20,7 +24,7 @@ export function useJackpotsListItemData() {
|
|
|
20
24
|
},
|
|
21
25
|
},
|
|
22
26
|
}, {
|
|
23
|
-
enabled: typeof window !== 'undefined',
|
|
27
|
+
enabled: typeof window !== 'undefined' && inView,
|
|
24
28
|
});
|
|
25
29
|
const jackpotPayouts = jackpotPayoutsQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
|
|
26
30
|
const topJackpotPayout = jackpotPayouts[0] ?? [];
|
|
@@ -52,6 +56,7 @@ export function useJackpotsListItemData() {
|
|
|
52
56
|
: '🔥 It’s about to pop! Stay in the game for your shot at the prize!';
|
|
53
57
|
};
|
|
54
58
|
return {
|
|
59
|
+
rootRef,
|
|
55
60
|
jackpotPayouts,
|
|
56
61
|
topJackpotPayout,
|
|
57
62
|
filteredGameProviders,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Onboarding(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import dynamic from 'next/dynamic';
|
|
4
|
+
import { useShallow } from 'zustand/shallow';
|
|
5
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
6
|
+
const OnboardingV1 = dynamic(() => import('./OnboardingV1.lazy.js').then((m) => m.Onboarding), {
|
|
7
|
+
ssr: false,
|
|
8
|
+
loading: () => null,
|
|
9
|
+
});
|
|
10
|
+
export function Onboarding() {
|
|
11
|
+
const touched = useGlobalStore(useShallow((ctx) => ctx.onboarding['~touched']));
|
|
12
|
+
if (!touched) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return _jsx(OnboardingV1, {});
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Onboarding(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Image from 'next/image';
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { useShallow } from 'zustand/shallow';
|
|
6
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
7
|
+
import firstStepBackground from '../../images/first-step-background.png';
|
|
8
|
+
import fourthStepBackground from '../../images/fourth-step-background.png';
|
|
9
|
+
import secondStepBackground from '../../images/second-step-background.png';
|
|
10
|
+
import thirdStepBackground from '../../images/third-step-background.png';
|
|
11
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
12
|
+
import { Portal } from '../../ui/Portal/index.js';
|
|
13
|
+
const AnimatedHeader = ({ text }) => {
|
|
14
|
+
if (text === '88PLAY') {
|
|
15
|
+
return (_jsx("div", { className: "relative", children: _jsxs("h1", { className: "venus-rising flex items-center font-bold text-4xl drop-shadow-lg", children: [_jsx("span", { className: "text-transparent", style: {
|
|
16
|
+
backgroundImage: 'linear-gradient(to right, #B59440, #6A4C1A, #BD9B4D, #6A4C1A, #B99D47)',
|
|
17
|
+
backgroundSize: '300% 100%',
|
|
18
|
+
animation: 'gradient 8s linear infinite',
|
|
19
|
+
backgroundClip: 'text',
|
|
20
|
+
WebkitBackgroundClip: 'text',
|
|
21
|
+
}, children: "88" }), _jsx("span", { className: "ml-2 text-white", children: "PLAY" })] }) }));
|
|
22
|
+
}
|
|
23
|
+
if (text === 'Secured Transactions') {
|
|
24
|
+
return (_jsx("div", { className: "relative", children: _jsxs("div", { className: "venus-rising text-center font-bold drop-shadow-lg", children: [_jsx("div", { className: "text-4xl text-transparent", style: {
|
|
25
|
+
backgroundImage: 'linear-gradient(to right, #B59440, #6A4C1A, #BD9B4D, #6A4C1A, #B99D47)',
|
|
26
|
+
backgroundSize: '300% 100%',
|
|
27
|
+
animation: 'gradient 8s linear infinite',
|
|
28
|
+
backgroundClip: 'text',
|
|
29
|
+
WebkitBackgroundClip: 'text',
|
|
30
|
+
}, children: "SECURED" }), _jsx("div", { className: "text-3xl text-transparent", style: {
|
|
31
|
+
backgroundImage: 'linear-gradient(to right, #B59440, #6A4C1A, #BD9B4D, #6A4C1A, #B99D47)',
|
|
32
|
+
backgroundSize: '300% 100%',
|
|
33
|
+
animation: 'gradient 8s linear infinite',
|
|
34
|
+
backgroundClip: 'text',
|
|
35
|
+
WebkitBackgroundClip: 'text',
|
|
36
|
+
}, children: "TRANSACTIONS" })] }) }));
|
|
37
|
+
}
|
|
38
|
+
return (_jsx("div", { className: "relative", children: _jsx("h1", { className: "venus-rising font-bold text-4xl text-transparent drop-shadow-lg", style: {
|
|
39
|
+
backgroundImage: 'linear-gradient(to right, #B59440, #6A4C1A, #BD9B4D, #6A4C1A, #B99D47)',
|
|
40
|
+
backgroundSize: '300% 100%',
|
|
41
|
+
animation: 'gradient 8s linear infinite',
|
|
42
|
+
backgroundClip: 'text',
|
|
43
|
+
WebkitBackgroundClip: 'text',
|
|
44
|
+
}, children: text }) }));
|
|
45
|
+
};
|
|
46
|
+
const carouselData = [
|
|
47
|
+
{
|
|
48
|
+
background: firstStepBackground,
|
|
49
|
+
headerText: '88PLAY',
|
|
50
|
+
description: 'Welcome to 88Play! your trusted PAGCOR-licensed online casino where every player is treated like a VIP and the fun never stops!',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
background: secondStepBackground,
|
|
54
|
+
headerText: 'NEW GAMES',
|
|
55
|
+
description: 'Discover our latest casino titles, bringing you fresh excitement and more ways to win every time you play.',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
background: thirdStepBackground,
|
|
59
|
+
headerText: 'Secured Transactions',
|
|
60
|
+
description: 'Enjoy fast, secure, and hassle-free deposits and withdrawals with trusted local payment options.',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
background: fourthStepBackground,
|
|
64
|
+
headerText: 'Bonuses',
|
|
65
|
+
description: 'Unlock exciting rewards and exclusive promotions designed to boost your gaming experience.',
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
const CardStepper = ({ data }) => {
|
|
69
|
+
return (_jsxs("div", { className: "w-full", children: [_jsx("div", { className: "h-auto w-full", children: _jsx(Image, { src: data.background, alt: "Step Background", className: "h-auto w-full object-cover" }) }), _jsx("div", { className: "mt-4 flex h-auto w-full items-center justify-center", children: _jsx(AnimatedHeader, { text: data.headerText }) }), _jsx("div", { className: "mt-4 px-5 text-center text-sm text-white/50", children: data.description })] }));
|
|
70
|
+
};
|
|
71
|
+
const OnboardingCarousel = () => {
|
|
72
|
+
const [currentStep, setCurrentStep] = useState(0);
|
|
73
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
74
|
+
onboarding: ctx.onboarding,
|
|
75
|
+
})));
|
|
76
|
+
const nextStep = () => {
|
|
77
|
+
setCurrentStep((prev) => (prev + 1) % carouselData.length);
|
|
78
|
+
};
|
|
79
|
+
const goToStep = (step) => {
|
|
80
|
+
setCurrentStep(step);
|
|
81
|
+
};
|
|
82
|
+
const handleContinue = () => {
|
|
83
|
+
if (currentStep === carouselData.length - 1) {
|
|
84
|
+
// Last step - close dialog
|
|
85
|
+
globalStore.onboarding.setOpen(false);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
// Not last step - go to next
|
|
89
|
+
nextStep();
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const handleSkip = () => {
|
|
93
|
+
// Skip always closes dialog
|
|
94
|
+
globalStore.onboarding.setOpen(false);
|
|
95
|
+
};
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
const interval = setInterval(() => {
|
|
98
|
+
setCurrentStep((prev) => (prev + 1) % carouselData.length);
|
|
99
|
+
}, 5000);
|
|
100
|
+
return () => clearInterval(interval);
|
|
101
|
+
}, []);
|
|
102
|
+
return (_jsxs("div", { className: "mb-5 w-full", children: [_jsx("div", { className: "relative overflow-hidden", children: _jsx("div", { className: "flex transition-transform duration-300 ease-in-out", style: { transform: `translateX(-${currentStep * 100}%)` }, children: carouselData.map((stepData, index) => (_jsx("div", { className: "w-full flex-shrink-0", children: _jsx(CardStepper, { data: stepData }) }, index))) }) }), _jsx("div", { className: "mt-4 flex justify-center px-5", children: _jsx("div", { className: "flex space-x-2", children: carouselData.map((_, index) => (_jsx("button", { type: "button", onClick: () => goToStep(index), className: twMerge('h-2 rounded-full transition-all duration-300', index === currentStep ? 'w-5 bg-yellow-400' : 'w-2 bg-white/30'), "aria-label": `Go to step ${index + 1}` }, index))) }) }), _jsxs("div", { className: "mt-6 flex gap-3 px-5", children: [_jsx("button", { type: "button", onClick: handleSkip, className: "flex-1 rounded-lg border border-yellow-400/50 bg-transparent py-3 font-medium text-sm text-yellow-400 hover:bg-yellow-400/10", children: "Skip" }), _jsx("button", { type: "button", onClick: handleContinue, className: "flex-1 rounded-lg bg-yellow-400 py-3 font-medium text-black text-sm hover:bg-yellow-500", children: currentStep === carouselData.length - 1 ? 'Play Now' : 'Continue' })] })] }));
|
|
103
|
+
};
|
|
104
|
+
export function Onboarding() {
|
|
105
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
106
|
+
signIn: ctx.signIn,
|
|
107
|
+
signUp: ctx.signUp,
|
|
108
|
+
disclaimer: ctx.disclaimer,
|
|
109
|
+
onboarding: ctx.onboarding,
|
|
110
|
+
})));
|
|
111
|
+
return (_jsx(Dialog.Root, { open: globalStore.onboarding.open, onOpenChange: (details) => {
|
|
112
|
+
globalStore.onboarding.setOpen(details.open);
|
|
113
|
+
if (!details.open)
|
|
114
|
+
globalStore.onboarding.setAccepted(true);
|
|
115
|
+
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: () => {
|
|
116
|
+
if (globalStore.onboarding.next === 'SIGN_IN') {
|
|
117
|
+
globalStore.signIn.setOpen(true);
|
|
118
|
+
}
|
|
119
|
+
if (globalStore.onboarding.next === 'SIGN_UP') {
|
|
120
|
+
globalStore.signUp.setOpen(true);
|
|
121
|
+
}
|
|
122
|
+
if (globalStore.onboarding.next === 'DISCLAIMER') {
|
|
123
|
+
globalStore.disclaimer.setOpen(true);
|
|
124
|
+
}
|
|
125
|
+
globalStore.onboarding.setNext(null);
|
|
126
|
+
}, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "z-popover" }), _jsx(Dialog.Positioner, { className: "z-popover", children: _jsx(Dialog.Content, { className: twMerge('flex h-full w-full flex-col items-start overflow-y-auto lg:mx-auto lg:h-auto lg:max-h-[80vh] lg:w-[400px]', 'scrollbar:h-2 scrollbar:w-2 scrollbar-thumb:rounded-full scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent'), children: _jsx(OnboardingCarousel, {}) }) })] }) }));
|
|
127
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Onboarding';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Onboarding.js';
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|