@opexa/portal-components 0.0.379 β 0.0.381
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/components/Account/Account.lazy.js +2 -1
- package/dist/components/Jackpots/Jackpots.module.css +184 -0
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.d.ts +12 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.js +1 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.d.ts +2 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.js +20 -18
- package/dist/components/Jackpots/JackpotsList/JackpotsList.d.ts +15 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsList.js +1 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.d.ts +3 -2
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.js +46 -42
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemGameProviders.js +1 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.d.ts +3 -2
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.js +52 -48
- package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.js +15 -15
- package/dist/styles/theme.css +7 -0
- package/package.json +1 -1
|
@@ -30,8 +30,8 @@ import { Popover } from '../../ui/Popover/index.js';
|
|
|
30
30
|
import { Portal } from '../../ui/Portal/index.js';
|
|
31
31
|
import { formatNumber } from '../../utils/formatNumber.js';
|
|
32
32
|
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
33
|
-
import { accountRecipe } from './account.recipe.js';
|
|
34
33
|
import { AccountPropsContext, useAccountPropsContext } from './AccountContext.js';
|
|
34
|
+
import { accountRecipe } from './account.recipe.js';
|
|
35
35
|
const defaultAccountProps = {
|
|
36
36
|
offsetTop: '0px',
|
|
37
37
|
rewardsUrl: '/rewards',
|
|
@@ -151,5 +151,6 @@ function Links({ router }) {
|
|
|
151
151
|
signOutMutation.mutate();
|
|
152
152
|
globalStore.account.setOpen(false);
|
|
153
153
|
globalStore.account__mobile.setOpen(false);
|
|
154
|
+
router.push('/');
|
|
154
155
|
}, children: [_jsx(Logout01Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Log Out" }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) }) })] }));
|
|
155
156
|
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
@keyframes arrow-green-flash {
|
|
2
|
+
0% {
|
|
3
|
+
color: #abefc6;
|
|
4
|
+
}
|
|
5
|
+
100% {
|
|
6
|
+
color: #079455;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.animate-arrow-green-flash-1 {
|
|
11
|
+
animation: arrow-green-flash 0.4s infinite;
|
|
12
|
+
animation-delay: -0.2s;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.animate-arrow-green-flash-2 {
|
|
16
|
+
animation: arrow-green-flash 0.4s infinite;
|
|
17
|
+
animation-delay: -0.1s;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.animate-arrow-green-flash-3 {
|
|
21
|
+
animation: arrow-green-flash 0.4s infinite;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@keyframes arrow-red-flash {
|
|
25
|
+
0%,
|
|
26
|
+
100% {
|
|
27
|
+
color: #f97066;
|
|
28
|
+
}
|
|
29
|
+
50% {
|
|
30
|
+
color: #fecdca;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.animate-arrow-red-flash-1 {
|
|
35
|
+
animation: arrow-red-flash 0.4s infinite;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.animate-arrow-red-flash-2 {
|
|
39
|
+
animation: arrow-red-flash 0.4s infinite;
|
|
40
|
+
animation-delay: -0.1s;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.animate-arrow-red-flash-3 {
|
|
44
|
+
animation: arrow-red-flash 0.4s infinite;
|
|
45
|
+
animation-delay: -0.2s;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Animated BG */
|
|
49
|
+
@keyframes rotate {
|
|
50
|
+
to {
|
|
51
|
+
transform: rotate(1turn);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.light-rays {
|
|
56
|
+
position: absolute;
|
|
57
|
+
top: 0;
|
|
58
|
+
left: 0;
|
|
59
|
+
right: 0;
|
|
60
|
+
bottom: 0;
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
|
|
63
|
+
--first: var(--color-jackpot-rays-primary);
|
|
64
|
+
--second: var(--color-jackpot-rays-secondary);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.light-rays::before,
|
|
68
|
+
.light-rays::after {
|
|
69
|
+
content: '';
|
|
70
|
+
position: absolute;
|
|
71
|
+
top: var(--light-rays-top, 150px);
|
|
72
|
+
left: calc(50% - 90px);
|
|
73
|
+
margin: -100vmax;
|
|
74
|
+
width: 200vmax;
|
|
75
|
+
height: 200vmax;
|
|
76
|
+
opacity: 0.6;
|
|
77
|
+
transform-origin: center;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.light-rays::before {
|
|
81
|
+
background: conic-gradient(
|
|
82
|
+
var(--first) 0deg 7.2deg,
|
|
83
|
+
var(--second) 7.2deg 14.4deg,
|
|
84
|
+
var(--first) 14.4deg 21.6deg,
|
|
85
|
+
var(--second) 21.6deg 28.8deg,
|
|
86
|
+
var(--first) 28.8deg 36deg,
|
|
87
|
+
var(--second) 36deg 43.2deg,
|
|
88
|
+
var(--first) 43.2deg 50.4deg,
|
|
89
|
+
var(--second) 50.4deg 57.6deg,
|
|
90
|
+
var(--first) 57.6deg 64.8deg,
|
|
91
|
+
var(--second) 64.8deg 72deg,
|
|
92
|
+
var(--first) 72deg 79.2deg,
|
|
93
|
+
var(--second) 79.2deg 86.4deg,
|
|
94
|
+
var(--first) 86.4deg 93.6deg,
|
|
95
|
+
var(--second) 93.6deg 100.8deg,
|
|
96
|
+
var(--first) 100.8deg 108deg,
|
|
97
|
+
var(--second) 108deg 115.2deg,
|
|
98
|
+
var(--first) 115.2deg 122.4deg,
|
|
99
|
+
var(--second) 122.4deg 129.6deg,
|
|
100
|
+
var(--first) 129.6deg 136.8deg,
|
|
101
|
+
var(--second) 136.8deg 144deg,
|
|
102
|
+
var(--first) 144deg 151.2deg,
|
|
103
|
+
var(--second) 151.2deg 158.4deg,
|
|
104
|
+
var(--first) 158.4deg 165.6deg,
|
|
105
|
+
var(--second) 165.6deg 172.8deg,
|
|
106
|
+
var(--first) 172.8deg 180deg,
|
|
107
|
+
var(--second) 180deg 187.2deg,
|
|
108
|
+
var(--first) 187.2deg 194.4deg,
|
|
109
|
+
var(--second) 194.4deg 201.6deg,
|
|
110
|
+
var(--first) 201.6deg 208.8deg,
|
|
111
|
+
var(--second) 208.8deg 216deg,
|
|
112
|
+
var(--first) 216deg 223.2deg,
|
|
113
|
+
var(--second) 223.2deg 230.4deg,
|
|
114
|
+
var(--first) 230.4deg 237.6deg,
|
|
115
|
+
var(--second) 237.6deg 244.8deg,
|
|
116
|
+
var(--first) 244.8deg 252deg,
|
|
117
|
+
var(--second) 252deg 259.2deg,
|
|
118
|
+
var(--first) 259.2deg 266.4deg,
|
|
119
|
+
var(--second) 266.4deg 273.6deg,
|
|
120
|
+
var(--first) 273.6deg 280.8deg,
|
|
121
|
+
var(--second) 280.8deg 288deg,
|
|
122
|
+
var(--first) 288deg 295.2deg,
|
|
123
|
+
var(--second) 295.2deg 302.4deg,
|
|
124
|
+
var(--first) 302.4deg 309.6deg,
|
|
125
|
+
var(--second) 309.6deg 316.8deg,
|
|
126
|
+
var(--first) 316.8deg 324deg,
|
|
127
|
+
var(--second) 324deg 331.2deg,
|
|
128
|
+
var(--first) 331.2deg 338.4deg,
|
|
129
|
+
var(--second) 338.4deg 345.6deg,
|
|
130
|
+
var(--first) 345.6deg 352.8deg,
|
|
131
|
+
var(--second) 352.8deg 360deg
|
|
132
|
+
);
|
|
133
|
+
animation: rotate 20s linear infinite;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@media (max-width: 1024px) {
|
|
137
|
+
.light-rays::before,
|
|
138
|
+
.light-rays::after {
|
|
139
|
+
left: auto;
|
|
140
|
+
right: 11%;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* ScrollArea.module.css */
|
|
145
|
+
.scrollArea {
|
|
146
|
+
overflow-y: scroll;
|
|
147
|
+
padding-right: 4px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* WebKit-based browsers */
|
|
151
|
+
.scrollArea::-webkit-scrollbar {
|
|
152
|
+
width: 8px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.scrollArea::-webkit-scrollbar-track {
|
|
156
|
+
background: var(--color-jackpot-table-scrollbar-track);
|
|
157
|
+
border-radius: 9999px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.scrollArea::-webkit-scrollbar-thumb {
|
|
161
|
+
background-color: var(--color-jackpot-table-scrollbar-thumb);
|
|
162
|
+
border-radius: 9999px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
@keyframes waveColor {
|
|
166
|
+
0%,
|
|
167
|
+
2.5% {
|
|
168
|
+
color: var(--wave-highlight-color);
|
|
169
|
+
}
|
|
170
|
+
2.51%,
|
|
171
|
+
100% {
|
|
172
|
+
color: var(--color-brand-300);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.animate-wave-color-success {
|
|
177
|
+
--wave-highlight-color: var(--color-success-800);
|
|
178
|
+
animation: waveColor 4s ease-in-out infinite;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.animate-wave-color-error {
|
|
182
|
+
--wave-highlight-color: var(--color-error-600);
|
|
183
|
+
animation: waveColor 4s ease-in-out infinite;
|
|
184
|
+
}
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import { type CSSProperties } from 'react';
|
|
2
|
-
interface ClassNameEntries {
|
|
2
|
+
export interface ClassNameEntries {
|
|
3
3
|
root?: string;
|
|
4
4
|
itemRoot?: string;
|
|
5
|
+
jackpotAmountRoot?: string;
|
|
6
|
+
latestPayoutRoot?: string;
|
|
7
|
+
latestPayoutBadgeRoot?: string;
|
|
8
|
+
latestPayoutBadgeIcon?: string;
|
|
9
|
+
latestPayoutAmount?: string;
|
|
10
|
+
progressBarRoot?: string;
|
|
11
|
+
progressBarTrack?: string;
|
|
12
|
+
recentPayoutsRoot?: string;
|
|
13
|
+
recentPayoutsTableRoot?: string;
|
|
14
|
+
recentPayoutsTableHeadRow?: string;
|
|
15
|
+
recentPayoutsTableBodyRow?: string;
|
|
5
16
|
}
|
|
6
17
|
interface StyleEntries {
|
|
7
18
|
root?: CSSProperties;
|
|
@@ -64,5 +64,5 @@ export function JackpotsCarousel({ style, className, ...props }) {
|
|
|
64
64
|
const classNames = isString(className)
|
|
65
65
|
? { root: className }
|
|
66
66
|
: (className ?? {});
|
|
67
|
-
return (_jsxs("div", { style: styles.root, className: classNames.root, children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "font-semibold text-lg", children: props.heading ?? 'Jackpots' }), _jsxs("div", { className: "flex items-center md:gap-3xl", children: [_jsxs(Link, { href: props.viewAllUrl ?? '/jackpots', className: "flex gap-sm font-semibold text-button-tertiary-fg text-sm", children: ["See All", _jsx(ChevronRightIcon, { className: "size-5 lg:hidden" })] }), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { disabled: !canScrollPrev, onClick: scrollPrev, variant: "outline", colorScheme: "gray", className: "rounded-r-none border-r-0", "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsxs(Button, { disabled: !canScrollNext, onClick: scrollNext, variant: "outline", colorScheme: "gray", className: "rounded-l-none", "aria-label": "Next", children: [_jsx("span", { className: "sr-only", children: "Next" }), _jsx(ArrowRightIcon, { className: "size-5" })] })] })] })] }), _jsx("div", { className: "relative mt-lg lg:overflow-hidden", ref: emblaRef, children: _jsx("div", { className: "flex gap-2.5", children: jackpots.map((jackpot) => (_jsx(JackpotsCarouselItemContext, { value: jackpot, children: _jsx(JackpotsCarouselItem, { style: styles.itemRoot, className: classNames
|
|
67
|
+
return (_jsxs("div", { style: styles.root, className: classNames.root, children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "font-semibold text-lg", children: props.heading ?? 'Jackpots' }), _jsxs("div", { className: "flex items-center md:gap-3xl", children: [_jsxs(Link, { href: props.viewAllUrl ?? '/jackpots', className: "flex gap-sm font-semibold text-button-tertiary-fg text-sm", children: ["See All", _jsx(ChevronRightIcon, { className: "size-5 lg:hidden" })] }), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { disabled: !canScrollPrev, onClick: scrollPrev, variant: "outline", colorScheme: "gray", className: "rounded-r-none border-r-0", "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsxs(Button, { disabled: !canScrollNext, onClick: scrollNext, variant: "outline", colorScheme: "gray", className: "rounded-l-none", "aria-label": "Next", children: [_jsx("span", { className: "sr-only", children: "Next" }), _jsx(ArrowRightIcon, { className: "size-5" })] })] })] })] }), _jsx("div", { className: "relative mt-lg lg:overflow-hidden", ref: emblaRef, children: _jsx("div", { className: "flex gap-2.5", children: jackpots.map((jackpot) => (_jsx(JackpotsCarouselItemContext, { value: jackpot, children: _jsx(JackpotsCarouselItem, { style: styles.itemRoot, className: classNames, viewAllUrl: props.viewAllUrl, animate: props.animate, customJackpotChestImage: props.customJackpotChestImage, jackpotProfileShape: props.jackpotProfileShape }) }, jackpot.id))) }) })] }));
|
|
68
68
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type CSSProperties } from 'react';
|
|
2
|
+
import type { ClassNameEntries } from './JackpotsCarousel';
|
|
2
3
|
export interface JackpotsCarouselItemProps {
|
|
3
4
|
style?: CSSProperties;
|
|
4
|
-
className?:
|
|
5
|
+
className?: ClassNameEntries;
|
|
5
6
|
/** @default "/jackpots" */
|
|
6
7
|
viewAllUrl?: string;
|
|
7
8
|
customJackpotChestImage?: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { Progress } from '@ark-ui/react/progress';
|
|
4
4
|
import { format } from 'date-fns';
|
|
5
5
|
import isMobile from 'is-mobile';
|
|
@@ -24,8 +24,8 @@ import { capitalize } from '../../../utils/capitalize.js';
|
|
|
24
24
|
import { formatNumber } from '../../../utils/formatNumber.js';
|
|
25
25
|
import { mask } from '../../../utils/mask.js';
|
|
26
26
|
import { parseDecimal } from '../../../utils/parseDecimal.js';
|
|
27
|
+
import styles from '../Jackpots.module.css';
|
|
27
28
|
import { useJackpotsCarouselItemContext } from './JackpotsCarouselContext.js';
|
|
28
|
-
import styles from './JackpotsCarouselItem.module.css';
|
|
29
29
|
export function JackpotsCarouselItem({ style, className, viewAllUrl, animate = true, customJackpotChestImage, jackpotProfileShape = 'oval', }) {
|
|
30
30
|
const jackpot = useJackpotsCarouselItemContext();
|
|
31
31
|
const jackpotPayoutsQuery = useJackpotPayoutsQuery({
|
|
@@ -72,18 +72,20 @@ export function JackpotsCarouselItem({ style, className, viewAllUrl, animate = t
|
|
|
72
72
|
}
|
|
73
73
|
}, [isMobileDevice]);
|
|
74
74
|
useEffect(() => {
|
|
75
|
-
if (
|
|
75
|
+
if (isMobileDevice && mainTooltipOpen) {
|
|
76
76
|
const timeout = setTimeout(() => setMainTooltipOpen(false), 3000);
|
|
77
77
|
return () => clearTimeout(timeout);
|
|
78
78
|
}
|
|
79
|
-
}, [mainTooltipOpen]);
|
|
79
|
+
}, [mainTooltipOpen, isMobileDevice]);
|
|
80
80
|
useEffect(() => {
|
|
81
|
-
if (
|
|
81
|
+
if (isMobileDevice && minLimitTooltipOpen) {
|
|
82
82
|
const timeout = setTimeout(() => setMinLimitTooltipOpen(false), 3000);
|
|
83
83
|
return () => clearTimeout(timeout);
|
|
84
84
|
}
|
|
85
|
-
}, [minLimitTooltipOpen]);
|
|
86
|
-
|
|
85
|
+
}, [minLimitTooltipOpen, isMobileDevice]);
|
|
86
|
+
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" }), _jsxs("div", { className: "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", children: [latestJackpotPayout?.multiplier, "x"] })] })) : (_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" }), _jsxs("div", { className: "-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", children: [latestJackpotPayout?.multiplier, "x"] })] }));
|
|
87
|
+
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"] }));
|
|
88
|
+
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, {
|
|
87
89
|
currency: localeInfo.currency.code,
|
|
88
90
|
minDecimalPlaces: 2,
|
|
89
91
|
maxDecimalPlaces: 2,
|
|
@@ -93,19 +95,19 @@ export function JackpotsCarouselItem({ style, className, viewAllUrl, animate = t
|
|
|
93
95
|
: customJackpotChestImage.image.closed
|
|
94
96
|
: isPayingOut
|
|
95
97
|
? openChest
|
|
96
|
-
: closeChest, alt: "closeChest", className: twMerge('size-full h-25 w-25 p-2 lg:h-37.5 lg:w-37.5', customJackpotChestImage?.style?.image) }) })] }),
|
|
98
|
+
: closeChest, alt: "closeChest", className: twMerge('size-full h-25 w-25 p-2 lg:h-37.5 lg:w-37.5', customJackpotChestImage?.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: latestJackpotPayout?.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(latestJackpotPayout.member.name, {
|
|
97
99
|
totalCharsCount: 6,
|
|
98
|
-
}) }), _jsx("div", { className:
|
|
100
|
+
}) }), _jsx("div", { className: twMerge('text-2xl text-brand-400', className?.latestPayoutAmount), children: formatNumber(latestJackpotPayout.amount, {
|
|
99
101
|
currency: localeInfo.currency.code,
|
|
100
102
|
minDecimalPlaces: 2,
|
|
101
103
|
maxDecimalPlaces: 2,
|
|
102
|
-
}) })] })] })
|
|
104
|
+
}) })] })] })) : (_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 tournament!" })] })] })) })] }) }) }), _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", "aria-live": "polite", children: formatNumber(0, {
|
|
103
105
|
currency: localeInfo.currency.code,
|
|
104
106
|
compact: true,
|
|
105
|
-
}) }), _jsxs("div", { className: "relative flex items-center justify-end gap-1.5", children: [isPayingOut ? (
|
|
107
|
+
}) }), _jsxs("div", { className: "relative flex items-center justify-end gap-1.5", children: [isPayingOut ? (_jsx("div", { className: "flex w-6 items-center", children: [0, 1.5, 3].map((left, i) => (_jsx("div", { className: twMerge(`absolute left-${left}`, styles[`animate-arrow-red-flash-${i + 1}`]), children: _jsx(ChevronLeftIcon, { className: "size-4.5" }) }, i))) })) : (_jsx("div", { className: "flex w-6 items-center", children: [0, 1.5, 3].map((left, i) => (_jsx("div", { className: twMerge(`absolute left-${left}`, styles[`animate-arrow-green-flash-${i + 1}`]), children: _jsx(ChevronRightIcon, { className: "size-4.5" }) }, i))) })), _jsx("div", { className: "font-semibold text-text-primary-900 text-xs", children: formatNumber(jackpot?.maximumJackpotPoolLimit, {
|
|
106
108
|
currency: localeInfo.currency.code,
|
|
107
109
|
compact: true,
|
|
108
|
-
}) })] })] }), _jsx(Progress.Root, { className: "h-2 w-full rounded-full bg-bg-primary lg:h-4", max: 100, value: getPercentage(jackpot.pool, jackpot.maximumJackpotPoolLimit), "aria-valuenow": getPercentage(jackpot.pool, jackpot.maximumJackpotPoolLimit), "aria-valuemax": 100, "aria-label": "Jackpot progress", children: _jsx(Progress.Track, { className:
|
|
110
|
+
}) })] })] }), _jsx(Progress.Root, { className: "h-2 w-full rounded-full bg-bg-primary lg:h-4", max: 100, value: getPercentage(jackpot.pool, jackpot.maximumJackpotPoolLimit), "aria-valuenow": getPercentage(jackpot.pool, jackpot.maximumJackpotPoolLimit), "aria-valuemax": 100, "aria-label": "Jackpot progress", children: _jsx(Progress.Track, { className: twMerge('h-full overflow-hidden rounded-full bg-bg-primary', className?.progressBarTrack), children: _jsxs(Progress.Range, { className: "relative h-full overflow-hidden rounded-full bg-brand-500 pl-1.5", children: [_jsxs(Tooltip.Root, { ...(isMobileDevice
|
|
109
111
|
? {
|
|
110
112
|
open: mainTooltipOpen,
|
|
111
113
|
onOpenChange: (details) => setMainTooltipOpen(details.open),
|
|
@@ -125,23 +127,23 @@ export function JackpotsCarouselItem({ style, className, viewAllUrl, animate = t
|
|
|
125
127
|
currency: localeInfo.currency.code,
|
|
126
128
|
compact: true,
|
|
127
129
|
})} Play now for your chance to win big! π₯`
|
|
128
|
-
: getAccumulatingJackpotDescription(Number(jackpot?.pool) ?? 0, Number(jackpot?.maximumJackpotPoolLimit) ?? 0) })] })] }), _jsxs("div", { className:
|
|
130
|
+
: getAccumulatingJackpotDescription(Number(jackpot?.pool) ?? 0, Number(jackpot?.maximumJackpotPoolLimit) ?? 0) })] })] }), _jsxs("div", { className: twMerge('z-1 hidden flex-1 space-y-4 lg:block', className?.recentPayoutsRoot), 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: "font-semibold text-lg text-text-primary-900", children: jackpotPayouts.length ? 'Recent payouts' : 'Starting soon!' })] }), _jsxs(Link, { className: "flex font-semibold text-button-tertiary-fg text-sm", href: viewAllUrl ?? '/jackpots', children: ["See details", _jsx(ChevronRightIcon, { className: "size-5" })] })] }), _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: [
|
|
129
131
|
'Player',
|
|
130
132
|
'Game Provider',
|
|
131
133
|
'Multiplier',
|
|
132
134
|
'Prize',
|
|
133
135
|
'Timestamp',
|
|
134
136
|
].map((header) => (_jsx("th", { className: "px-4", children: header }, header))) }) }), _jsx("tbody", { children: jackpotPayouts.length
|
|
135
|
-
? jackpotPayouts.map((
|
|
137
|
+
? jackpotPayouts.map((jp, i) => (_jsxs("tr", { className: twMerge('whitespace-nowrap bg-bg-primary text-left text-sm text-text-secondary-700', className?.recentPayoutsTableBodyRow), children: [_jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: mask(jp.member.name, {
|
|
136
138
|
totalCharsCount: 6,
|
|
137
|
-
}) }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: capitalize(
|
|
139
|
+
}) }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: capitalize(jp.game?.provider ?? '-', {
|
|
138
140
|
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
139
|
-
}) }), _jsxs("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: [
|
|
141
|
+
}) }), _jsxs("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: [jp.multiplier, "x"] }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4 text-brand-400", children: formatNumber(jp.amount, {
|
|
140
142
|
currency: localeInfo.currency.code,
|
|
141
143
|
minDecimalPlaces: 2,
|
|
142
144
|
maxDecimalPlaces: 2,
|
|
143
|
-
}) }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: format(new Date(
|
|
144
|
-
: Array.from({ length: 10 }).map((_, i) => (
|
|
145
|
+
}) }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: format(new Date(jp.dateTimeCreated), 'dd MMM yyyy h:mm a') })] }, i)))
|
|
146
|
+
: 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: "h-12 border-border-secondary border-t-2", children: "-" }, j))) }, i))) })] }) }) })] }), isPayingOut && animate && (_jsx("div", { className: twMerge(styles['light-rays'], 'absolute top-0 right-0 rounded-2xl [--light-rays-top:25%] lg:[--light-rays-top:9.375rem]') }))] }));
|
|
145
147
|
}
|
|
146
148
|
const getAccumulatingJackpotDescription = (part, total) => {
|
|
147
149
|
const percentage = total === 0 ? 0 : (part / total) * 100;
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import { type ImageProps } from 'next/image';
|
|
2
2
|
import type { CSSProperties } from 'react';
|
|
3
3
|
import type { GameProvider, GameProviderData } from '../../../types';
|
|
4
|
-
interface ClassNameEntries {
|
|
4
|
+
export interface ClassNameEntries {
|
|
5
5
|
root?: string;
|
|
6
6
|
itemRoot?: string;
|
|
7
|
+
providerRoot?: string;
|
|
8
|
+
providerHeading?: string;
|
|
9
|
+
providerNavigationButton?: string;
|
|
7
10
|
providerThumbnailRoot?: string;
|
|
8
11
|
providerThumbnailImage?: string;
|
|
12
|
+
jackpotAmountRoot?: string;
|
|
13
|
+
latestPayoutRoot?: string;
|
|
14
|
+
latestPayoutBadgeRoot?: string;
|
|
15
|
+
latestPayoutBadgeIcon?: string;
|
|
16
|
+
latestPayoutAmount?: string;
|
|
17
|
+
progressBarRoot?: string;
|
|
18
|
+
progressBarTrack?: string;
|
|
19
|
+
recentPayoutsRoot?: string;
|
|
20
|
+
recentPayoutsTableRoot?: string;
|
|
21
|
+
recentPayoutsTableHeadRow?: string;
|
|
22
|
+
recentPayoutsTableBodyRow?: string;
|
|
9
23
|
}
|
|
10
24
|
interface StyleEntries {
|
|
11
25
|
root?: CSSProperties;
|
|
@@ -31,5 +31,5 @@ export function JackpotsList(props) {
|
|
|
31
31
|
const classNames = isString(props.className)
|
|
32
32
|
? { root: props.className }
|
|
33
33
|
: (props.className ?? {});
|
|
34
|
-
return (_jsx(JackpotsListPropsContext, { value: props, children: _jsxs("div", { 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) => (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotsListItemDesktop, { style: styles.itemRoot, className: classNames
|
|
34
|
+
return (_jsx(JackpotsListPropsContext, { value: props, children: _jsxs("div", { 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) => (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotsListItemDesktop, { style: styles.itemRoot, className: classNames, animate: props.animate, customJackpotChestImage: props.customJackpotChestImage, jackpotProfileShape: props.jackpotProfileShape }) }, jackpot.id))) }), _jsx("div", { className: "flex flex-col gap-6 lg:hidden", children: jackpots.map((jackpot) => (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotsListItemMobile, { style: styles.itemRoot, className: classNames, animate: props.animate, customJackpotChestImage: props.customJackpotChestImage, jackpotProfileShape: props.jackpotProfileShape }) }, jackpot.id))) })] })) : (_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" }), _jsxs("div", { className: "mt-4 font-semibold text-base text-text-primary-900", children: ["No ", props.heading ?? 'Jackpots'] }), _jsxs("div", { className: "mt-1 text-center text-sm text-text-tertiary-600", children: ["No ", props.heading?.toLocaleLowerCase() ?? 'jackpots', " are running at the moment. ", _jsx("br", {}), "Please check back later!"] })] }))] }) }));
|
|
35
35
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { ClassNameEntries } from './JackpotsList';
|
|
2
3
|
interface JackpotsListItemDesktopProps {
|
|
3
|
-
className?:
|
|
4
|
+
className?: ClassNameEntries;
|
|
4
5
|
style?: CSSProperties;
|
|
5
6
|
animate?: boolean;
|
|
6
7
|
customJackpotChestImage?: {
|
|
@@ -15,5 +16,5 @@ interface JackpotsListItemDesktopProps {
|
|
|
15
16
|
};
|
|
16
17
|
jackpotProfileShape?: 'oval' | 'star';
|
|
17
18
|
}
|
|
18
|
-
export declare function JackpotsListItemDesktop({ animate, customJackpotChestImage, jackpotProfileShape, ...props }: JackpotsListItemDesktopProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function JackpotsListItemDesktop({ animate, customJackpotChestImage, jackpotProfileShape, className, ...props }: JackpotsListItemDesktopProps): import("react/jsx-runtime").JSX.Element;
|
|
19
20
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Progress } from '@ark-ui/react/progress';
|
|
3
3
|
import { format } from 'date-fns';
|
|
4
4
|
import Image from 'next/image';
|
|
@@ -18,15 +18,54 @@ import { capitalize } from '../../../utils/capitalize.js';
|
|
|
18
18
|
import { formatNumber } from '../../../utils/formatNumber.js';
|
|
19
19
|
import { mask } from '../../../utils/mask.js';
|
|
20
20
|
import { parseDecimal } from '../../../utils/parseDecimal.js';
|
|
21
|
+
import styles from '../Jackpots.module.css';
|
|
21
22
|
import { useJackpotsListItemContext } from './JackpotsListContext.js';
|
|
22
|
-
import styles from './JackpotsListItem.module.css';
|
|
23
23
|
import { JackpotsListItemGameProviders } from './JackpotsListItemGameProviders.js';
|
|
24
24
|
import { JackpotsListItemRules } from './JackpotsListItemRules.js';
|
|
25
25
|
import { useJackpotsListItemData } from './useJackpotsListItemData.js';
|
|
26
|
-
export function JackpotsListItemDesktop({ animate = true, customJackpotChestImage, jackpotProfileShape = 'oval', ...props }) {
|
|
26
|
+
export function JackpotsListItemDesktop({ animate = true, customJackpotChestImage, jackpotProfileShape = 'oval', className, ...props }) {
|
|
27
27
|
const jackpot = useJackpotsListItemContext();
|
|
28
28
|
const { 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" }), _jsxs("div", { className: "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", children: [topJackpotPayout?.multiplier, "x"] })] })) : (_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" }), _jsxs("div", { className: "-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", children: [topJackpotPayout?.multiplier, "x"] })] }));
|
|
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
|
+
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, {
|
|
32
|
+
currency: localeInfo.currency.code,
|
|
33
|
+
compact: true,
|
|
34
|
+
}) }), _jsxs("div", { className: "relative flex items-center justify-end gap-1.5", children: [isPayingOut ? (_jsxs("div", { className: "flex w-6 items-center", children: [_jsx("div", { className: twMerge('absolute left-0', styles['animate-arrow-red-flash-1']), children: _jsx(ChevronLeftIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-1.5', styles['animate-arrow-red-flash-2']), children: _jsx(ChevronLeftIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-3', styles['animate-arrow-red-flash-3']), children: _jsx(ChevronLeftIcon, { className: "size-4.5" }) })] })) : (_jsxs("div", { className: "flex w-6 items-center", children: [_jsx("div", { className: twMerge('absolute left-0', styles['animate-arrow-green-flash-1']), children: _jsx(ChevronRightIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-1.5', styles['animate-arrow-green-flash-2']), children: _jsx(ChevronRightIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-3', styles['animate-arrow-green-flash-3']), children: _jsx(ChevronRightIcon, { className: "size-4.5" }) })] })), _jsx("div", { className: "font-semibold text-text-primary-900 text-xs", children: formatNumber(jackpot?.maximumJackpotPoolLimit, {
|
|
35
|
+
currency: localeInfo.currency.code,
|
|
36
|
+
compact: true,
|
|
37
|
+
}) })] })] }), _jsx(Progress.Root, { className: "h-2 w-full rounded-full bg-bg-primary lg:h-4", max: 100, value: getPercentage(jackpot.pool, jackpot.maximumJackpotPoolLimit), children: _jsx(Progress.Track, { className: twMerge('h-full overflow-hidden rounded-full bg-bg-primary', className?.progressBarTrack), children: _jsxs(Progress.Range, { className: "relative h-full overflow-hidden rounded-full bg-brand-500 pl-1.5", children: [_jsxs(Tooltip.Root, { openDelay: 0, closeDelay: 100, lazyMount: true, unmountOnExit: true, positioning: { strategy: 'fixed', placement: 'top' }, children: [_jsx(Tooltip.Trigger, { asChild: true, children: _jsx("div", { className: "absolute inset-0 h-full w-full" }) }), _jsx(Tooltip.Positioner, { children: _jsxs(Tooltip.Content, { children: [_jsxs("div", { className: "text-xs", children: ["Current\uD83D\uDCB0:", ' ', formatNumber(jackpot.pool, {
|
|
38
|
+
currency: localeInfo.currency.code,
|
|
39
|
+
minDecimalPlaces: 2,
|
|
40
|
+
maxDecimalPlaces: 2,
|
|
41
|
+
})] }), _jsx(Tooltip.Arrow, { children: _jsx(Tooltip.ArrowTip, {}) })] }) })] }), _jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-start pl-1.5", "aria-hidden": "true", children: arrowImages }), _jsxs(Tooltip.Root, { openDelay: 0, closeDelay: 100, lazyMount: true, unmountOnExit: true, positioning: { strategy: 'fixed', placement: 'top' }, children: [_jsx(Tooltip.Trigger, { asChild: true, children: _jsx("div", { className: "absolute inset-0 h-full bg-black opacity-30", style: {
|
|
42
|
+
width: `${getPercentage(jackpot.minimumJackpotPoolDrawingLimit, jackpot.pool)}%`,
|
|
43
|
+
} }) }), _jsx(Tooltip.Positioner, { children: _jsxs(Tooltip.Content, { children: [_jsxs("div", { className: "text-xs", children: ["Minimum Payout Limit:", ' ', formatNumber(jackpot.minimumJackpotPoolDrawingLimit, {
|
|
44
|
+
currency: localeInfo.currency.code,
|
|
45
|
+
minDecimalPlaces: 2,
|
|
46
|
+
maxDecimalPlaces: 2,
|
|
47
|
+
})] }), _jsx(Tooltip.Arrow, { children: _jsx(Tooltip.ArrowTip, {}) })] }) })] })] }) }) }), _jsx("div", { className: "mt-1 block text-start text-2xs lg:hidden", children: isPayingOut
|
|
48
|
+
? `The pot has hit ${formatNumber(jackpot?.maximumJackpotPoolLimit, {
|
|
49
|
+
currency: localeInfo.currency.code,
|
|
50
|
+
compact: true,
|
|
51
|
+
})} Play now for your chance to win big! π₯`
|
|
52
|
+
: getAccumulatingJackpotDescription(Number(jackpot?.pool) ?? 0, Number(jackpot?.maximumJackpotPoolLimit) ?? 0) })] }));
|
|
53
|
+
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: [
|
|
54
|
+
'Player',
|
|
55
|
+
'Game Provider',
|
|
56
|
+
'Multiplier',
|
|
57
|
+
'Prize',
|
|
58
|
+
'Timestamp',
|
|
59
|
+
].map((header) => (_jsx("th", { className: "px-4", children: header }, header))) }) }), _jsx("tbody", { children: jackpotPayouts.length
|
|
60
|
+
? jackpotPayouts.map((jackpotPayout, i) => (_jsxs("tr", { className: twMerge('whitespace-nowrap bg-bg-primary text-left text-sm text-text-secondary-700', className?.recentPayoutsTableBodyRow), children: [_jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: mask(jackpotPayout.member.name, {
|
|
61
|
+
totalCharsCount: 6,
|
|
62
|
+
}) }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: capitalize(jackpotPayout.game?.provider ?? '-') }), _jsxs("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: [jackpotPayout.multiplier, "x"] }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4 text-brand-400", children: formatNumber(jackpotPayout.amount, {
|
|
63
|
+
currency: localeInfo.currency.code,
|
|
64
|
+
minDecimalPlaces: 2,
|
|
65
|
+
maxDecimalPlaces: 2,
|
|
66
|
+
}) }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: format(new Date(jackpotPayout.dateTimeCreated), 'dd MMM yyyy h:mm a') })] }, i)))
|
|
67
|
+
: 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: "h-12 border-border-secondary border-t-2", children: "-" }, j))) }, i))) })] }) }) }));
|
|
68
|
+
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, {
|
|
30
69
|
currency: localeInfo.currency.code,
|
|
31
70
|
minDecimalPlaces: 2,
|
|
32
71
|
maxDecimalPlaces: 2,
|
|
@@ -36,48 +75,13 @@ export function JackpotsListItemDesktop({ animate = true, customJackpotChestImag
|
|
|
36
75
|
: customJackpotChestImage.image.closed
|
|
37
76
|
: isPayingOut
|
|
38
77
|
? openChest
|
|
39
|
-
: closeChest, alt: "closeChest", className: twMerge('size-full h-25 w-25 p-2 lg:h-37.5 lg:w-37.5', customJackpotChestImage?.style?.image) }) })] }),
|
|
78
|
+
: closeChest, alt: "closeChest", className: twMerge('size-full h-25 w-25 p-2 lg:h-37.5 lg:w-37.5', customJackpotChestImage?.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, {
|
|
40
79
|
totalCharsCount: 6,
|
|
41
|
-
}) }), _jsx("div", { className:
|
|
80
|
+
}) }), _jsx("div", { className: twMerge('text-2xl text-brand-400', className?.latestPayoutAmount), children: formatNumber(topJackpotPayout.amount, {
|
|
42
81
|
currency: localeInfo.currency.code,
|
|
43
82
|
minDecimalPlaces: 2,
|
|
44
83
|
maxDecimalPlaces: 2,
|
|
45
|
-
}) })] })] })
|
|
46
|
-
currency: localeInfo.currency.code,
|
|
47
|
-
compact: true,
|
|
48
|
-
}) }), _jsxs("div", { className: "relative flex items-center justify-end gap-1.5", children: [isPayingOut ? (_jsxs("div", { className: "flex w-6 items-center", children: [_jsx("div", { className: twMerge('absolute left-0', styles['animate-arrow-red-flash-1']), children: _jsx(ChevronLeftIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-1.5', styles['animate-arrow-red-flash-2']), children: _jsx(ChevronLeftIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-3', styles['animate-arrow-red-flash-3']), children: _jsx(ChevronLeftIcon, { className: "size-4.5" }) })] })) : (_jsxs("div", { className: "flex w-6 items-center", children: [_jsx("div", { className: twMerge('absolute left-0', styles['animate-arrow-green-flash-1']), children: _jsx(ChevronRightIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-1.5', styles['animate-arrow-green-flash-2']), children: _jsx(ChevronRightIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-3', styles['animate-arrow-green-flash-3']), children: _jsx(ChevronRightIcon, { className: "size-4.5" }) })] })), _jsx("div", { className: "font-semibold text-text-primary-900 text-xs", children: formatNumber(jackpot?.maximumJackpotPoolLimit, {
|
|
49
|
-
currency: localeInfo.currency.code,
|
|
50
|
-
compact: true,
|
|
51
|
-
}) })] })] }), _jsx(Progress.Root, { className: "h-2 w-full rounded-full bg-bg-primary lg:h-4", max: 100, value: getPercentage(jackpot.pool, jackpot.maximumJackpotPoolLimit), children: _jsx(Progress.Track, { className: "h-full overflow-hidden rounded-full bg-bg-primary", children: _jsxs(Progress.Range, { className: "relative h-full overflow-hidden rounded-full bg-brand-500 pl-1.5", children: [_jsxs(Tooltip.Root, { openDelay: 0, closeDelay: 100, lazyMount: true, unmountOnExit: true, positioning: { strategy: 'fixed', placement: 'top' }, children: [_jsx(Tooltip.Trigger, { asChild: true, children: _jsx("div", { className: "absolute inset-0 h-full w-full" }) }), _jsx(Tooltip.Positioner, { children: _jsxs(Tooltip.Content, { children: [_jsxs("div", { className: "text-xs", children: ["Current\uD83D\uDCB0:", ' ', formatNumber(jackpot.pool, {
|
|
52
|
-
currency: localeInfo.currency.code,
|
|
53
|
-
minDecimalPlaces: 2,
|
|
54
|
-
maxDecimalPlaces: 2,
|
|
55
|
-
})] }), _jsx(Tooltip.Arrow, { children: _jsx(Tooltip.ArrowTip, {}) })] }) })] }), _jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-start pl-1.5", "aria-hidden": "true", children: arrowImages }), _jsxs(Tooltip.Root, { openDelay: 0, closeDelay: 100, lazyMount: true, unmountOnExit: true, positioning: { strategy: 'fixed', placement: 'top' }, children: [_jsx(Tooltip.Trigger, { asChild: true, children: _jsx("div", { className: "absolute inset-0 h-full bg-black opacity-30", style: {
|
|
56
|
-
width: `${getPercentage(jackpot.minimumJackpotPoolDrawingLimit, jackpot.pool)}%`,
|
|
57
|
-
} }) }), _jsx(Tooltip.Positioner, { children: _jsxs(Tooltip.Content, { children: [_jsxs("div", { className: "text-xs", children: ["Minimum Payout Limit:", ' ', formatNumber(jackpot.minimumJackpotPoolDrawingLimit, {
|
|
58
|
-
currency: localeInfo.currency.code,
|
|
59
|
-
minDecimalPlaces: 2,
|
|
60
|
-
maxDecimalPlaces: 2,
|
|
61
|
-
})] }), _jsx(Tooltip.Arrow, { children: _jsx(Tooltip.ArrowTip, {}) })] }) })] })] }) }) }), _jsx("div", { className: "mt-1 block text-start text-2xs lg:hidden", children: isPayingOut
|
|
62
|
-
? `The pot has hit ${formatNumber(jackpot?.maximumJackpotPoolLimit, {
|
|
63
|
-
currency: localeInfo.currency.code,
|
|
64
|
-
compact: true,
|
|
65
|
-
})} Play now for your chance to win big! π₯`
|
|
66
|
-
: getAccumulatingJackpotDescription(Number(jackpot?.pool) ?? 0, Number(jackpot?.maximumJackpotPoolLimit) ?? 0) })] })] }), _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: "font-semibold text-lg text-text-primary-900", children: jackpotPayouts.length ? 'Recent Payouts' : 'Starting soon!' })] }), _jsx(JackpotsListItemRules, {})] }), _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: "h-8 whitespace-nowrap bg-bg-secondary text-left font-medium text-text-tertiary-600 text-xs", children: [
|
|
67
|
-
'Player',
|
|
68
|
-
'Game Provider',
|
|
69
|
-
'Multiplier',
|
|
70
|
-
'Prize',
|
|
71
|
-
'Timestamp',
|
|
72
|
-
].map((header) => (_jsx("th", { className: "px-4", children: header }, header))) }) }), _jsx("tbody", { children: jackpotPayouts.length
|
|
73
|
-
? jackpotPayouts.map((jackpotPayout, i) => (_jsxs("tr", { className: "whitespace-nowrap bg-bg-primary text-left text-sm text-text-secondary-700", children: [_jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: mask(jackpotPayout.member.name, {
|
|
74
|
-
totalCharsCount: 6,
|
|
75
|
-
}) }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: capitalize(jackpotPayout.game?.provider ?? '-') }), _jsxs("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: [jackpotPayout.multiplier, "x"] }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4 text-brand-400", children: formatNumber(jackpotPayout.amount, {
|
|
76
|
-
currency: localeInfo.currency.code,
|
|
77
|
-
minDecimalPlaces: 2,
|
|
78
|
-
maxDecimalPlaces: 2,
|
|
79
|
-
}) }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: format(new Date(jackpotPayout.dateTimeCreated), 'dd MMM yyyy h:mm a') })] }, i)))
|
|
80
|
-
: Array.from({ length: 10 }).map((_, i) => (_jsxs("tr", { className: "bg-bg-primary text-sm text-text-secondary-700", children: [_jsx("td", { className: "h-12 border-border-secondary border-t-2", children: "-" }), _jsx("td", { className: "h-12 border-border-secondary border-t-2", children: "-" }), _jsx("td", { className: "h-12 border-border-secondary border-t-2", children: "-" }), _jsx("td", { className: "h-12 border-border-secondary border-t-2", children: "-" }), _jsx("td", { className: "h-12 border-border-secondary border-t-2", children: "-" })] }, i))) })] }) }) })] }), isPayingOut && animate && (_jsx("div", { className: twMerge(styles['light-rays'], 'absolute top-0 right-0 rounded-2xl') }))] }), Boolean(filteredGameProviders.length) && (_jsx(JackpotsListItemGameProviders, { gameProviders: filteredGameProviders }))] }));
|
|
84
|
+
}) })] })] })) : (_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 tournament!" })] })] })) })] }) }) }), _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: "font-semibold text-lg text-text-primary-900", children: jackpotPayouts.length ? 'Recent Payouts' : 'Starting soon!' })] }), _jsx(JackpotsListItemRules, {})] }), _jsx(RecentPayoutsTable, {})] }), isPayingOut && animate && (_jsx("div", { className: twMerge(styles['light-rays'], 'absolute top-0 right-0 rounded-2xl') }))] }), Boolean(filteredGameProviders.length) && (_jsx(JackpotsListItemGameProviders, { gameProviders: filteredGameProviders }))] }));
|
|
81
85
|
}
|
|
82
86
|
function getPercentage(value, total) {
|
|
83
87
|
const v = parseDecimal(value, 0);
|
|
@@ -49,6 +49,6 @@ export function JackpotsListItemGameProviders({ gameProviders, }) {
|
|
|
49
49
|
emblaApi.on('select', onSelect);
|
|
50
50
|
emblaApi.on('reInit', onSelect);
|
|
51
51
|
}, [emblaApi, onSelect]);
|
|
52
|
-
return (_jsxs("div", { className:
|
|
52
|
+
return (_jsxs("div", { className: twMerge('p-4 pb-8', classNames.providerRoot), children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: twMerge('font-semibold text-lg text-text-primary-900', classNames.providerHeading), children: "Jackpot Game Providers" }), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { disabled: !canScrollPrev, onClick: scrollPrev, variant: "outline", colorScheme: "gray", className: twMerge('rounded-r-none border-r-0', classNames.providerNavigationButton), "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsxs(Button, { disabled: !canScrollNext, onClick: scrollNext, variant: "outline", colorScheme: "gray", className: twMerge('rounded-l-none', classNames.providerNavigationButton), "aria-label": "Next", children: [_jsx("span", { className: "sr-only", children: "Next" }), _jsx(ArrowRightIcon, { className: "size-5" })] })] })] }), _jsx("div", { className: "relative mt-3 overflow-hidden", ref: emblaRef, children: _jsx("div", { className: "flex gap-3.5", children: gameProviders.map((provider) => (_jsx(Link, { href: viewGamesUrl(provider), className: twMerge('min-w-27.5 rounded-md bg-brand-800 lg:bg-bg-primary-900', classNames.providerThumbnailRoot), children: _jsx(Image, { src: jackpotsProps.gameProviderImages?.[provider.id] ??
|
|
53
53
|
provider.logo, alt: "provider", className: twMerge('size-full', classNames.providerThumbnailImage), width: 300, height: 150 }) }, provider.slug))) }) })] }));
|
|
54
54
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type CSSProperties } from 'react';
|
|
2
|
+
import type { ClassNameEntries } from './JackpotsList';
|
|
2
3
|
interface JackpotsListItemMobileProps {
|
|
3
|
-
className?:
|
|
4
|
+
className?: ClassNameEntries;
|
|
4
5
|
style?: CSSProperties;
|
|
5
6
|
animate?: boolean;
|
|
6
7
|
customJackpotChestImage?: {
|
|
@@ -15,5 +16,5 @@ interface JackpotsListItemMobileProps {
|
|
|
15
16
|
};
|
|
16
17
|
jackpotProfileShape?: 'oval' | 'star';
|
|
17
18
|
}
|
|
18
|
-
export declare function JackpotsListItemMobile({ animate, customJackpotChestImage, jackpotProfileShape, ...props }: JackpotsListItemMobileProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function JackpotsListItemMobile({ animate, customJackpotChestImage, jackpotProfileShape, className, ...props }: JackpotsListItemMobileProps): import("react/jsx-runtime").JSX.Element;
|
|
19
20
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Progress } from '@ark-ui/react/progress';
|
|
3
3
|
import { format } from 'date-fns';
|
|
4
4
|
import Image from 'next/image';
|
|
@@ -21,12 +21,17 @@ import { capitalize } from '../../../utils/capitalize.js';
|
|
|
21
21
|
import { formatNumber } from '../../../utils/formatNumber.js';
|
|
22
22
|
import { mask } from '../../../utils/mask.js';
|
|
23
23
|
import { parseDecimal } from '../../../utils/parseDecimal.js';
|
|
24
|
+
import styles from '../Jackpots.module.css';
|
|
24
25
|
import { useJackpotsListItemContext } from './JackpotsListContext.js';
|
|
25
|
-
import styles from './JackpotsListItem.module.css';
|
|
26
26
|
import { JackpotsListItemGameProviders } from './JackpotsListItemGameProviders.js';
|
|
27
27
|
import { JackpotsListItemRules } from './JackpotsListItemRules.js';
|
|
28
28
|
import { useJackpotsListItemData } from './useJackpotsListItemData.js';
|
|
29
|
-
|
|
29
|
+
function getPercentage(value, total) {
|
|
30
|
+
const v = parseDecimal(value, 0);
|
|
31
|
+
const t = parseDecimal(total, 0);
|
|
32
|
+
return t === 0 ? 0 : (v / t) * 100;
|
|
33
|
+
}
|
|
34
|
+
export function JackpotsListItemMobile({ animate = true, customJackpotChestImage, jackpotProfileShape = 'oval', className, ...props }) {
|
|
30
35
|
const jackpot = useJackpotsListItemContext();
|
|
31
36
|
const { jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, getAccumulatingJackpotDescription, } = useJackpotsListItemData();
|
|
32
37
|
const [isDetailsVisible, setIsDetailsVisible] = useState(false);
|
|
@@ -54,7 +59,48 @@ export function JackpotsListItemMobile({ animate = true, customJackpotChestImage
|
|
|
54
59
|
return () => clearTimeout(timeout);
|
|
55
60
|
}
|
|
56
61
|
}, [minLimitTooltipOpen]);
|
|
57
|
-
|
|
62
|
+
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" }), _jsxs("div", { className: "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", children: [topJackpotPayout.multiplier, "x"] })] })) : (_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" }), _jsxs("div", { className: "-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", children: [topJackpotPayout.multiplier, "x"] })] }));
|
|
63
|
+
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) }), "Recent Payout"] }));
|
|
64
|
+
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, {
|
|
65
|
+
currency: localeInfo.currency.code,
|
|
66
|
+
compact: true,
|
|
67
|
+
}) }), _jsxs("div", { className: "relative flex items-center justify-end gap-1.5", children: [isPayingOut ? (_jsxs("div", { className: "flex w-6 items-center", children: [_jsx("div", { className: twMerge('absolute left-0', styles['animate-arrow-red-flash-1']), children: _jsx(ChevronLeftIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-1.5', styles['animate-arrow-red-flash-2']), children: _jsx(ChevronLeftIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-3', styles['animate-arrow-red-flash-3']), children: _jsx(ChevronLeftIcon, { className: "size-4.5" }) })] })) : (_jsxs("div", { className: "flex w-6 items-center", children: [_jsx("div", { className: twMerge('absolute left-0', styles['animate-arrow-green-flash-1']), children: _jsx(ChevronRightIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-1.5', styles['animate-arrow-green-flash-2']), children: _jsx(ChevronRightIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-3', styles['animate-arrow-green-flash-3']), children: _jsx(ChevronRightIcon, { className: "size-4.5" }) })] })), _jsx("div", { className: "font-semibold text-text-primary-900 text-xs", children: formatNumber(jackpot?.maximumJackpotPoolLimit, {
|
|
68
|
+
currency: localeInfo.currency.code,
|
|
69
|
+
compact: true,
|
|
70
|
+
}) })] })] }), _jsx(Progress.Root, { className: "h-2 w-full rounded-full bg-bg-primary lg:h-4", max: 100, value: getPercentage(jackpot.pool, jackpot.maximumJackpotPoolLimit), "aria-valuenow": getPercentage(jackpot.pool, jackpot.maximumJackpotPoolLimit), "aria-valuemax": 100, "aria-label": "Jackpot progress", children: _jsx(Progress.Track, { className: twMerge('h-full overflow-hidden rounded-full bg-bg-primary', className?.progressBarTrack), children: _jsxs(Progress.Range, { className: "relative h-full overflow-hidden rounded-full bg-brand-500 pl-1.5", children: [_jsxs(Tooltip.Root, { open: mainTooltipOpen, onOpenChange: (details) => setMainTooltipOpen(details.open), openDelay: 0, closeDelay: 100, lazyMount: true, unmountOnExit: true, positioning: { strategy: 'fixed', placement: 'top' }, children: [_jsx(Tooltip.Trigger, { asChild: true, children: _jsx("div", { className: "absolute inset-0 h-full w-full", onClick: handleMainTooltipClick, role: "button", tabIndex: 0, "aria-label": "Show current jackpot tooltip", "aria-describedby": mainTooltipId }) }), _jsx(Tooltip.Positioner, { children: _jsxs(Tooltip.Content, { id: mainTooltipId, children: [_jsxs("div", { className: "text-xs", children: ["Current\uD83D\uDCB0:", ' ', formatNumber(jackpot.pool, {
|
|
71
|
+
currency: localeInfo.currency.code,
|
|
72
|
+
minDecimalPlaces: 2,
|
|
73
|
+
maxDecimalPlaces: 2,
|
|
74
|
+
})] }), _jsx(Tooltip.Arrow, { children: _jsx(Tooltip.ArrowTip, {}) })] }) })] }), _jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-start pl-1.5", "aria-hidden": "true", children: arrowImages }), _jsxs(Tooltip.Root, { open: minLimitTooltipOpen, onOpenChange: (details) => setMinLimitTooltipOpen(details.open), openDelay: 0, closeDelay: 100, lazyMount: true, unmountOnExit: true, positioning: { strategy: 'fixed', placement: 'top' }, children: [_jsx(Tooltip.Trigger, { asChild: true, children: _jsx("div", { onClick: handleMinLimitTooltipClick, className: "absolute inset-0 h-full bg-black opacity-30", style: {
|
|
75
|
+
width: `${getPercentage(jackpot.minimumJackpotPoolDrawingLimit, jackpot.pool)}%`,
|
|
76
|
+
}, role: "button", tabIndex: 0, "aria-label": "Show minimum payout limit tooltip", "aria-describedby": minLimitTooltipId }) }), _jsx(Tooltip.Positioner, { children: _jsxs(Tooltip.Content, { id: minLimitTooltipId, children: [_jsxs("div", { className: "text-xs", children: ["Minimum Payout Limit:", ' ', formatNumber(jackpot.minimumJackpotPoolDrawingLimit, {
|
|
77
|
+
currency: localeInfo.currency.code,
|
|
78
|
+
minDecimalPlaces: 2,
|
|
79
|
+
maxDecimalPlaces: 2,
|
|
80
|
+
})] }), _jsx(Tooltip.Arrow, { children: _jsx(Tooltip.ArrowTip, {}) })] }) })] })] }) }) }), _jsx("div", { className: "mt-1 block text-start text-2xs lg:hidden", children: isPayingOut
|
|
81
|
+
? `The pot has hit ${formatNumber(jackpot?.maximumJackpotPoolLimit, {
|
|
82
|
+
currency: localeInfo.currency.code,
|
|
83
|
+
compact: true,
|
|
84
|
+
})} Play now for your chance to win big! π₯`
|
|
85
|
+
: getAccumulatingJackpotDescription(Number(jackpot?.pool) ?? 0, Number(jackpot?.maximumJackpotPoolLimit) ?? 0) })] }));
|
|
86
|
+
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: [
|
|
87
|
+
'Player',
|
|
88
|
+
'Game Provider',
|
|
89
|
+
'Multiplier',
|
|
90
|
+
'Prize',
|
|
91
|
+
'Timestamp',
|
|
92
|
+
].map((header) => (_jsx("th", { className: "px-4", children: header }, header))) }) }), _jsx("tbody", { children: jackpotPayouts.length
|
|
93
|
+
? jackpotPayouts.map((jackpotPayout, i) => (_jsxs("tr", { className: twMerge('whitespace-nowrap bg-bg-primary text-left text-sm text-text-secondary-700', className?.recentPayoutsTableBodyRow), children: [_jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: mask(jackpotPayout.member.name, {
|
|
94
|
+
totalCharsCount: 6,
|
|
95
|
+
}) }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: capitalize(jackpotPayout.game?.provider ?? '-', {
|
|
96
|
+
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
97
|
+
}) }), _jsxs("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: [jackpotPayout.multiplier, "x"] }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4 text-brand-400", children: formatNumber(jackpotPayout.amount, {
|
|
98
|
+
currency: localeInfo.currency.code,
|
|
99
|
+
minDecimalPlaces: 2,
|
|
100
|
+
maxDecimalPlaces: 2,
|
|
101
|
+
}) }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: format(new Date(jackpotPayout.dateTimeCreated), 'dd MMM yyyy h:mm a') })] }, i)))
|
|
102
|
+
: 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: "h-12 border-border-secondary border-t-2 px-4", children: "-" }, j))) }, i))) })] }) }));
|
|
103
|
+
return (_jsxs("div", { style: props.style, className: twMerge('rounded-2xl border border-border-primary bg-bg-primary', className?.itemRoot), children: [_jsxs("div", { 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, {
|
|
58
104
|
currency: localeInfo.currency.code,
|
|
59
105
|
minDecimalPlaces: 2,
|
|
60
106
|
maxDecimalPlaces: 2,
|
|
@@ -64,51 +110,9 @@ export function JackpotsListItemMobile({ animate = true, customJackpotChestImage
|
|
|
64
110
|
: customJackpotChestImage.image.closed
|
|
65
111
|
: isPayingOut
|
|
66
112
|
? openChest
|
|
67
|
-
: closeChest, alt: "closeChest", className: twMerge('size-full h-34.5 w-34.5 p-2 lg:h-37.5 lg:w-37.5', customJackpotChestImage?.style?.image) }) })] }) }) }) }),
|
|
68
|
-
currency: localeInfo.currency.code,
|
|
69
|
-
compact: true,
|
|
70
|
-
}) }), _jsxs("div", { className: "relative flex items-center justify-end gap-1.5", children: [isPayingOut ? (_jsxs("div", { className: "flex w-6 items-center", children: [_jsx("div", { className: twMerge('absolute left-0', styles['animate-arrow-red-flash-1']), children: _jsx(ChevronLeftIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-1.5', styles['animate-arrow-red-flash-2']), children: _jsx(ChevronLeftIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-3', styles['animate-arrow-red-flash-3']), children: _jsx(ChevronLeftIcon, { className: "size-4.5" }) })] })) : (_jsxs("div", { className: "flex w-6 items-center", children: [_jsx("div", { className: twMerge('absolute left-0', styles['animate-arrow-green-flash-1']), children: _jsx(ChevronRightIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-1.5', styles['animate-arrow-green-flash-2']), children: _jsx(ChevronRightIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-3', styles['animate-arrow-green-flash-3']), children: _jsx(ChevronRightIcon, { className: "size-4.5" }) })] })), _jsx("div", { className: "font-semibold text-text-primary-900 text-xs", children: formatNumber(jackpot?.maximumJackpotPoolLimit, {
|
|
71
|
-
currency: localeInfo.currency.code,
|
|
72
|
-
compact: true,
|
|
73
|
-
}) })] })] }), _jsx(Progress.Root, { className: "h-2 w-full rounded-full bg-bg-primary lg:h-4", max: 100, value: getPercentage(jackpot.pool, jackpot.maximumJackpotPoolLimit), "aria-valuenow": getPercentage(jackpot.pool, jackpot.maximumJackpotPoolLimit), "aria-valuemax": 100, "aria-label": "Jackpot progress", children: _jsx(Progress.Track, { className: "h-full overflow-hidden rounded-full bg-bg-primary", children: _jsxs(Progress.Range, { className: "relative h-full overflow-hidden rounded-full bg-brand-500 pl-1.5", children: [_jsxs(Tooltip.Root, { open: mainTooltipOpen, onOpenChange: (details) => setMainTooltipOpen(details.open), openDelay: 0, closeDelay: 100, lazyMount: true, unmountOnExit: true, positioning: { strategy: 'fixed', placement: 'top' }, children: [_jsx(Tooltip.Trigger, { asChild: true, children: _jsx("div", { className: "absolute inset-0 h-full w-full", onClick: handleMainTooltipClick, role: "button", tabIndex: 0, "aria-label": "Show current jackpot tooltip", "aria-describedby": mainTooltipId }) }), _jsx(Tooltip.Positioner, { children: _jsxs(Tooltip.Content, { id: mainTooltipId, children: [_jsxs("div", { className: "text-xs", children: ["Current\uD83D\uDCB0:", ' ', formatNumber(jackpot.pool, {
|
|
74
|
-
currency: localeInfo.currency.code,
|
|
75
|
-
minDecimalPlaces: 2,
|
|
76
|
-
maxDecimalPlaces: 2,
|
|
77
|
-
})] }), _jsx(Tooltip.Arrow, { children: _jsx(Tooltip.ArrowTip, {}) })] }) })] }), _jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-start pl-1.5", "aria-hidden": "true", children: arrowImages }), _jsxs(Tooltip.Root, { open: minLimitTooltipOpen, onOpenChange: (details) => setMinLimitTooltipOpen(details.open), openDelay: 0, closeDelay: 100, lazyMount: true, unmountOnExit: true, positioning: { strategy: 'fixed', placement: 'top' }, children: [_jsx(Tooltip.Trigger, { asChild: true, children: _jsx("div", { onClick: handleMinLimitTooltipClick, className: "absolute inset-0 h-full bg-black opacity-30", style: {
|
|
78
|
-
width: `${getPercentage(jackpot.minimumJackpotPoolDrawingLimit, jackpot.pool)}%`,
|
|
79
|
-
}, role: "button", tabIndex: 0, "aria-label": "Show minimum payout limit tooltip", "aria-describedby": minLimitTooltipId }) }), _jsx(Tooltip.Positioner, { children: _jsxs(Tooltip.Content, { id: minLimitTooltipId, children: [_jsxs("div", { className: "text-xs", children: ["Minimum Payout Limit:", ' ', formatNumber(jackpot.minimumJackpotPoolDrawingLimit, {
|
|
80
|
-
currency: localeInfo.currency.code,
|
|
81
|
-
minDecimalPlaces: 2,
|
|
82
|
-
maxDecimalPlaces: 2,
|
|
83
|
-
})] }), _jsx(Tooltip.Arrow, { children: _jsx(Tooltip.ArrowTip, {}) })] }) })] })] }) }) }), _jsx("div", { className: "mt-1 block text-start text-2xs lg:hidden", children: isPayingOut
|
|
84
|
-
? `The pot has hit ${formatNumber(jackpot?.maximumJackpotPoolLimit, {
|
|
85
|
-
currency: localeInfo.currency.code,
|
|
86
|
-
compact: true,
|
|
87
|
-
})} Play now for your chance to win big! π₯`
|
|
88
|
-
: getAccumulatingJackpotDescription(Number(jackpot?.pool) ?? 0, Number(jackpot?.maximumJackpotPoolLimit) ?? 0) })] }), topJackpotPayout.amount ? (_jsx("div", { children: _jsxs("div", { className: "relative mt-4 flex w-full gap-4 rounded-lg bg-bg-primary p-4", children: [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" }), _jsxs("div", { className: "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", children: [topJackpotPayout.multiplier, "x"] })] })) : (_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" }), _jsxs("div", { className: "-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", children: [topJackpotPayout.multiplier, "x"] })] })), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsxs("div", { className: "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", children: [_jsx(Trophy01Icon, { className: "size-3.5 text-utility-brand-600" }), "Recent Payout"] }), _jsx("div", { className: "font-semibold", children: mask(topJackpotPayout.member.name) }), _jsx("div", { className: "text-2xl text-brand-400", children: formatNumber(topJackpotPayout.amount, {
|
|
113
|
+
: closeChest, alt: "closeChest", className: twMerge('size-full h-34.5 w-34.5 p-2 lg:h-37.5 lg:w-37.5', customJackpotChestImage?.style?.image) }) })] }) }) }) }), _jsx(ProgressBar, {}), _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) }), _jsx("div", { className: "text-2xl text-brand-400", children: formatNumber(topJackpotPayout.amount, {
|
|
89
114
|
currency: localeInfo.currency.code,
|
|
90
115
|
minDecimalPlaces: 2,
|
|
91
116
|
maxDecimalPlaces: 2,
|
|
92
|
-
}) })] })] })
|
|
93
|
-
'Player',
|
|
94
|
-
'Game Provider',
|
|
95
|
-
'Multiplier',
|
|
96
|
-
'Prize',
|
|
97
|
-
'Timestamp',
|
|
98
|
-
].map((header) => (_jsx("th", { className: "px-4", children: header }, header))) }) }), _jsx("tbody", { children: jackpotPayouts.length
|
|
99
|
-
? jackpotPayouts.map((jackpotPayout, i) => (_jsxs("tr", { className: "whitespace-nowrap bg-bg-primary text-left text-sm text-text-secondary-700", children: [_jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: mask(jackpotPayout.member.name, {
|
|
100
|
-
totalCharsCount: 6,
|
|
101
|
-
}) }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: capitalize(jackpotPayout.game?.provider ?? '-', {
|
|
102
|
-
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
103
|
-
}) }), _jsxs("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: [jackpotPayout.multiplier, "x"] }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4 text-brand-400", children: formatNumber(jackpotPayout.amount, {
|
|
104
|
-
currency: localeInfo.currency.code,
|
|
105
|
-
minDecimalPlaces: 2,
|
|
106
|
-
maxDecimalPlaces: 2,
|
|
107
|
-
}) }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: format(new Date(jackpotPayout.dateTimeCreated), 'dd MMM yyyy h:mm a') })] }, i)))
|
|
108
|
-
: Array.from({ length: 10 }).map((_, i) => (_jsxs("tr", { className: "bg-bg-primary text-left text-sm text-text-secondary-700", children: [_jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: "-" }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: "-" }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: "-" }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: "-" }), _jsx("td", { className: "h-12 border-border-secondary border-t-2 px-4", children: "-" })] }, i))) })] }) })] }), 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" })] }) }) })] }))] }));
|
|
109
|
-
}
|
|
110
|
-
function getPercentage(value, total) {
|
|
111
|
-
const v = parseDecimal(value, 0);
|
|
112
|
-
const t = parseDecimal(total, 0);
|
|
113
|
-
return t === 0 ? 0 : (v / t) * 100;
|
|
117
|
+
}) })] })] })) : (_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 tournament!" })] })] })) }), _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-0 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: [_jsx("div", { className: "flex gap-2", children: _jsx("div", { className: "font-semibold text-lg text-text-primary-900", children: jackpotPayouts.length ? 'Recent payouts' : 'Starting soon!' }) }), _jsx(JackpotsListItemRules, {})] }), _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" })] }) }) })] }))] }));
|
|
114
118
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useMemo } from
|
|
3
|
-
import { twMerge } from
|
|
4
|
-
import { useJackpotPayoutsQuery } from
|
|
5
|
-
import { useLocaleInfo } from
|
|
6
|
-
import { GAME_PROVIDER_DATA } from
|
|
7
|
-
import { ChevronLeftIcon } from
|
|
8
|
-
import { ChevronRightIcon } from
|
|
9
|
-
import
|
|
10
|
-
import
|
|
2
|
+
import { useCallback, useMemo } from 'react';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { useJackpotPayoutsQuery } from '../../../client/hooks/useJackpotPayoutsQuery.js';
|
|
5
|
+
import { useLocaleInfo } from '../../../client/hooks/useLocaleInfo.js';
|
|
6
|
+
import { GAME_PROVIDER_DATA } from '../../../constants/index.js';
|
|
7
|
+
import { ChevronLeftIcon } from '../../../icons/ChevronLeftIcon.js';
|
|
8
|
+
import { ChevronRightIcon } from '../../../icons/ChevronRightIcon.js';
|
|
9
|
+
import styles from '../Jackpots.module.css';
|
|
10
|
+
import { useJackpotsListItemContext, useJackpotsListPropsContext, } from './JackpotsListContext.js';
|
|
11
11
|
export function useJackpotsListItemData() {
|
|
12
12
|
const jackpotsListProps = useJackpotsListPropsContext();
|
|
13
13
|
const jackpot = useJackpotsListItemContext();
|
|
@@ -20,7 +20,7 @@ export function useJackpotsListItemData() {
|
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
22
|
}, {
|
|
23
|
-
enabled: typeof window !==
|
|
23
|
+
enabled: typeof window !== 'undefined',
|
|
24
24
|
});
|
|
25
25
|
const jackpotPayouts = jackpotPayoutsQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
|
|
26
26
|
const topJackpotPayout = jackpotPayouts[0] ?? [];
|
|
@@ -36,9 +36,9 @@ export function useJackpotsListItemData() {
|
|
|
36
36
|
const jackpotAmount = jackpot.pool;
|
|
37
37
|
const Arrow = useCallback(({ index }) => {
|
|
38
38
|
const Icon = isPayingOut ? ChevronLeftIcon : ChevronRightIcon;
|
|
39
|
-
return (_jsx(Icon, { className: twMerge(
|
|
40
|
-
? styles[
|
|
41
|
-
: styles[
|
|
39
|
+
return (_jsx(Icon, { className: twMerge('min-w-2.5 scale-400 text-brand-300 lg:min-w-4 lg:scale-250', isPayingOut
|
|
40
|
+
? styles['animate-wave-color-error']
|
|
41
|
+
: styles['animate-wave-color-success']), style: {
|
|
42
42
|
animationDelay: isPayingOut
|
|
43
43
|
? `${(40 - index - 1) * 0.1}s`
|
|
44
44
|
: `${index * 0.1}s`,
|
|
@@ -48,8 +48,8 @@ export function useJackpotsListItemData() {
|
|
|
48
48
|
const getAccumulatingJackpotDescription = (part, total) => {
|
|
49
49
|
const percentage = total === 0 ? 0 : (part / total) * 100;
|
|
50
50
|
return percentage <= 90
|
|
51
|
-
?
|
|
52
|
-
:
|
|
51
|
+
? 'The jackpot is heating up! Keep playing to stay in the action and watch it grow!'
|
|
52
|
+
: 'π₯ Itβs about to pop! Stay in the game for your shot at the prize!';
|
|
53
53
|
};
|
|
54
54
|
return {
|
|
55
55
|
jackpotPayouts,
|
package/dist/styles/theme.css
CHANGED
|
@@ -226,6 +226,13 @@
|
|
|
226
226
|
--color-bg-warning-secondary: #dc6803;
|
|
227
227
|
--color-bg-dark: #202020;
|
|
228
228
|
|
|
229
|
+
|
|
230
|
+
--color-jackpot-rays-primary: var(--color-bg-tertiary);
|
|
231
|
+
--color-jackpot-rays-secondary: var(--color-bg-quaternary);
|
|
232
|
+
--color-jackpot-table-scrollbar-track: var(--color-bg-primary-alt);
|
|
233
|
+
--color-jackpot-table-scrollbar-thumb: var(--color-bg-quaternary);
|
|
234
|
+
|
|
235
|
+
|
|
229
236
|
--color-text-brand: #feee95;
|
|
230
237
|
--color-text-brand-700: #a15c07;
|
|
231
238
|
--color-text-brand-primary-600: #eaaa08;
|