@opexa/portal-components 0.0.727 → 0.0.728
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/useJackpotsNextQuery.d.ts +3 -0
- package/dist/client/hooks/useJackpotsNextQuery.js +22 -0
- package/dist/components/Jackpots/Jackpots.js +13 -0
- package/dist/components/Jackpots/Jackpots.module.css +35 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsList.d.ts +16 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsList.js +7 -0
- package/dist/components/Jackpots/JackpotsListNext/JackpotMultiStageDesktop.d.ts +33 -0
- package/dist/components/Jackpots/JackpotsListNext/JackpotMultiStageDesktop.js +107 -0
- package/dist/components/Jackpots/JackpotsListNext/JackpotMultiStageMobile.d.ts +55 -0
- package/dist/components/Jackpots/JackpotsListNext/JackpotMultiStageMobile.js +136 -0
- package/dist/components/Jackpots/JackpotsListNext/JackpotsList.d.ts +106 -0
- package/dist/components/Jackpots/JackpotsListNext/JackpotsList.js +51 -0
- package/dist/components/Jackpots/JackpotsListNext/JackpotsListContext.d.ts +12 -0
- package/dist/components/Jackpots/JackpotsListNext/JackpotsListContext.js +3 -0
- package/dist/components/Jackpots/JackpotsListNext/JackpotsListItemDesktop.d.ts +43 -0
- package/dist/components/Jackpots/JackpotsListNext/JackpotsListItemDesktop.js +117 -0
- package/dist/components/Jackpots/JackpotsListNext/JackpotsListItemGameProviders.d.ts +5 -0
- package/dist/components/Jackpots/JackpotsListNext/JackpotsListItemGameProviders.js +54 -0
- package/dist/components/Jackpots/JackpotsListNext/JackpotsListItemMobile.d.ts +43 -0
- package/dist/components/Jackpots/JackpotsListNext/JackpotsListItemMobile.js +147 -0
- package/dist/components/Jackpots/JackpotsListNext/JackpotsListItemRules.d.ts +8 -0
- package/dist/components/Jackpots/JackpotsListNext/JackpotsListItemRules.js +15 -0
- package/dist/components/Jackpots/JackpotsListNext/useJackpotsListItemData.d.ts +20 -0
- package/dist/components/Jackpots/JackpotsListNext/useJackpotsListItemData.js +88 -0
- package/dist/icons/Flag05Icon.d.ts +2 -0
- package/dist/icons/Flag05Icon.js +4 -0
- package/dist/server/utils/prefetchJackpotsNextQuery.d.ts +2 -0
- package/dist/server/utils/prefetchJackpotsNextQuery.js +16 -0
- package/dist/services/queries.d.ts +2 -1
- package/dist/services/queries.js +60 -0
- package/dist/services/report.d.ts +21 -1
- package/dist/services/report.js +13 -1
- package/dist/types/index.d.ts +33 -0
- package/dist/ui/AlertDialog/AlertDialog.d.ts +55 -55
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +5 -5
- 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/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 +198 -198
- package/dist/ui/Menu/menu.recipe.d.ts +11 -11
- package/dist/ui/Popover/Popover.d.ts +55 -55
- package/dist/ui/Popover/popover.recipe.d.ts +5 -5
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.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/queryKeys.d.ts +1 -0
- package/dist/utils/queryKeys.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useInfiniteQuery } from '@tanstack/react-query';
|
|
2
|
+
import { getJackpotsNext } from '../../services/report.js';
|
|
3
|
+
import { getJackpotsNextQueryKey } from '../../utils/queryKeys.js';
|
|
4
|
+
export const useJackpotsNextQuery = (input, config) => {
|
|
5
|
+
const query = useInfiniteQuery({
|
|
6
|
+
refetchOnMount: false,
|
|
7
|
+
refetchOnReconnect: false,
|
|
8
|
+
refetchOnWindowFocus: false,
|
|
9
|
+
...config,
|
|
10
|
+
queryKey: getJackpotsNextQueryKey(input),
|
|
11
|
+
queryFn: ({ pageParam, signal }) => {
|
|
12
|
+
return getJackpotsNext({ ...input, after: pageParam }, { signal });
|
|
13
|
+
},
|
|
14
|
+
initialPageParam: undefined,
|
|
15
|
+
getNextPageParam(lastPage) {
|
|
16
|
+
if (lastPage?.pageInfo.hasNextPage) {
|
|
17
|
+
return lastPage.pageInfo.endCursor;
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
return query;
|
|
22
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { prefetchJackpotsNextQuery } from '../../server/utils/prefetchJackpotsNextQuery.js';
|
|
2
3
|
import { prefetchJackpotsQuery } from '../../server/utils/prefetchJackpotsQuery.js';
|
|
3
4
|
import { JackpotsCarousel, } from './JackpotsCarousel/JackpotsCarousel.js';
|
|
4
5
|
import { JackpotsList, } from './JackpotsList/JackpotsList.js';
|
|
@@ -15,6 +16,18 @@ export async function Jackpots(props) {
|
|
|
15
16
|
order: 'DESC',
|
|
16
17
|
},
|
|
17
18
|
});
|
|
19
|
+
await prefetchJackpotsNextQuery({
|
|
20
|
+
first: 100,
|
|
21
|
+
filter: {
|
|
22
|
+
deleted: {
|
|
23
|
+
equal: false,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
sort: {
|
|
27
|
+
cursor: 'POOL',
|
|
28
|
+
order: 'DESC',
|
|
29
|
+
},
|
|
30
|
+
});
|
|
18
31
|
if (props.layout === 'carousel') {
|
|
19
32
|
return _jsx(JackpotsCarousel, { ...props });
|
|
20
33
|
}
|
|
@@ -182,3 +182,38 @@
|
|
|
182
182
|
--wave-highlight-color: var(--color-error-600);
|
|
183
183
|
animation: waveColor 4s ease-in-out infinite;
|
|
184
184
|
}
|
|
185
|
+
.animate-multi-stage-gradient-blucky {
|
|
186
|
+
@apply overflow-hidden;
|
|
187
|
+
}
|
|
188
|
+
.animate-multi-stage-gradient-blucky::after {
|
|
189
|
+
content: "";
|
|
190
|
+
position: absolute;
|
|
191
|
+
top: 0;
|
|
192
|
+
left: 0;
|
|
193
|
+
width: 100%;
|
|
194
|
+
height: 1000%; /* equivalent to $bg_h = $show_h * 10 */
|
|
195
|
+
background: linear-gradient(
|
|
196
|
+
-45deg,
|
|
197
|
+
rgb(96, 53, 2) 0%,
|
|
198
|
+
rgb(252, 143, 0) 20%,
|
|
199
|
+
rgb(198, 32, 28) 40%,
|
|
200
|
+
rgb(251, 222, 78) 60%,
|
|
201
|
+
rgb(147, 45, 9) 80%,
|
|
202
|
+
rgb(107, 14, 14) 100%
|
|
203
|
+
);
|
|
204
|
+
animation: animate 17.5s infinite;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
@keyframes animate {
|
|
208
|
+
0% {
|
|
209
|
+
top: 0;
|
|
210
|
+
}
|
|
211
|
+
50% {
|
|
212
|
+
top: -900%; /* 100% - 1000% */
|
|
213
|
+
}
|
|
214
|
+
100% {
|
|
215
|
+
top: 0;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
|
|
@@ -10,6 +10,9 @@ export interface ClassNameEntries {
|
|
|
10
10
|
providerThumbnailRoot?: string;
|
|
11
11
|
providerThumbnailImage?: string;
|
|
12
12
|
jackpotAmountRoot?: string;
|
|
13
|
+
jackpotTurnoverRoot?: string;
|
|
14
|
+
jackpotTurnoverIcon?: string;
|
|
15
|
+
jackpotBadgeRoot?: string;
|
|
13
16
|
latestPayoutRoot?: string;
|
|
14
17
|
latestPayoutBadgeRoot?: string;
|
|
15
18
|
latestPayoutBadgeIcon?: string;
|
|
@@ -28,6 +31,7 @@ export interface ClassNameEntries {
|
|
|
28
31
|
interface StyleEntries {
|
|
29
32
|
root?: CSSProperties;
|
|
30
33
|
itemRoot?: CSSProperties;
|
|
34
|
+
multiStageItemRoot?: CSSProperties;
|
|
31
35
|
}
|
|
32
36
|
export interface JackpotsListProps {
|
|
33
37
|
layout: 'list';
|
|
@@ -50,6 +54,18 @@ export interface JackpotsListProps {
|
|
|
50
54
|
image?: string;
|
|
51
55
|
};
|
|
52
56
|
};
|
|
57
|
+
customJackpotStageChest?: {
|
|
58
|
+
style?: {
|
|
59
|
+
wrapper?: string;
|
|
60
|
+
image?: string;
|
|
61
|
+
};
|
|
62
|
+
stage: {
|
|
63
|
+
one: ImageProps['src'];
|
|
64
|
+
two: ImageProps['src'];
|
|
65
|
+
three: ImageProps['src'];
|
|
66
|
+
four: ImageProps['src'];
|
|
67
|
+
};
|
|
68
|
+
};
|
|
53
69
|
jackpotProfileShape?: 'oval' | 'star';
|
|
54
70
|
chestImagesByTier?: {
|
|
55
71
|
grand?: {
|
|
@@ -3,9 +3,11 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
import { isString } from 'lodash-es';
|
|
4
4
|
import Image, {} from 'next/image';
|
|
5
5
|
import { useIntersectionObserver } from 'usehooks-ts';
|
|
6
|
+
import { useFeatureFlag } from '../../../client/hooks/useFeatureFlag.js';
|
|
6
7
|
import { useJackpotsQuery } from '../../../client/hooks/useJackpotsQuery.js';
|
|
7
8
|
import closeChest from '../../../images/close-chest.png';
|
|
8
9
|
import { isStyleEntries } from '../../../utils/isStyleEntries.js';
|
|
10
|
+
import { JackpotsListNext } from '../JackpotsListNext/JackpotsList.js';
|
|
9
11
|
import { JackpotsListItemContext, JackpotsListPropsContext, } from './JackpotsListContext.js';
|
|
10
12
|
import { JackpotsListItemDesktop } from './JackpotsListItemDesktop.js';
|
|
11
13
|
import { JackpotsListItemMobile } from './JackpotsListItemMobile.js';
|
|
@@ -13,6 +15,7 @@ export function JackpotsList(props) {
|
|
|
13
15
|
const [ref, inView] = useIntersectionObserver({
|
|
14
16
|
threshold: 0.25,
|
|
15
17
|
});
|
|
18
|
+
const future = useFeatureFlag();
|
|
16
19
|
const jackpotsQuery = useJackpotsQuery({
|
|
17
20
|
first: 100,
|
|
18
21
|
filter: {
|
|
@@ -26,6 +29,7 @@ export function JackpotsList(props) {
|
|
|
26
29
|
},
|
|
27
30
|
}, {
|
|
28
31
|
refetchInterval: inView ? 10_000 : false,
|
|
32
|
+
enabled: !future.enabled,
|
|
29
33
|
});
|
|
30
34
|
const jackpots = jackpotsQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
|
|
31
35
|
const styles = isStyleEntries(props.style, ['root', 'itemRoot'])
|
|
@@ -34,5 +38,8 @@ export function JackpotsList(props) {
|
|
|
34
38
|
const classNames = isString(props.className)
|
|
35
39
|
? { root: props.className }
|
|
36
40
|
: (props.className ?? {});
|
|
41
|
+
console.log('future', future.enabled);
|
|
42
|
+
if (future.enabled)
|
|
43
|
+
return _jsx(JackpotsListNext, { ...props });
|
|
37
44
|
return (_jsx(JackpotsListPropsContext, { value: props, children: _jsxs("div", { ref: ref, style: styles.root, className: classNames.root, children: [_jsx("div", { className: "mb-3 font-semibold text-lg lg:mb-4.5", children: props.heading ?? 'Jackpots' }), jackpots.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "hidden flex-col gap-6 lg:flex", children: jackpots.map((jackpot, index) => (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotsListItemDesktop, { style: styles.itemRoot, className: classNames, animate: props.animate, customJackpotChestImage: props.customJackpotChestImage, jackpotProfileShape: props.jackpotProfileShape, chestImagesByTier: props.chestImagesByTier }) }, index))) }), _jsx("div", { className: "flex flex-col gap-6 lg:hidden", children: jackpots.map((jackpot, index) => (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotsListItemMobile, { style: styles.itemRoot, className: classNames, animate: props.animate, customJackpotChestImage: props.customJackpotChestImage, jackpotProfileShape: props.jackpotProfileShape, chestImagesByTier: props.chestImagesByTier }) }, index))) })] })) : (_jsxs("div", { className: "mt-5 flex h-fit flex-col items-center justify-center lg:mt-0 lg:h-62", children: [_jsx(Image, { width: 100, height: 100, src: closeChest, alt: "closeChest", className: "size-full h-29.5 w-29.5 mix-blend-luminosity lg:h-25 lg:w-25" }), _jsx("div", { className: "mt-4 font-semibold text-base text-text-primary-900", children: "No Jackpots" }), _jsxs("div", { className: "mt-1 text-center text-sm text-text-tertiary-600", children: ["No jackpots are running at the moment. ", _jsx("br", {}), "Please check back later!"] })] }))] }) }));
|
|
38
45
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ImageProps } from 'next/image';
|
|
2
|
+
import type { CSSProperties } from 'react';
|
|
3
|
+
import type { ClassNameEntries } from './JackpotsList';
|
|
4
|
+
interface JackpotsListItemDesktopProps {
|
|
5
|
+
className?: ClassNameEntries;
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
animate?: boolean;
|
|
8
|
+
customJackpotChestImage?: {
|
|
9
|
+
image: {
|
|
10
|
+
open: string;
|
|
11
|
+
closed: string;
|
|
12
|
+
};
|
|
13
|
+
style?: {
|
|
14
|
+
wrapper?: string;
|
|
15
|
+
image?: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
customJackpotStageChest?: {
|
|
19
|
+
style?: {
|
|
20
|
+
wrapper?: string;
|
|
21
|
+
image?: string;
|
|
22
|
+
};
|
|
23
|
+
stage: {
|
|
24
|
+
one: ImageProps['src'];
|
|
25
|
+
two: ImageProps['src'];
|
|
26
|
+
three: ImageProps['src'];
|
|
27
|
+
four: ImageProps['src'];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
jackpotProfileShape?: 'oval' | 'star';
|
|
31
|
+
}
|
|
32
|
+
export declare function JackpotMultiStageDesktop({ animate, customJackpotChestImage, jackpotProfileShape, customJackpotStageChest, className, ...props }: JackpotsListItemDesktopProps): import("react/jsx-runtime").JSX.Element | null;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Progress } from '@ark-ui/react/progress';
|
|
3
|
+
import { format } from 'date-fns';
|
|
4
|
+
import Image, {} from 'next/image';
|
|
5
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
|
+
import { ArrowNarrowUpRightIcon } from '../../../icons/ArrowNarrowUpRightIcon.js';
|
|
7
|
+
import { CheckCircleBrokenIcon } from '../../../icons/CheckCircleBrokenIcon.js';
|
|
8
|
+
import { Flag05Icon } from '../../../icons/Flag05Icon.js';
|
|
9
|
+
import { StarIcon } from '../../../icons/StarIcon.js';
|
|
10
|
+
import { Target04Icon } from '../../../icons/Target04Icon.js';
|
|
11
|
+
import { Trophy01Icon } from '../../../icons/Trophy01Icon.js';
|
|
12
|
+
import { User01Icon } from '../../../icons/User01Icon.js';
|
|
13
|
+
import firstPlace from '../../../images/first-place.png';
|
|
14
|
+
import leaderboard from '../../../images/leaderboard.png';
|
|
15
|
+
import { formatNumber } from '../../../utils/formatNumber.js';
|
|
16
|
+
import { mask } from '../../../utils/mask.js';
|
|
17
|
+
import { parseDecimal } from '../../../utils/parseDecimal.js';
|
|
18
|
+
import styles from '../Jackpots.module.css';
|
|
19
|
+
import { useJackpotsListItemContext } from './JackpotsListContext.js';
|
|
20
|
+
import { JackpotsListItemGameProviders } from './JackpotsListItemGameProviders.js';
|
|
21
|
+
import { JackpotsListItemRules } from './JackpotsListItemRules.js';
|
|
22
|
+
import { useJackpotsListItemData } from './useJackpotsListItemData.js';
|
|
23
|
+
export function JackpotMultiStageDesktop({ animate = true, customJackpotChestImage, jackpotProfileShape = 'oval', customJackpotStageChest, className, ...props }) {
|
|
24
|
+
const jackpot = useJackpotsListItemContext();
|
|
25
|
+
const { rootRef, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, } = useJackpotsListItemData();
|
|
26
|
+
const getChestImages = (stage) => {
|
|
27
|
+
if (stage === 1) {
|
|
28
|
+
return {
|
|
29
|
+
image: customJackpotStageChest?.stage.one,
|
|
30
|
+
style: customJackpotStageChest?.style,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (stage === 2) {
|
|
34
|
+
return {
|
|
35
|
+
image: customJackpotStageChest?.stage.two,
|
|
36
|
+
style: customJackpotStageChest?.style,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
if (stage === 3) {
|
|
40
|
+
return {
|
|
41
|
+
image: customJackpotStageChest?.stage.three,
|
|
42
|
+
style: customJackpotStageChest?.style,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
image: customJackpotStageChest?.stage.four,
|
|
47
|
+
style: customJackpotStageChest?.style,
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
const chestImages = getChestImages(jackpot.stage ?? 1);
|
|
51
|
+
const target = parseFloat(jackpot.stages?.[jackpot.stage]?.targetTurnover ?? '0');
|
|
52
|
+
const total = parseFloat(jackpot.totalTurnover ?? '0');
|
|
53
|
+
const currStageProgressPercentage = getPercentage(total, target);
|
|
54
|
+
const totalTurnover = jackpot.totalTurnover;
|
|
55
|
+
const overallTurnover = parseDecimal(jackpot.totalTurnover, 0) /
|
|
56
|
+
(jackpot.stages?.reduce((acc, stage) => acc + parseFloat(stage.targetTurnover ?? '0'), 0) ?? 0);
|
|
57
|
+
const overallPercentage = getPercentage(totalTurnover, overallTurnover);
|
|
58
|
+
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-safe-area-inset-bottom 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-safe-area-inset-bottom 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" })] }));
|
|
59
|
+
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) }), "Winner"] }));
|
|
60
|
+
const ProgressBar = () => (_jsxs("div", { className: "mt-3 lg:mt-4", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "font-semibold text-sm text-text-primary-900", children: ["Stage ", jackpot.stage, " Progress"] }), currStageProgressPercentage, "%"] }), _jsx(Progress.Root, { className: "h-2 w-full rounded-full bg-bg-primary lg:h-4", max: 100, value: currStageProgressPercentage, children: _jsx(Progress.Track, { className: twMerge('h-full overflow-hidden rounded-full bg-bg-primary', className?.progressBarTrack), children: _jsx(Progress.Range, { className: "relative h-full overflow-hidden rounded-full bg-brand-500 pl-1.5", children: _jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-start pl-1.5", "aria-hidden": "true", children: arrowImages }) }) }) })] }));
|
|
61
|
+
const OverallProgressBar = () => {
|
|
62
|
+
return (_jsxs("div", { className: "mt-3 lg:mt-4", children: [_jsxs("div", { className: "mb-[5px] flex items-center justify-between font-semibold text-sm text-text-primary-900", children: [_jsx("p", { children: "Overall Progress" }), overallPercentage, "%"] }), _jsx(Progress.Root, { className: "h-2 w-full rounded-full bg-bg-primary lg:h-4", max: 100, value: overallPercentage, children: _jsx(Progress.Track, { className: twMerge('h-full overflow-hidden rounded-full bg-bg-primary', className?.progressBarTrack), children: _jsx(Progress.Range, { className: "relative h-full overflow-hidden rounded-full bg-brand-500 pl-1.5", children: _jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-start pl-1.5", "aria-hidden": "true", children: arrowImages }) }) }) })] }));
|
|
63
|
+
};
|
|
64
|
+
const RecentPayoutsTable = () => (_jsx("div", { className: twMerge('max-h-[17rem] overflow-y-scroll', styles.scrollArea), children: _jsx("div", { className: "overflow-hidden rounded-xl border-gray-200", children: _jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsx("tr", { className: twMerge('h-8 whitespace-nowrap bg-bg-secondary text-left font-medium text-text-tertiary-600 text-xs', className?.recentPayoutsTableHeadRow), children: ['Stage', 'Player', 'Turnover Target', 'Prize', 'Timestamp'].map((header) => (_jsx("th", { className: "px-4", children: header }, header))) }) }), _jsx("tbody", { children: jackpot.stages
|
|
65
|
+
? jackpot.stages.map((j, i) => (_jsxs("tr", { className: twMerge('whitespace-nowrap bg-bg-primary text-left text-sm text-text-secondary-700', className?.recentPayoutsTableBodyRow), children: [_jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: i + 1 }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: j.member?.name
|
|
66
|
+
? mask(j.member.name, {
|
|
67
|
+
totalCharsCount: 6,
|
|
68
|
+
})
|
|
69
|
+
: '-' }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: formatNumber(j.targetTurnover, {
|
|
70
|
+
currency: localeInfo.currency.code,
|
|
71
|
+
minDecimalPlaces: 2,
|
|
72
|
+
maxDecimalPlaces: 2,
|
|
73
|
+
}) }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4 text-brand-400', className?.recentPayoutsTableBodyData), children: formatNumber(j.jackpotPayout, {
|
|
74
|
+
currency: localeInfo.currency.code,
|
|
75
|
+
minDecimalPlaces: 2,
|
|
76
|
+
maxDecimalPlaces: 2,
|
|
77
|
+
}) }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: j.dateTimeCompleted
|
|
78
|
+
? format(new Date(j.dateTimeCompleted), 'dd MMM yyyy h:mm a')
|
|
79
|
+
: '-' })] }, i)))
|
|
80
|
+
: Array.from({ length: 10 }).map((_, i) => (_jsx("tr", { className: twMerge('bg-bg-primary text-sm text-text-secondary-700', className?.recentPayoutsTableBodyRow), children: Array.from({ length: 5 }).map((_, j) => (_jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2', className?.recentPayoutsTableBodyData), children: "-" }, j))) }, i))) })] }) }) }));
|
|
81
|
+
if (jackpot.status === 'DISABLED' && jackpot.drawing !== true) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
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', window.location.href.includes('blucky') &&
|
|
85
|
+
styles['animate-multi-stage-gradient-blucky']), 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: [_jsxs("div", { className: "flex gap-2.5", children: [_jsxs("div", { className: twMerge('flex w-fit items-center gap-1 rounded-full border border-[#3F100B] bg-[#CDA95B] px-2 py-0.5 font-medium text-[#1D0201] text-xs', className?.jackpotBadgeRoot), children: [_jsx(Flag05Icon, { className: "size-3.5 text-[inherit]" }), "Stage ", jackpot.stage] }), overallPercentage < 100 ? (_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" }), "In Progress"] })) : (_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(CheckCircleBrokenIcon, { className: "size-3.5 text-utility-success-500" }), "Completed"] }))] }), _jsx("div", { className: "mt-1 text-left font-semibold 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, {
|
|
86
|
+
currency: localeInfo.currency.code,
|
|
87
|
+
minDecimalPlaces: 2,
|
|
88
|
+
maxDecimalPlaces: 2,
|
|
89
|
+
}) }), _jsxs("div", { className: twMerge('mt-[1.0625rem] flex w-fit items-center gap-1 rounded-full border border-[#932F19] bg-[#511C10] py-[0.125rem] pr-[0.5rem] pl-[0.375rem] text-[#F7B27A] text-xs', className?.jackpotTurnoverRoot), children: [_jsx(Target04Icon, { className: twMerge('size-3.5 text-[#EF6820]', className?.jackpotTurnoverIcon) }), _jsxs("p", { children: ["Turnover Target:", ' ', formatNumber(jackpot.stages?.[jackpot.stage]?.targetTurnover, {
|
|
90
|
+
currency: localeInfo.currency.code,
|
|
91
|
+
minDecimalPlaces: 2,
|
|
92
|
+
maxDecimalPlaces: 2,
|
|
93
|
+
})] })] })] }), _jsx("div", { className: "min-w-30" }), chestImages.image && (_jsx("div", { className: twMerge('right-0 bottom-[-60] z-1 min-w-30 lg:absolute', chestImages?.style?.wrapper), children: _jsx(Image, { width: 150, height: 150, src: chestImages.image, alt: "chest", className: twMerge('size-full h-25 w-25 p-2 lg:h-37.5 lg:w-37.5', chestImages?.style?.image) }) }))] }), _jsx("div", { className: twMerge('relative mt-4 hidden w-full gap-4 rounded-lg bg-bg-primary p-4 lg:flex', className?.latestPayoutRoot), children: topJackpotPayout?.amount ? (_jsxs(_Fragment, { children: [_jsx(ProfileIcon, {}), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsx(PayoutBadge, {}), _jsx("div", { className: "font-semibold", children: mask(topJackpotPayout.member.name, {
|
|
94
|
+
totalCharsCount: 6,
|
|
95
|
+
}) }), _jsx("div", { className: twMerge('text-2xl text-brand-400', className?.latestPayoutAmount), children: formatNumber(topJackpotPayout.amount, {
|
|
96
|
+
currency: localeInfo.currency.code,
|
|
97
|
+
minDecimalPlaces: 2,
|
|
98
|
+
maxDecimalPlaces: 2,
|
|
99
|
+
}) })] })] })) : (_jsxs(_Fragment, { children: [_jsx(Image, { width: 66, height: 87, src: firstPlace, alt: "firstPlace", className: "size-full h-auto w-[4.125rem] mix-blend-luminosity" }), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsx(PayoutBadge, {}), _jsx("div", { className: "font-semibold", children: "No winners yet" }), _jsx("div", { className: "text-text-secondary-700 text-xs", children: "You could be the first to win the jackpot!" })] })] })) })] }) }) }), _jsx(ProgressBar, {})] }), _jsxs("div", { className: "z-1 hidden flex-1 space-y-4 lg:block", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex gap-2", children: [_jsx(Image, { width: 24, height: 24, src: leaderboard, alt: "leaderboardIcon", className: "size-full h-auto w-6" }), _jsx("div", { className: twMerge('font-semibold text-lg text-text-primary-900', className?.recentPayoutsHeading), children: "Stages" })] }), _jsx(JackpotsListItemRules, { className: {
|
|
100
|
+
button: className?.recentPayoutsJackpotRulesButton,
|
|
101
|
+
} })] }), _jsx(OverallProgressBar, {}), _jsx(RecentPayoutsTable, {})] }), isPayingOut && animate && (_jsx("div", { className: twMerge(styles['light-rays'], 'absolute top-safe-area-inset-top right-0 rounded-2xl') }))] }), Boolean(filteredGameProviders.length) && (_jsx(JackpotsListItemGameProviders, { gameProviders: filteredGameProviders }))] }));
|
|
102
|
+
}
|
|
103
|
+
function getPercentage(value, total) {
|
|
104
|
+
const v = parseDecimal(value, 0);
|
|
105
|
+
const t = parseDecimal(total, 0);
|
|
106
|
+
return t === 0 ? 0 : (v / t) * 100;
|
|
107
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type ImageProps } from 'next/image';
|
|
2
|
+
import { type CSSProperties } from 'react';
|
|
3
|
+
import type { ClassNameEntries } from './JackpotsList';
|
|
4
|
+
interface JackpotsListItemMobileProps {
|
|
5
|
+
className?: ClassNameEntries;
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
animate?: boolean;
|
|
8
|
+
customJackpotChestImage?: {
|
|
9
|
+
image: {
|
|
10
|
+
open: string;
|
|
11
|
+
closed: string;
|
|
12
|
+
};
|
|
13
|
+
style?: {
|
|
14
|
+
wrapper?: string;
|
|
15
|
+
image?: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
customJackpotStageChest?: {
|
|
19
|
+
style?: {
|
|
20
|
+
wrapper?: string;
|
|
21
|
+
image?: string;
|
|
22
|
+
};
|
|
23
|
+
stage: {
|
|
24
|
+
one: ImageProps['src'];
|
|
25
|
+
two: ImageProps['src'];
|
|
26
|
+
three: ImageProps['src'];
|
|
27
|
+
four: ImageProps['src'];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
chestImagesByTier?: {
|
|
31
|
+
grand?: {
|
|
32
|
+
open: ImageProps['src'];
|
|
33
|
+
closed: ImageProps['src'];
|
|
34
|
+
};
|
|
35
|
+
major?: {
|
|
36
|
+
open: ImageProps['src'];
|
|
37
|
+
closed: ImageProps['src'];
|
|
38
|
+
};
|
|
39
|
+
minor?: {
|
|
40
|
+
open: ImageProps['src'];
|
|
41
|
+
closed: ImageProps['src'];
|
|
42
|
+
};
|
|
43
|
+
default?: {
|
|
44
|
+
open: ImageProps['src'];
|
|
45
|
+
closed: ImageProps['src'];
|
|
46
|
+
};
|
|
47
|
+
style?: {
|
|
48
|
+
wrapper?: string;
|
|
49
|
+
image?: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
jackpotProfileShape?: 'oval' | 'star';
|
|
53
|
+
}
|
|
54
|
+
export declare function JackpotMultiStageMobile({ animate, customJackpotChestImage, jackpotProfileShape, customJackpotStageChest, chestImagesByTier, className, ...props }: JackpotsListItemMobileProps): import("react/jsx-runtime").JSX.Element | null;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Progress } from '@ark-ui/react/progress';
|
|
3
|
+
import { format } from 'date-fns';
|
|
4
|
+
import Image, {} from 'next/image';
|
|
5
|
+
import { useCallback, useEffect, useId, useState, } from 'react';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
7
|
+
import { ArrowNarrowDownIcon } from '../../../icons/ArrowNarrowDownIcon.js';
|
|
8
|
+
import { ArrowNarrowUpIcon } from '../../../icons/ArrowNarrowUpIcon.js';
|
|
9
|
+
import { ArrowNarrowUpRightIcon } from '../../../icons/ArrowNarrowUpRightIcon.js';
|
|
10
|
+
import { CheckCircleBrokenIcon } from '../../../icons/CheckCircleBrokenIcon.js';
|
|
11
|
+
import { Flag05Icon } from '../../../icons/Flag05Icon.js';
|
|
12
|
+
import { StarIcon } from '../../../icons/StarIcon.js';
|
|
13
|
+
import { Target04Icon } from '../../../icons/Target04Icon.js';
|
|
14
|
+
import { Trophy01Icon } from '../../../icons/Trophy01Icon.js';
|
|
15
|
+
import { User01Icon } from '../../../icons/User01Icon.js';
|
|
16
|
+
import firstPlace from '../../../images/first-place.png';
|
|
17
|
+
import leaderboard from '../../../images/leaderboard.png';
|
|
18
|
+
import { Button } from '../../../ui/Button/index.js';
|
|
19
|
+
import { formatNumber } from '../../../utils/formatNumber.js';
|
|
20
|
+
import { mask } from '../../../utils/mask.js';
|
|
21
|
+
import { parseDecimal } from '../../../utils/parseDecimal.js';
|
|
22
|
+
import styles from '../Jackpots.module.css';
|
|
23
|
+
import { useJackpotsListItemContext } from './JackpotsListContext.js';
|
|
24
|
+
import { JackpotsListItemGameProviders } from './JackpotsListItemGameProviders.js';
|
|
25
|
+
import { JackpotsListItemRules } from './JackpotsListItemRules.js';
|
|
26
|
+
import { useJackpotsListItemData } from './useJackpotsListItemData.js';
|
|
27
|
+
function getPercentage(value, total) {
|
|
28
|
+
const v = parseDecimal(value, 0);
|
|
29
|
+
const t = parseDecimal(total, 0);
|
|
30
|
+
return t === 0 ? 0 : (v / t) * 100;
|
|
31
|
+
}
|
|
32
|
+
export function JackpotMultiStageMobile({ animate = true, customJackpotChestImage, jackpotProfileShape = 'oval', customJackpotStageChest, chestImagesByTier, className, ...props }) {
|
|
33
|
+
const jackpot = useJackpotsListItemContext();
|
|
34
|
+
const { rootRef, jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, } = useJackpotsListItemData();
|
|
35
|
+
const getChestImages = (stage) => {
|
|
36
|
+
if (stage === 1) {
|
|
37
|
+
return {
|
|
38
|
+
image: customJackpotStageChest?.stage.one,
|
|
39
|
+
style: customJackpotStageChest?.style,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if (stage === 2) {
|
|
43
|
+
return {
|
|
44
|
+
image: customJackpotStageChest?.stage.two,
|
|
45
|
+
style: customJackpotStageChest?.style,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if (stage === 3) {
|
|
49
|
+
return {
|
|
50
|
+
image: customJackpotStageChest?.stage.three,
|
|
51
|
+
style: customJackpotStageChest?.style,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
image: customJackpotStageChest?.stage.four,
|
|
56
|
+
style: customJackpotStageChest?.style,
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
const chestImages = getChestImages(jackpot.stage ?? 1);
|
|
60
|
+
const [isDetailsVisible, setIsDetailsVisible] = useState(false);
|
|
61
|
+
const [mainTooltipOpen, setMainTooltipOpen] = useState(false);
|
|
62
|
+
const [minLimitTooltipOpen, setMinLimitTooltipOpen] = useState(false);
|
|
63
|
+
const mainTooltipId = useId();
|
|
64
|
+
const minLimitTooltipId = useId();
|
|
65
|
+
const handleMainTooltipClick = useCallback((e) => {
|
|
66
|
+
e.stopPropagation();
|
|
67
|
+
setMainTooltipOpen((prev) => !prev);
|
|
68
|
+
}, []);
|
|
69
|
+
const handleMinLimitTooltipClick = useCallback((e) => {
|
|
70
|
+
e.stopPropagation();
|
|
71
|
+
setMinLimitTooltipOpen((prev) => !prev);
|
|
72
|
+
}, []);
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
if (mainTooltipOpen) {
|
|
75
|
+
const timeout = setTimeout(() => setMainTooltipOpen(false), 3000);
|
|
76
|
+
return () => clearTimeout(timeout);
|
|
77
|
+
}
|
|
78
|
+
}, [mainTooltipOpen]);
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
if (minLimitTooltipOpen) {
|
|
81
|
+
const timeout = setTimeout(() => setMinLimitTooltipOpen(false), 3000);
|
|
82
|
+
return () => clearTimeout(timeout);
|
|
83
|
+
}
|
|
84
|
+
}, [minLimitTooltipOpen]);
|
|
85
|
+
const target = parseFloat(jackpot.stages?.[jackpot.stage]?.targetTurnover ?? '0');
|
|
86
|
+
const total = parseFloat(jackpot.totalTurnover ?? '0');
|
|
87
|
+
const currStageProgressPercentage = getPercentage(total, target);
|
|
88
|
+
const totalTurnover = jackpot.totalTurnover;
|
|
89
|
+
const overallTurnover = parseDecimal(jackpot.totalTurnover, 0) /
|
|
90
|
+
(jackpot.stages?.reduce((acc, stage) => acc + parseFloat(stage.targetTurnover ?? '0'), 0) ?? 0);
|
|
91
|
+
const overallPercentage = getPercentage(totalTurnover, overallTurnover);
|
|
92
|
+
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-safe-area-inset-bottom 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-safe-area-inset-bottom 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" })] }));
|
|
93
|
+
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) }), "Winner"] }));
|
|
94
|
+
const ProgressBar = () => (_jsxs("div", { className: "flex w-full flex-col items-center justify-between", children: [_jsxs("div", { className: "mb-[5px] flex w-full items-center justify-between", children: [_jsxs("div", { className: "font-semibold text-text-primary-900 text-xs", children: ["Stage ", jackpot.stage, " Progress"] }), currStageProgressPercentage, "%"] }), _jsx(Progress.Root, { className: "h-2 w-full rounded-full bg-bg-primary", max: 100, value: currStageProgressPercentage, "aria-valuemax": 100, "aria-label": "Stage progress", children: _jsx(Progress.Track, { className: twMerge('h-full overflow-hidden rounded-full bg-bg-primary', className?.progressBarTrack), children: _jsx(Progress.Range, { className: "relative h-full overflow-hidden rounded-full bg-brand-500 pl-1.5", children: _jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-start pl-1.5", "aria-hidden": "true", children: arrowImages }) }) }) })] }));
|
|
95
|
+
const OverallProgressBar = () => {
|
|
96
|
+
return (_jsxs("div", { className: "mt-3 mb-[1rem] px-[0.75rem] lg:mt-4", children: [_jsxs("div", { className: "mb-[5px] flex items-center justify-between font-semibold text-text-primary-900 text-xs", children: [_jsx("p", { children: "Overall Progress" }), overallPercentage, "%"] }), _jsx(Progress.Root, { className: "h-2 w-full rounded-full bg-bg-primary lg:h-4", max: 100, value: overallPercentage, children: _jsx(Progress.Track, { className: twMerge('h-full overflow-hidden rounded-full bg-bg-primary', className?.progressBarTrack), children: _jsx(Progress.Range, { className: "relative h-full overflow-hidden rounded-full bg-brand-500 pl-1.5", children: _jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-start pl-1.5", "aria-hidden": "true", children: arrowImages }) }) }) })] }));
|
|
97
|
+
};
|
|
98
|
+
const RecentPayoutsTable = () => (_jsx("div", { className: "overflow-x-auto border-gray-200", children: _jsxs("table", { className: "w-full min-w-[37.5rem]", children: [_jsx("thead", { children: _jsx("tr", { className: twMerge('h-8 whitespace-nowrap bg-bg-secondary text-left font-medium text-text-tertiary-600 text-xs', className?.recentPayoutsTableHeadRow), children: ['Stage', 'Player', 'Target Turnover', 'Prize', 'Timestamp'].map((header) => (_jsx("th", { className: "px-4", children: header }, header))) }) }), _jsx("tbody", { children: jackpot.stages
|
|
99
|
+
? jackpot.stages.map((j, i) => (_jsxs("tr", { className: twMerge('whitespace-nowrap bg-bg-primary text-left text-sm text-text-secondary-700', className?.recentPayoutsTableBodyRow), children: [_jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: i + 1 }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: j.member?.name
|
|
100
|
+
? mask(j.member.name, {
|
|
101
|
+
totalCharsCount: 6,
|
|
102
|
+
})
|
|
103
|
+
: '-' }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: formatNumber(j.targetTurnover, {
|
|
104
|
+
currency: localeInfo.currency.code,
|
|
105
|
+
minDecimalPlaces: 2,
|
|
106
|
+
maxDecimalPlaces: 2,
|
|
107
|
+
}) }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4 text-brand-400', className?.recentPayoutsTableBodyData), children: formatNumber(j.jackpotPayout, {
|
|
108
|
+
currency: localeInfo.currency.code,
|
|
109
|
+
minDecimalPlaces: 2,
|
|
110
|
+
maxDecimalPlaces: 2,
|
|
111
|
+
}) }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: j.dateTimeCompleted
|
|
112
|
+
? format(new Date(j.dateTimeCompleted), 'dd MMM yyyy h:mm a')
|
|
113
|
+
: '-' })] }, i)))
|
|
114
|
+
: Array.from({ length: 10 }).map((_, i) => (_jsx("tr", { className: twMerge('bg-bg-primary text-left text-sm text-text-secondary-700', className?.recentPayoutsTableBodyRow), children: Array.from({ length: 5 }).map((_, j) => (_jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: "-" }, j))) }, i))) })] }) }));
|
|
115
|
+
if (jackpot.status === 'DISABLED' && jackpot.drawing !== true) {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
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: twMerge('relative flex shrink-0 rounded-2xl bg-bg-tertiary p-3 text-center lg:gap-4 lg:p-5', window.location.href.includes('blucky') &&
|
|
119
|
+
styles['animate-multi-stage-gradient-blucky']), 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 items-center justify-between", children: [_jsxs("div", { className: "w-full", children: [_jsxs("div", { className: "flex gap-2.5", children: [_jsxs("div", { className: twMerge('flex w-fit items-center gap-1 rounded-full border border-[#3F100B] bg-[#CDA95B] px-2 py-0.5 font-medium text-[#1D0201] text-xs', className?.jackpotBadgeRoot), children: [_jsx(Flag05Icon, { className: "size-3.5 text-[inherit]" }), "Stage ", jackpot.stage] }), overallPercentage < 100 ? (_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" }), "In Progress"] })) : (_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(CheckCircleBrokenIcon, { className: "size-3.5 text-utility-success-500" }), "Completed"] }))] }), _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, {
|
|
120
|
+
currency: localeInfo.currency.code,
|
|
121
|
+
minDecimalPlaces: 2,
|
|
122
|
+
maxDecimalPlaces: 2,
|
|
123
|
+
}) }), _jsxs("div", { className: twMerge('mt-[15px] mb-[10px] flex w-fit items-center gap-1 rounded-full border border-[#932F19] bg-[#511C10] py-[0.125rem] pr-[0.5rem] pl-[0.375rem] text-[#F7B27A] text-xs', className?.jackpotTurnoverRoot), children: [_jsx(Target04Icon, { className: twMerge('size-3.5 text-[#EF6820]', className?.jackpotTurnoverIcon) }), _jsxs("p", { children: ["Turnover Target:", ' ', formatNumber(jackpot.stages?.[jackpot.stage]?.targetTurnover, {
|
|
124
|
+
currency: localeInfo.currency.code,
|
|
125
|
+
minDecimalPlaces: 2,
|
|
126
|
+
maxDecimalPlaces: 2,
|
|
127
|
+
})] })] }), _jsx(ProgressBar, {})] }), chestImages?.image && (_jsx("div", { className: twMerge('right-0 bottom-[-60] z-1 block min-w-34.5 lg:absolute', chestImages?.style?.wrapper), children: _jsx(Image, { width: 100, height: 100, src: chestImages?.image, alt: "chest", className: twMerge('size-full h-34.5 w-34.5 p-2 lg:h-37.5 lg:w-37.5', chestImages?.style?.image) }) }))] }) }) }) }), _jsx("div", { className: twMerge('relative mt-4 flex w-full gap-4 rounded-lg bg-bg-primary p-4', className?.latestPayoutRoot), children: topJackpotPayout?.amount ? (_jsxs(_Fragment, { children: [_jsx(ProfileIcon, {}), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsx(PayoutBadge, {}), _jsx("div", { className: "font-semibold", children: mask(topJackpotPayout.member.name, {
|
|
128
|
+
totalCharsCount: 6,
|
|
129
|
+
}) }), _jsx("div", { className: twMerge('text-2xl text-brand-400', className?.latestPayoutAmount), children: formatNumber(topJackpotPayout.amount, {
|
|
130
|
+
currency: localeInfo.currency.code,
|
|
131
|
+
minDecimalPlaces: 2,
|
|
132
|
+
maxDecimalPlaces: 2,
|
|
133
|
+
}) })] })] })) : (_jsxs(_Fragment, { children: [_jsx(Image, { width: 66, height: 87, src: firstPlace, alt: "closeChest", className: "size-full h-auto w-[4.125rem] mix-blend-luminosity" }), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsx(PayoutBadge, {}), _jsx("div", { className: "font-semibold", children: "No winners yet" }), _jsx("div", { className: "text-text-secondary-700 text-xs", children: "You could be the first to win the jackpot!" })] })] })) }), _jsx(Button, { variant: "outline", className: twMerge('mt-5.5 px-3.5 py-2.5 text-sm', isDetailsVisible ? 'hidden' : 'flex'), onClick: () => setIsDetailsVisible(!isDetailsVisible), children: _jsxs("div", { className: "flex gap-1.5", children: ["See Details", _jsx(ArrowNarrowDownIcon, { className: "size-5" })] }) })] }), isPayingOut && animate && (_jsx("div", { className: twMerge(styles['light-rays'], 'absolute top-safe-area-inset-top right-0 rounded-2xl [--light-rays-top:15%] lg:[--light-rays-top:9.375rem]') }))] }), isDetailsVisible && (_jsxs("div", { children: [_jsxs("div", { className: "z-1 flex-1", children: [_jsxs("div", { className: "flex items-center justify-between p-3", children: [_jsxs("div", { className: "flex gap-2", children: [_jsx(Image, { width: 24, height: 24, src: leaderboard, alt: "leaderboardIcon", className: "size-full h-auto w-6" }), _jsx("div", { className: twMerge('font-semibold text-lg text-text-primary-900', className?.recentPayoutsHeading), children: "Stages" })] }), _jsx(JackpotsListItemRules, { className: {
|
|
134
|
+
button: className?.recentPayoutsJackpotRulesButton,
|
|
135
|
+
} })] }), _jsx(OverallProgressBar, {}), _jsx(RecentPayoutsTable, {})] }), Boolean(filteredGameProviders.length) && (_jsx(JackpotsListItemGameProviders, { gameProviders: filteredGameProviders })), _jsx("div", { className: "m-3", children: _jsx(Button, { variant: "outline", className: twMerge('px-3.5 py-2.5 text-sm', !isDetailsVisible ? 'hidden' : 'flex'), onClick: () => setIsDetailsVisible(!isDetailsVisible), children: _jsxs("div", { className: "flex gap-1.5", children: ["Hide", _jsx(ArrowNarrowUpIcon, { className: "size-5" })] }) }) })] }))] }));
|
|
136
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { type ImageProps } from 'next/image';
|
|
2
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
3
|
+
import type { GameProvider, GameProviderData } from '../../../types';
|
|
4
|
+
export interface ClassNameEntries {
|
|
5
|
+
root?: string;
|
|
6
|
+
itemRoot?: string;
|
|
7
|
+
providerRoot?: string;
|
|
8
|
+
providerHeading?: string;
|
|
9
|
+
providerNavigationButton?: string;
|
|
10
|
+
providerThumbnailRoot?: string;
|
|
11
|
+
providerThumbnailImage?: string;
|
|
12
|
+
jackpotAmountRoot?: string;
|
|
13
|
+
jackpotTurnoverRoot?: string;
|
|
14
|
+
jackpotTurnoverIcon?: string;
|
|
15
|
+
jackpotBadgeRoot?: string;
|
|
16
|
+
latestPayoutRoot?: string;
|
|
17
|
+
latestPayoutBadgeRoot?: string;
|
|
18
|
+
latestPayoutBadgeIcon?: string;
|
|
19
|
+
latestPayoutAmount?: string;
|
|
20
|
+
latestPayoutRankRoot?: string;
|
|
21
|
+
progressBarRoot?: string;
|
|
22
|
+
progressBarTrack?: string;
|
|
23
|
+
recentPayoutsRoot?: string;
|
|
24
|
+
recentPayoutsTableRoot?: string;
|
|
25
|
+
recentPayoutsTableHeadRow?: string;
|
|
26
|
+
recentPayoutsTableBodyRow?: string;
|
|
27
|
+
recentPayoutsTableBodyData?: string;
|
|
28
|
+
recentPayoutsHeading?: string;
|
|
29
|
+
recentPayoutsJackpotRulesButton?: string;
|
|
30
|
+
}
|
|
31
|
+
interface StyleEntries {
|
|
32
|
+
root?: CSSProperties;
|
|
33
|
+
itemRoot?: CSSProperties;
|
|
34
|
+
multiStageItemRoot?: CSSProperties;
|
|
35
|
+
}
|
|
36
|
+
export interface JackpotsListProps {
|
|
37
|
+
layout: 'list';
|
|
38
|
+
/** @default "Jackpots" */
|
|
39
|
+
heading?: string | ReactNode;
|
|
40
|
+
className?: string | ClassNameEntries;
|
|
41
|
+
style?: CSSProperties | StyleEntries;
|
|
42
|
+
gameProviders?: Partial<Record<GameProvider, {
|
|
43
|
+
redirectUrl: string;
|
|
44
|
+
image?: ImageProps['src'];
|
|
45
|
+
}>>;
|
|
46
|
+
gameProviderImages?: Partial<Record<GameProvider, ImageProps['src']>>;
|
|
47
|
+
/**
|
|
48
|
+
* @default '/providers/<slug>'
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* '/bingo/:slug' // '/bingo/jili'
|
|
52
|
+
* '/bingo/:id' // '/bingo/JILI'
|
|
53
|
+
* // or using a function
|
|
54
|
+
* ({slug}) => `/bingo/${slug}`
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
viewGamesUrl?: string | ((gameProvider: GameProviderData) => string);
|
|
58
|
+
animate?: boolean;
|
|
59
|
+
customJackpotChestImage?: {
|
|
60
|
+
image: {
|
|
61
|
+
open: string;
|
|
62
|
+
closed: string;
|
|
63
|
+
};
|
|
64
|
+
style?: {
|
|
65
|
+
wrapper?: string;
|
|
66
|
+
image?: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
customJackpotStageChest?: {
|
|
70
|
+
style?: {
|
|
71
|
+
wrapper?: string;
|
|
72
|
+
image?: string;
|
|
73
|
+
};
|
|
74
|
+
stage: {
|
|
75
|
+
one: ImageProps['src'];
|
|
76
|
+
two: ImageProps['src'];
|
|
77
|
+
three: ImageProps['src'];
|
|
78
|
+
four: ImageProps['src'];
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
jackpotProfileShape?: 'oval' | 'star';
|
|
82
|
+
chestImagesByTier?: {
|
|
83
|
+
grand?: {
|
|
84
|
+
open: ImageProps['src'];
|
|
85
|
+
closed: ImageProps['src'];
|
|
86
|
+
};
|
|
87
|
+
major?: {
|
|
88
|
+
open: ImageProps['src'];
|
|
89
|
+
closed: ImageProps['src'];
|
|
90
|
+
};
|
|
91
|
+
minor?: {
|
|
92
|
+
open: ImageProps['src'];
|
|
93
|
+
closed: ImageProps['src'];
|
|
94
|
+
};
|
|
95
|
+
default?: {
|
|
96
|
+
open: ImageProps['src'];
|
|
97
|
+
closed: ImageProps['src'];
|
|
98
|
+
};
|
|
99
|
+
style?: {
|
|
100
|
+
wrapper?: string;
|
|
101
|
+
image?: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
export declare function JackpotsListNext(props: JackpotsListProps): import("react/jsx-runtime").JSX.Element;
|
|
106
|
+
export {};
|