@opexa/portal-components 0.0.730 → 0.0.731
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/Jackpots/Jackpots.module.css +219 -219
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.d.ts +19 -0
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.js +6 -0
- package/dist/components/Jackpots/JackpotsCarouselNext/JackpotsCarousel.d.ts +87 -0
- package/dist/components/Jackpots/JackpotsCarouselNext/JackpotsCarousel.js +76 -0
- package/dist/components/Jackpots/JackpotsCarouselNext/JackpotsCarouselContext.d.ts +6 -0
- package/dist/components/Jackpots/JackpotsCarouselNext/JackpotsCarouselContext.js +2 -0
- package/dist/components/Jackpots/JackpotsCarouselNext/JackpotsCarouselItem.d.ts +44 -0
- package/dist/components/Jackpots/JackpotsCarouselNext/JackpotsCarouselItem.js +198 -0
- package/dist/components/Jackpots/JackpotsCarouselNext/JackpotsCarouselStageItem.d.ts +60 -0
- package/dist/components/Jackpots/JackpotsCarouselNext/JackpotsCarouselStageItem.js +159 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsList.d.ts +0 -1
- package/dist/components/Jackpots/JackpotsListNext/JackpotMultiStageMobile.js +2 -12
- package/dist/components/Jackpots/JackpotsListNext/JackpotsList.d.ts +0 -1
- package/dist/components/Jackpots/JackpotsListNext/JackpotsList.js +2 -2
- package/dist/components/KYC/KYCDefault/KYCVerificationStatus.lazy.js +2 -2
- package/dist/components/KYC/KYCVerificationStatus.lazy.js +7 -13
- package/dist/components/PortalProvider/AndroidOnlyComponents.d.ts +1 -0
- package/dist/components/PortalProvider/AndroidOnlyComponents.js +12 -0
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
- package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
- package/dist/services/queries.js +3069 -3069
- package/dist/styles/theme.css +773 -773
- package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Carousel/Carousel.d.ts +45 -45
- package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
- 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 +307 -307
- package/dist/ui/Menu/menu.recipe.d.ts +17 -17
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +121 -121
- package/dist/ui/Popover/popover.recipe.d.ts +11 -11
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/QrCode/QrCode.d.ts +25 -25
- package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
- 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/package.json +176 -176
- package/dist/components/DepositWithdrawal/AiOPaymentMethods.d.ts +0 -11
- package/dist/components/DepositWithdrawal/AiOPaymentMethods.js +0 -55
- package/dist/components/DigitainLauncher/Loading.d.ts +0 -1
- package/dist/components/DigitainLauncher/Loading.js +0 -5
- package/dist/components/Disclaimer/ResponsibleGaming.d.ts +0 -10
- package/dist/components/Disclaimer/ResponsibleGaming.js +0 -13
- package/dist/components/Disclaimer/TermsOfUse.d.ts +0 -11
- package/dist/components/Disclaimer/TermsOfUse.js +0 -13
- package/dist/components/FeatureFlag/FeatureFlag.d.ts +0 -1
- package/dist/components/FeatureFlag/FeatureFlag.js +0 -29
- package/dist/components/FeatureFlag/index.d.ts +0 -1
- package/dist/components/FeatureFlag/index.js +0 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +0 -184
- package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +0 -184
- package/dist/components/KYC/AutoOpen.d.ts +0 -1
- package/dist/components/KYC/AutoOpen.js +0 -40
- package/dist/components/KYC/BasicInformation.d.ts +0 -1
- package/dist/components/KYC/BasicInformation.js +0 -101
- package/dist/components/KYC/CaptureIdDocument.d.ts +0 -1
- package/dist/components/KYC/CaptureIdDocument.js +0 -219
- package/dist/components/KYC/CaptureSelfie.d.ts +0 -1
- package/dist/components/KYC/CaptureSelfie.js +0 -285
- package/dist/components/KYC/DisplayImage.d.ts +0 -5
- package/dist/components/KYC/DisplayImage.js +0 -8
- package/dist/components/KYC/FileUpload.d.ts +0 -10
- package/dist/components/KYC/FileUpload.js +0 -72
- package/dist/components/KYC/IdentityVerification.d.ts +0 -1
- package/dist/components/KYC/IdentityVerification.js +0 -120
- package/dist/components/KYC/Indicator.d.ts +0 -1
- package/dist/components/KYC/Indicator.js +0 -8
- package/dist/components/KYC/KYC.lazy.d.ts +0 -6
- package/dist/components/KYC/KYC.lazy.js +0 -45
- package/dist/components/KYC/KYCContext.d.ts +0 -6
- package/dist/components/KYC/KYCContext.js +0 -2
- package/dist/components/KYC/NoCameraError.d.ts +0 -7
- package/dist/components/KYC/NoCameraError.js +0 -6
- package/dist/components/KYC/PersonOverlayDesktop.d.ts +0 -7
- package/dist/components/KYC/PersonOverlayDesktop.js +0 -9
- package/dist/components/KYC/PersonalInformation.d.ts +0 -1
- package/dist/components/KYC/PersonalInformation.js +0 -122
- package/dist/components/KYC/backup/Header.d.ts +0 -1
- package/dist/components/KYC/backup/Header.js +0 -8
- package/dist/components/KYC/backup/Indicator.d.ts +0 -1
- package/dist/components/KYC/backup/Indicator.js +0 -9
- package/dist/components/KYC/backup/KYC.d.ts +0 -1
- package/dist/components/KYC/backup/KYC.js +0 -14
- package/dist/components/KYC/backup/KYC.lazy.d.ts +0 -1
- package/dist/components/KYC/backup/KYC.lazy.js +0 -26
- package/dist/components/KYC/backup/KYCContext.d.ts +0 -6
- package/dist/components/KYC/backup/KYCContext.js +0 -2
- package/dist/components/KYC/backup/Step1.d.ts +0 -1
- package/dist/components/KYC/backup/Step1.js +0 -13
- package/dist/components/KYC/backup/Step2.d.ts +0 -1
- package/dist/components/KYC/backup/Step2.js +0 -13
- package/dist/components/KYC/backup/Step3.d.ts +0 -1
- package/dist/components/KYC/backup/Step3.js +0 -13
- package/dist/components/KYC/backup/Step4.d.ts +0 -1
- package/dist/components/KYC/backup/Step4.js +0 -7
- package/dist/components/KYC/backup/useKYC.d.ts +0 -10
- package/dist/components/KYC/backup/useKYC.js +0 -8
- package/dist/components/KYC/loadModels.d.ts +0 -1
- package/dist/components/KYC/loadModels.js +0 -9
- package/dist/components/KYC/useKYC.d.ts +0 -25
- package/dist/components/KYC/useKYC.js +0 -38
- package/dist/components/KYC/utils.d.ts +0 -9
- package/dist/components/KYC/utils.js +0 -79
- package/dist/components/Messages/Message.d.ts +0 -1
- package/dist/components/Messages/Message.js +0 -35
- package/dist/components/Messages/MessageContext.d.ts +0 -6
- package/dist/components/Messages/MessageContext.js +0 -2
- package/dist/components/Messages/MessagePopup.d.ts +0 -1
- package/dist/components/Messages/MessagePopup.js +0 -20
- package/dist/components/Messages/MessageTrigger.d.ts +0 -8
- package/dist/components/Messages/MessageTrigger.js +0 -19
- package/dist/components/PortalProvider/CXDTokenObserver.d.ts +0 -1
- package/dist/components/PortalProvider/CXDTokenObserver.js +0 -30
- package/dist/components/PortalProvider/LinkGoogleAccountObserver.d.ts +0 -1
- package/dist/components/PortalProvider/LinkGoogleAccountObserver.js +0 -29
- package/dist/components/Quests/CountdownTimer.d.ts +0 -15
- package/dist/components/Quests/CountdownTimer.js +0 -33
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +0 -4
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +0 -78
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +0 -8
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +0 -9
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +0 -4
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +0 -4
- package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +0 -4
- package/dist/components/Quests/WageringQuest/WageringQuest.js +0 -20
- package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +0 -9
- package/dist/components/Quests/WageringQuest/WageringQuestModal.js +0 -9
- package/dist/components/SessionWatcher/SessionWatcher.d.ts +0 -1
- package/dist/components/SessionWatcher/SessionWatcher.js +0 -20
- package/dist/components/SessionWatcher/index.d.ts +0 -1
- package/dist/components/SessionWatcher/index.js +0 -1
- package/dist/components/SignIn/utils.d.ts +0 -8
- package/dist/components/SignIn/utils.js +0 -26
- package/dist/components/SignUp/SignUp.lazy.d.ts +0 -12
- package/dist/components/SignUp/SignUp.lazy.js +0 -18
- package/dist/components/SignUp/SignUpContext.d.ts +0 -6
- package/dist/components/SignUp/SignUpContext.js +0 -2
- package/dist/components/SignUp/SignUpDefault/SignUp.lazy.d.ts +0 -17
- package/dist/components/SignUp/SignUpDefault/SignUp.lazy.js +0 -18
- package/dist/components/SignUp/SignUpDefault/SignUpContext.d.ts +0 -6
- package/dist/components/SignUp/SignUpDefault/SignUpContext.js +0 -2
- package/dist/components/SignUp/SignUpDefault/SignUpForm.d.ts +0 -1
- package/dist/components/SignUp/SignUpDefault/SignUpForm.js +0 -310
- package/dist/components/SignUp/SignUpForm.d.ts +0 -1
- package/dist/components/SignUp/SignUpForm.js +0 -284
- package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.d.ts +0 -1
- package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.js +0 -198
- package/dist/components/SignUp/SignUpKYC/CaptureSelfie.d.ts +0 -1
- package/dist/components/SignUp/SignUpKYC/CaptureSelfie.js +0 -251
- package/dist/components/SignUp/SignUpKYC/ImageUploader.d.ts +0 -10
- package/dist/components/SignUp/SignUpKYC/ImageUploader.js +0 -42
- package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.d.ts +0 -7
- package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.js +0 -9
- package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.d.ts +0 -1
- package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.js +0 -464
- package/dist/components/SignUp/SignUpKYC/useImageUploader.d.ts +0 -11
- package/dist/components/SignUp/SignUpKYC/useImageUploader.js +0 -20
- package/dist/components/SignUp/SignUpKYC/utils.d.ts +0 -9
- package/dist/components/SignUp/SignUpKYC/utils.js +0 -79
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.d.ts +0 -1
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.js +0 -198
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.d.ts +0 -1
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.js +0 -251
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.d.ts +0 -10
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.js +0 -41
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.d.ts +0 -1
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.js +0 -429
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.d.ts +0 -13
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.js +0 -26
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.d.ts +0 -7
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.js +0 -2
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.d.ts +0 -11
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.js +0 -20
- package/dist/components/shared/IdDocumentField.client.d.ts +0 -25
- package/dist/components/shared/IdDocumentField.client.js +0 -204
- package/dist/components/shared/IdDocumentField.d.ts +0 -2
- package/dist/components/shared/IdDocumentField.js +0 -11
- package/dist/components/shared/SelfieField.client.d.ts +0 -20
- package/dist/components/shared/SelfieField.client.js +0 -327
- package/dist/components/shared/SelfieField.d.ts +0 -2
- package/dist/components/shared/SelfieField.js +0 -11
- package/dist/constants/BranchCode.d.ts +0 -4
- package/dist/constants/BranchCode.js +0 -42
- package/dist/constants/Branches.d.ts +0 -2
- package/dist/constants/Branches.js +0 -42
- package/dist/handlers/postTransformIdFrontImage.d.ts +0 -3
- package/dist/handlers/postTransformIdFrontImage.js +0 -67
- package/dist/handlers/postTransformSelfieImage.d.ts +0 -3
- package/dist/handlers/postTransformSelfieImage.js +0 -71
- package/dist/handlers.d.ts +0 -43
- package/dist/handlers.js +0 -297
- package/dist/icons/BellRingIcon.d.ts +0 -2
- package/dist/icons/BellRingIcon.js +0 -4
- package/dist/images/responsible-gaming-yellow.png +0 -0
- package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +0 -4
- package/dist/third-parties/FacebookPixel/FacebookPixel.js +0 -4
- package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
- package/dist/third-parties/FacebookPixel/api.js +0 -1
- package/dist/third-parties/FacebookPixel/index.d.ts +0 -1
- package/dist/third-parties/FacebookPixel/index.js +0 -1
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +0 -4
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +0 -4
- package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
- package/dist/third-parties/GoogleRecaptcha/api.js +0 -1
- package/dist/third-parties/GoogleRecaptcha/index.d.ts +0 -1
- package/dist/third-parties/GoogleRecaptcha/index.js +0 -1
- package/dist/third-parties/index.d.ts +0 -2
- package/dist/third-parties/index.js +0 -2
- package/dist/utils/dataUrlToBlob.d.ts +0 -1
- package/dist/utils/dataUrlToBlob.js +0 -11
- package/dist/utils/gamesAvailable3pmTo3am.d.ts +0 -1
- package/dist/utils/gamesAvailable3pmTo3am.js +0 -1
- package/dist/utils/getGameName.d.ts +0 -1
- package/dist/utils/getGameName.js +0 -6
- package/dist/utils/isBetween3amAnd3pm.d.ts +0 -1
- package/dist/utils/isBetween3amAnd3pm.js +0 -5
- package/dist/utils/resizeImageSize.d.ts +0 -2
- package/dist/utils/resizeImageSize.js +0 -11
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type ImageProps } from 'next/image';
|
|
2
|
+
import { type CSSProperties } from 'react';
|
|
3
|
+
import type { ClassNameEntries } from './JackpotsCarousel';
|
|
4
|
+
export interface JackpotsCarouselItemProps {
|
|
5
|
+
style?: CSSProperties;
|
|
6
|
+
className?: ClassNameEntries;
|
|
7
|
+
/** @default "/jackpots" */
|
|
8
|
+
viewAllUrl?: string;
|
|
9
|
+
customJackpotChestImage?: {
|
|
10
|
+
image: {
|
|
11
|
+
open: string;
|
|
12
|
+
closed: string;
|
|
13
|
+
};
|
|
14
|
+
style?: {
|
|
15
|
+
wrapper?: string;
|
|
16
|
+
image?: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
animate?: boolean;
|
|
20
|
+
chestImagesByTier?: {
|
|
21
|
+
grand?: {
|
|
22
|
+
open: ImageProps['src'];
|
|
23
|
+
closed: ImageProps['src'];
|
|
24
|
+
};
|
|
25
|
+
major?: {
|
|
26
|
+
open: ImageProps['src'];
|
|
27
|
+
closed: ImageProps['src'];
|
|
28
|
+
};
|
|
29
|
+
minor?: {
|
|
30
|
+
open: ImageProps['src'];
|
|
31
|
+
closed: ImageProps['src'];
|
|
32
|
+
};
|
|
33
|
+
default?: {
|
|
34
|
+
open: ImageProps['src'];
|
|
35
|
+
closed: ImageProps['src'];
|
|
36
|
+
};
|
|
37
|
+
style?: {
|
|
38
|
+
wrapper?: string;
|
|
39
|
+
image?: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
jackpotProfileShape?: 'oval' | 'star';
|
|
43
|
+
}
|
|
44
|
+
export declare function JackpotsCarouselItem({ style, className, viewAllUrl, animate, customJackpotChestImage, chestImagesByTier, jackpotProfileShape, }: JackpotsCarouselItemProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Progress } from '@ark-ui/react/progress';
|
|
4
|
+
import { format } from 'date-fns';
|
|
5
|
+
import isMobile from 'is-mobile';
|
|
6
|
+
import Image, {} from 'next/image';
|
|
7
|
+
import Link from 'next/link';
|
|
8
|
+
import { useCallback, useEffect, useId, useMemo, useState, } from 'react';
|
|
9
|
+
import { twMerge } from 'tailwind-merge';
|
|
10
|
+
import { useIntersectionObserver } from 'usehooks-ts';
|
|
11
|
+
import { useJackpotPayoutsQuery } from '../../../client/hooks/useJackpotPayoutsQuery.js';
|
|
12
|
+
import { useLocaleInfo } from '../../../client/hooks/useLocaleInfo.js';
|
|
13
|
+
import { ArrowNarrowUpRightIcon } from '../../../icons/ArrowNarrowUpRightIcon.js';
|
|
14
|
+
import { ChevronLeftIcon } from '../../../icons/ChevronLeftIcon.js';
|
|
15
|
+
import { ChevronRightIcon } from '../../../icons/ChevronRightIcon.js';
|
|
16
|
+
import { StarIcon } from '../../../icons/StarIcon.js';
|
|
17
|
+
import { Trophy01Icon } from '../../../icons/Trophy01Icon.js';
|
|
18
|
+
import { User01Icon } from '../../../icons/User01Icon.js';
|
|
19
|
+
import closeChest from '../../../images/close-chest.png';
|
|
20
|
+
import firstPlace from '../../../images/first-place.png';
|
|
21
|
+
import leaderboard from '../../../images/leaderboard.png';
|
|
22
|
+
import openChest from '../../../images/open-chest.png';
|
|
23
|
+
import * as Tooltip from '../../../ui/Tooltip/Tooltip.js';
|
|
24
|
+
import { capitalize } from '../../../utils/capitalize.js';
|
|
25
|
+
import { formatNumber } from '../../../utils/formatNumber.js';
|
|
26
|
+
import { mask } from '../../../utils/mask.js';
|
|
27
|
+
import { parseDecimal } from '../../../utils/parseDecimal.js';
|
|
28
|
+
import styles from '../Jackpots.module.css';
|
|
29
|
+
import { useJackpotsCarouselItemContext } from './JackpotsCarouselContext.js';
|
|
30
|
+
export function JackpotsCarouselItem({ style, className, viewAllUrl, animate = true, customJackpotChestImage, chestImagesByTier, jackpotProfileShape = 'oval', }) {
|
|
31
|
+
const [ref, inView] = useIntersectionObserver({
|
|
32
|
+
threshold: 0.75,
|
|
33
|
+
});
|
|
34
|
+
const jackpot = useJackpotsCarouselItemContext();
|
|
35
|
+
const getTierFromName = (name) => {
|
|
36
|
+
const lowerName = name.toLowerCase();
|
|
37
|
+
if (lowerName.includes('grand'))
|
|
38
|
+
return 'grand';
|
|
39
|
+
if (lowerName.includes('major'))
|
|
40
|
+
return 'major';
|
|
41
|
+
if (lowerName.includes('minor'))
|
|
42
|
+
return 'minor';
|
|
43
|
+
return 'default';
|
|
44
|
+
};
|
|
45
|
+
const getChestImages = () => {
|
|
46
|
+
// Priority: chestImagesByTier > customJackpotChestImage > default
|
|
47
|
+
if (chestImagesByTier) {
|
|
48
|
+
const tier = getTierFromName(jackpot.name);
|
|
49
|
+
const tierImages = chestImagesByTier[tier] || chestImagesByTier.default;
|
|
50
|
+
if (tierImages) {
|
|
51
|
+
return {
|
|
52
|
+
open: tierImages.open,
|
|
53
|
+
closed: tierImages.closed,
|
|
54
|
+
style: chestImagesByTier.style,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (customJackpotChestImage?.image) {
|
|
59
|
+
return {
|
|
60
|
+
open: customJackpotChestImage.image.open,
|
|
61
|
+
closed: customJackpotChestImage.image.closed,
|
|
62
|
+
style: customJackpotChestImage.style,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
// Default fallback
|
|
66
|
+
return {
|
|
67
|
+
open: openChest,
|
|
68
|
+
closed: closeChest,
|
|
69
|
+
style: undefined,
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
const chestImages = getChestImages();
|
|
73
|
+
const jackpotPayoutsQuery = useJackpotPayoutsQuery({
|
|
74
|
+
first: 30,
|
|
75
|
+
filter: {
|
|
76
|
+
jackpot: {
|
|
77
|
+
equal: jackpot.id,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
}, {
|
|
81
|
+
enabled: typeof window !== 'undefined' && inView,
|
|
82
|
+
refetchInterval: 10_000,
|
|
83
|
+
});
|
|
84
|
+
const jackpotPayouts = jackpotPayoutsQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
|
|
85
|
+
const latestJackpotPayout = jackpotPayouts[0] ?? [];
|
|
86
|
+
const localeInfo = useLocaleInfo();
|
|
87
|
+
const isPayingOut = jackpot.drawing;
|
|
88
|
+
const jackpotAmount = jackpot.pool;
|
|
89
|
+
const Arrow = useCallback(({ index }) => {
|
|
90
|
+
const Icon = isPayingOut ? ChevronLeftIcon : ChevronRightIcon;
|
|
91
|
+
return (_jsx(Icon, { className: twMerge('min-w-2.5 scale-400 text-brand-300 lg:min-w-4 lg:scale-250', isPayingOut
|
|
92
|
+
? styles['animate-wave-color-error']
|
|
93
|
+
: styles['animate-wave-color-success']), style: {
|
|
94
|
+
animationDelay: isPayingOut
|
|
95
|
+
? `${(40 - index - 1) * 0.1}s`
|
|
96
|
+
: `${index * 0.1}s`,
|
|
97
|
+
} }));
|
|
98
|
+
}, [isPayingOut]);
|
|
99
|
+
const arrowImages = useMemo(() => Array.from({ length: 40 }, (_, i) => (_jsx(Arrow, { isFirst: i === 0, index: i }, i))), [Arrow]);
|
|
100
|
+
const [mainTooltipOpen, setMainTooltipOpen] = useState(false);
|
|
101
|
+
const [minLimitTooltipOpen, setMinLimitTooltipOpen] = useState(false);
|
|
102
|
+
const isMobileDevice = useMemo(() => isMobile(), []);
|
|
103
|
+
const mainTooltipId = useId();
|
|
104
|
+
const minLimitTooltipId = useId();
|
|
105
|
+
const handleMainTooltipClick = useCallback((e) => {
|
|
106
|
+
if (isMobileDevice) {
|
|
107
|
+
e.stopPropagation();
|
|
108
|
+
setMainTooltipOpen((prev) => !prev);
|
|
109
|
+
}
|
|
110
|
+
}, [isMobileDevice]);
|
|
111
|
+
const handleMinLimitTooltipClick = useCallback((e) => {
|
|
112
|
+
if (isMobileDevice) {
|
|
113
|
+
e.stopPropagation();
|
|
114
|
+
setMinLimitTooltipOpen((prev) => !prev);
|
|
115
|
+
}
|
|
116
|
+
}, [isMobileDevice]);
|
|
117
|
+
useEffect(() => {
|
|
118
|
+
if (isMobileDevice && mainTooltipOpen) {
|
|
119
|
+
const timeout = setTimeout(() => setMainTooltipOpen(false), 3000);
|
|
120
|
+
return () => clearTimeout(timeout);
|
|
121
|
+
}
|
|
122
|
+
}, [mainTooltipOpen, isMobileDevice]);
|
|
123
|
+
useEffect(() => {
|
|
124
|
+
if (isMobileDevice && minLimitTooltipOpen) {
|
|
125
|
+
const timeout = setTimeout(() => setMinLimitTooltipOpen(false), 3000);
|
|
126
|
+
return () => clearTimeout(timeout);
|
|
127
|
+
}
|
|
128
|
+
}, [minLimitTooltipOpen, isMobileDevice]);
|
|
129
|
+
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" })] }));
|
|
130
|
+
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"] }));
|
|
131
|
+
if (jackpot.status === 'DISABLED' && jackpot.drawing !== true) {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
return (_jsxs("div", { ref: ref, className: twMerge('relative flex w-full shrink-0 rounded-2xl border border-border-primary bg-bg-tertiary p-3 text-center lg:gap-4 lg:p-5', className?.itemRoot), style: style, children: [_jsxs("div", { className: "relative z-1 flex flex-1 flex-col", children: [_jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsxs("div", { className: "flex w-full flex-col", children: [_jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { children: [isPayingOut ? (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-success-200 bg-utility-success-50 px-2 py-0.5 font-medium text-utility-success-700 text-xs", children: [_jsx("span", { className: "full size-1.5 animate-pulse rounded bg-utility-success-500" }), "Paying Out"] })) : (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-blue-200 bg-utility-blue-50 px-2 py-0.5 font-medium text-utility-blue-700 text-xs", children: [_jsx(ArrowNarrowUpRightIcon, { className: "size-3.5 text-utility-blue-500" }), "Accumulating"] })), _jsx("div", { className: "mt-1 text-left font-medium text-lg text-text-primary-900 lg:mt-5 lg:text-2xl", children: jackpot.name }), _jsx("div", { className: twMerge('mt-1.5 w-fit rounded-md bg-bg-primary px-2 py-1 font-bold text-2xl text-brand-400 lg:mt-2 lg:text-4xl', className?.jackpotAmountRoot), children: formatNumber(jackpotAmount, {
|
|
135
|
+
currency: localeInfo.currency.code,
|
|
136
|
+
minDecimalPlaces: 2,
|
|
137
|
+
maxDecimalPlaces: 2,
|
|
138
|
+
}) })] }), _jsx("div", { className: "hidden min-w-25 lg:block" }), _jsx("div", { className: twMerge('right-0 bottom-[-60] z-1 min-w-25 lg:absolute', chestImages?.style?.wrapper), children: _jsx(Image, { width: 150, height: 150, src: isPayingOut ? chestImages.open : chestImages.closed, alt: "closeChest", 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: 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, {
|
|
139
|
+
totalCharsCount: 6,
|
|
140
|
+
}) }), _jsx("div", { className: twMerge('text-2xl text-brand-400', className?.latestPayoutAmount), children: formatNumber(latestJackpotPayout.amount, {
|
|
141
|
+
currency: localeInfo.currency.code,
|
|
142
|
+
minDecimalPlaces: 2,
|
|
143
|
+
maxDecimalPlaces: 2,
|
|
144
|
+
}) })] })] })) : (_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!" })] })] })) })] }) }) }), _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, {
|
|
145
|
+
currency: localeInfo.currency.code,
|
|
146
|
+
compact: true,
|
|
147
|
+
}) }), _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, {
|
|
148
|
+
currency: localeInfo.currency.code,
|
|
149
|
+
compact: true,
|
|
150
|
+
}) })] })] }), _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
|
|
151
|
+
? {
|
|
152
|
+
open: mainTooltipOpen,
|
|
153
|
+
onOpenChange: (details) => setMainTooltipOpen(details.open),
|
|
154
|
+
}
|
|
155
|
+
: {}), 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, {
|
|
156
|
+
currency: localeInfo.currency.code,
|
|
157
|
+
minDecimalPlaces: 2,
|
|
158
|
+
maxDecimalPlaces: 2,
|
|
159
|
+
})] }), _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: isMobile() ? minLimitTooltipOpen : undefined, onOpenChange: (details) => isMobile() && 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: {
|
|
160
|
+
width: `${getPercentage(jackpot.minimumJackpotPoolDrawingLimit, jackpot.pool)}%`,
|
|
161
|
+
}, 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, {
|
|
162
|
+
currency: localeInfo.currency.code,
|
|
163
|
+
minDecimalPlaces: 2,
|
|
164
|
+
maxDecimalPlaces: 2,
|
|
165
|
+
})] }), _jsx(Tooltip.Arrow, { children: _jsx(Tooltip.ArrowTip, {}) })] }) })] })] }) }) }), _jsx("div", { className: "mt-1 block text-start text-2xs lg:hidden", children: isPayingOut
|
|
166
|
+
? `The pot has hit ${formatNumber(jackpot?.maximumJackpotPoolLimit, {
|
|
167
|
+
currency: localeInfo.currency.code,
|
|
168
|
+
compact: true,
|
|
169
|
+
})} Play now for your chance to win big! 🔥`
|
|
170
|
+
: 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: [
|
|
171
|
+
'Player',
|
|
172
|
+
'Game Provider',
|
|
173
|
+
'Multiplier',
|
|
174
|
+
'Prize',
|
|
175
|
+
'Timestamp',
|
|
176
|
+
].map((header) => (_jsx("th", { className: "px-4", children: header }, header))) }) }), _jsx("tbody", { children: jackpotPayouts.length
|
|
177
|
+
? 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: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: mask(jp.member.name, {
|
|
178
|
+
totalCharsCount: 6,
|
|
179
|
+
}) }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: capitalize(jp.game?.provider ?? '-', {
|
|
180
|
+
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
181
|
+
}) }), _jsxs("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: [jp.multiplier, "x"] }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4 text-brand-400', className?.recentPayoutsTableBodyData), children: formatNumber(jp.amount, {
|
|
182
|
+
currency: localeInfo.currency.code,
|
|
183
|
+
minDecimalPlaces: 2,
|
|
184
|
+
maxDecimalPlaces: 2,
|
|
185
|
+
}) }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: format(new Date(jp.dateTimeCreated), 'dd MMM yyyy h:mm a') })] }, i)))
|
|
186
|
+
: 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))) })] }) }) })] }), isPayingOut && animate && (_jsx("div", { className: twMerge(styles['light-rays'], 'absolute top-safe-area-inset-top right-0 rounded-2xl [--light-rays-top:25%] lg:[--light-rays-top:9.375rem]') }))] }));
|
|
187
|
+
}
|
|
188
|
+
const getAccumulatingJackpotDescription = (part, total) => {
|
|
189
|
+
const percentage = total === 0 ? 0 : (part / total) * 100;
|
|
190
|
+
return percentage <= 90
|
|
191
|
+
? 'The jackpot is heating up! Keep playing to stay in the action and watch it grow!'
|
|
192
|
+
: '🔥 It’s about to pop! Stay in the game for your shot at the prize!';
|
|
193
|
+
};
|
|
194
|
+
function getPercentage(value, total) {
|
|
195
|
+
const v = parseDecimal(value, 0);
|
|
196
|
+
const t = parseDecimal(total, 0);
|
|
197
|
+
return t === 0 ? 0 : (v / t) * 100;
|
|
198
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type ImageProps } from 'next/image';
|
|
2
|
+
import { type CSSProperties } from 'react';
|
|
3
|
+
import type { ClassNameEntries } from './JackpotsCarousel';
|
|
4
|
+
export interface JackpotsCarouselItemProps {
|
|
5
|
+
style?: CSSProperties;
|
|
6
|
+
className?: ClassNameEntries;
|
|
7
|
+
/** @default "/jackpots" */
|
|
8
|
+
viewAllUrl?: string;
|
|
9
|
+
customJackpotChestImage?: {
|
|
10
|
+
image: {
|
|
11
|
+
open: string;
|
|
12
|
+
closed: string;
|
|
13
|
+
};
|
|
14
|
+
style?: {
|
|
15
|
+
wrapper?: string;
|
|
16
|
+
image?: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
customJackpotStageChest?: {
|
|
20
|
+
style?: {
|
|
21
|
+
wrapper?: string;
|
|
22
|
+
image?: string;
|
|
23
|
+
};
|
|
24
|
+
stage: {
|
|
25
|
+
one: ImageProps['src'];
|
|
26
|
+
two: ImageProps['src'];
|
|
27
|
+
three: ImageProps['src'];
|
|
28
|
+
four: ImageProps['src'];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
medalImage?: {
|
|
32
|
+
image: ImageProps['src'];
|
|
33
|
+
wrapper?: string;
|
|
34
|
+
};
|
|
35
|
+
animate?: boolean;
|
|
36
|
+
chestImagesByTier?: {
|
|
37
|
+
grand?: {
|
|
38
|
+
open: ImageProps['src'];
|
|
39
|
+
closed: ImageProps['src'];
|
|
40
|
+
};
|
|
41
|
+
major?: {
|
|
42
|
+
open: ImageProps['src'];
|
|
43
|
+
closed: ImageProps['src'];
|
|
44
|
+
};
|
|
45
|
+
minor?: {
|
|
46
|
+
open: ImageProps['src'];
|
|
47
|
+
closed: ImageProps['src'];
|
|
48
|
+
};
|
|
49
|
+
default?: {
|
|
50
|
+
open: ImageProps['src'];
|
|
51
|
+
closed: ImageProps['src'];
|
|
52
|
+
};
|
|
53
|
+
style?: {
|
|
54
|
+
wrapper?: string;
|
|
55
|
+
image?: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
jackpotProfileShape?: 'oval' | 'star';
|
|
59
|
+
}
|
|
60
|
+
export declare function JackpotsCarouselStageItem({ style, className, viewAllUrl, animate, customJackpotStageChest, jackpotProfileShape, }: JackpotsCarouselItemProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Progress } from '@ark-ui/react/progress';
|
|
4
|
+
import { format } from 'date-fns';
|
|
5
|
+
import isMobile from 'is-mobile';
|
|
6
|
+
import Image, {} from 'next/image';
|
|
7
|
+
import Link from 'next/link';
|
|
8
|
+
import { useCallback, useEffect, useMemo, useState, } from 'react';
|
|
9
|
+
import { twMerge } from 'tailwind-merge';
|
|
10
|
+
import { useIntersectionObserver } from 'usehooks-ts';
|
|
11
|
+
import { useJackpotPayoutsQuery } from '../../../client/hooks/useJackpotPayoutsQuery.js';
|
|
12
|
+
import { useLocaleInfo } from '../../../client/hooks/useLocaleInfo.js';
|
|
13
|
+
import { ArrowNarrowUpRightIcon } from '../../../icons/ArrowNarrowUpRightIcon.js';
|
|
14
|
+
import { CheckCircleBrokenIcon } from '../../../icons/CheckCircleBrokenIcon.js';
|
|
15
|
+
import { ChevronLeftIcon } from '../../../icons/ChevronLeftIcon.js';
|
|
16
|
+
import { ChevronRightIcon } from '../../../icons/ChevronRightIcon.js';
|
|
17
|
+
import { Flag05Icon } from '../../../icons/Flag05Icon.js';
|
|
18
|
+
import { StarIcon } from '../../../icons/StarIcon.js';
|
|
19
|
+
import { Target04Icon } from '../../../icons/Target04Icon.js';
|
|
20
|
+
import { Trophy01Icon } from '../../../icons/Trophy01Icon.js';
|
|
21
|
+
import { User01Icon } from '../../../icons/User01Icon.js';
|
|
22
|
+
import firstPlace from '../../../images/first-place.png';
|
|
23
|
+
import leaderboard from '../../../images/leaderboard.png';
|
|
24
|
+
import { formatNumber } from '../../../utils/formatNumber.js';
|
|
25
|
+
import { mask } from '../../../utils/mask.js';
|
|
26
|
+
import { parseDecimal } from '../../../utils/parseDecimal.js';
|
|
27
|
+
import styles from '../Jackpots.module.css';
|
|
28
|
+
import { useJackpotsCarouselItemContext } from './JackpotsCarouselContext.js';
|
|
29
|
+
export function JackpotsCarouselStageItem({ style, className, viewAllUrl, animate = true, customJackpotStageChest, jackpotProfileShape = 'oval', }) {
|
|
30
|
+
const [ref, inView] = useIntersectionObserver({
|
|
31
|
+
threshold: 0.75,
|
|
32
|
+
});
|
|
33
|
+
const jackpot = useJackpotsCarouselItemContext();
|
|
34
|
+
const getChestImages = (stage) => {
|
|
35
|
+
if (stage === 1) {
|
|
36
|
+
return {
|
|
37
|
+
image: customJackpotStageChest?.stage.one,
|
|
38
|
+
style: customJackpotStageChest?.style,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
if (stage === 2) {
|
|
42
|
+
return {
|
|
43
|
+
image: customJackpotStageChest?.stage.two,
|
|
44
|
+
style: customJackpotStageChest?.style,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
if (stage === 3) {
|
|
48
|
+
return {
|
|
49
|
+
image: customJackpotStageChest?.stage.three,
|
|
50
|
+
style: customJackpotStageChest?.style,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
image: customJackpotStageChest?.stage.four,
|
|
55
|
+
style: customJackpotStageChest?.style,
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
const chestImages = getChestImages(jackpot.stage ?? 1);
|
|
59
|
+
const jackpotPayoutsQuery = useJackpotPayoutsQuery({
|
|
60
|
+
first: 30,
|
|
61
|
+
filter: {
|
|
62
|
+
jackpot: {
|
|
63
|
+
equal: jackpot.id,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
}, {
|
|
67
|
+
enabled: typeof window !== 'undefined' && inView,
|
|
68
|
+
refetchInterval: 10_000,
|
|
69
|
+
});
|
|
70
|
+
const jackpotPayouts = jackpotPayoutsQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
|
|
71
|
+
const latestJackpotPayout = jackpotPayouts[0] ?? [];
|
|
72
|
+
const localeInfo = useLocaleInfo();
|
|
73
|
+
const isPayingOut = jackpot.drawing;
|
|
74
|
+
const jackpotAmount = jackpot.pool;
|
|
75
|
+
const totalTurnover = jackpot.totalTurnover;
|
|
76
|
+
const overallTurnover = parseDecimal(jackpot.totalTurnover, 0) /
|
|
77
|
+
(jackpot.stages?.reduce((acc, stage) => acc + parseFloat(stage.targetTurnover ?? '0'), 0) ?? 0);
|
|
78
|
+
const overallPercentage = getPercentage(totalTurnover, overallTurnover);
|
|
79
|
+
const Arrow = useCallback(({ index }) => {
|
|
80
|
+
const Icon = isPayingOut ? ChevronLeftIcon : ChevronRightIcon;
|
|
81
|
+
return (_jsx(Icon, { className: twMerge('min-w-2.5 scale-400 text-brand-300 lg:min-w-4 lg:scale-250', isPayingOut
|
|
82
|
+
? styles['animate-wave-color-error']
|
|
83
|
+
: styles['animate-wave-color-success']), style: {
|
|
84
|
+
animationDelay: isPayingOut
|
|
85
|
+
? `${(40 - index - 1) * 0.1}s`
|
|
86
|
+
: `${index * 0.1}s`,
|
|
87
|
+
} }));
|
|
88
|
+
}, [isPayingOut]);
|
|
89
|
+
const arrowImages = useMemo(() => Array.from({ length: 40 }, (_, i) => (_jsx(Arrow, { isFirst: i === 0, index: i }, i))), [Arrow]);
|
|
90
|
+
const [mainTooltipOpen, setMainTooltipOpen] = useState(false);
|
|
91
|
+
const [minLimitTooltipOpen, setMinLimitTooltipOpen] = useState(false);
|
|
92
|
+
const isMobileDevice = useMemo(() => isMobile(), []);
|
|
93
|
+
const target = parseFloat(jackpot.stages?.[jackpot.stage]?.targetTurnover ?? '0');
|
|
94
|
+
const total = parseFloat(jackpot.totalTurnover ?? '0');
|
|
95
|
+
const currStageProgressPercentage = getPercentage(total, target);
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
if (isMobileDevice && mainTooltipOpen) {
|
|
98
|
+
const timeout = setTimeout(() => setMainTooltipOpen(false), 3000);
|
|
99
|
+
return () => clearTimeout(timeout);
|
|
100
|
+
}
|
|
101
|
+
}, [mainTooltipOpen, isMobileDevice]);
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
if (isMobileDevice && minLimitTooltipOpen) {
|
|
104
|
+
const timeout = setTimeout(() => setMinLimitTooltipOpen(false), 3000);
|
|
105
|
+
return () => clearTimeout(timeout);
|
|
106
|
+
}
|
|
107
|
+
}, [minLimitTooltipOpen, isMobileDevice]);
|
|
108
|
+
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" })] }));
|
|
109
|
+
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"] }));
|
|
110
|
+
const OverallProgressBar = () => {
|
|
111
|
+
return (_jsxs("div", { className: "mt-3 lg:mt-4", children: [_jsxs("div", { className: "mb-[0.3125rem] 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 }) }) }) })] }));
|
|
112
|
+
};
|
|
113
|
+
if (jackpot.status === 'DISABLED' && jackpot.drawing !== true) {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
return (_jsxs("div", { ref: ref, className: twMerge('relative flex w-full shrink-0 rounded-2xl border border-border-primary bg-bg-tertiary p-3 text-center lg:gap-4 lg:p-5', className?.itemRoot, window.location.href.includes('blucky') &&
|
|
117
|
+
styles['animate-multi-stage-gradient-blucky']), 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: [_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, {
|
|
118
|
+
currency: localeInfo.currency.code,
|
|
119
|
+
minDecimalPlaces: 2,
|
|
120
|
+
maxDecimalPlaces: 2,
|
|
121
|
+
}) }), _jsxs("div", { className: twMerge('mt-[0.625rem] 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, {
|
|
122
|
+
currency: localeInfo.currency.code,
|
|
123
|
+
minDecimalPlaces: 2,
|
|
124
|
+
maxDecimalPlaces: 2,
|
|
125
|
+
})] })] })] }), _jsx("div", { className: "hidden min-w-25 lg:block" }), 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: 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, {
|
|
126
|
+
totalCharsCount: 6,
|
|
127
|
+
}) }), _jsx("div", { className: twMerge('text-2xl text-brand-400', className?.latestPayoutAmount), children: formatNumber(latestJackpotPayout.amount, {
|
|
128
|
+
currency: localeInfo.currency.code,
|
|
129
|
+
minDecimalPlaces: 2,
|
|
130
|
+
maxDecimalPlaces: 2,
|
|
131
|
+
}) })] })] })) : (_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!" })] })] })) })] }) }) }), _jsxs("div", { className: "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, "aria-valuenow": currStageProgressPercentage, "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: _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 }) }) }) })] })] }), _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: "Stages" })] }), _jsxs(Link, { className: "flex font-semibold text-button-tertiary-fg text-sm", href: viewAllUrl ?? '/jackpots', children: ["See details", _jsx(ChevronRightIcon, { className: "size-5" })] })] }), _jsx(OverallProgressBar, {}), _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: [
|
|
132
|
+
'Stage',
|
|
133
|
+
'Player',
|
|
134
|
+
'Turnover Target',
|
|
135
|
+
'Prize',
|
|
136
|
+
'Timestamp',
|
|
137
|
+
].map((header) => (_jsx("th", { className: "px-4", children: header }, header))) }) }), _jsx("tbody", { children: jackpot.stages
|
|
138
|
+
? 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
|
|
139
|
+
? mask(j.member.name, {
|
|
140
|
+
totalCharsCount: 6,
|
|
141
|
+
})
|
|
142
|
+
: '-' }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: formatNumber(j.targetTurnover, {
|
|
143
|
+
currency: localeInfo.currency.code,
|
|
144
|
+
minDecimalPlaces: 2,
|
|
145
|
+
maxDecimalPlaces: 2,
|
|
146
|
+
}) }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4 text-brand-400', className?.recentPayoutsTableBodyData), children: formatNumber(j.jackpotPayout, {
|
|
147
|
+
currency: localeInfo.currency.code,
|
|
148
|
+
minDecimalPlaces: 2,
|
|
149
|
+
maxDecimalPlaces: 2,
|
|
150
|
+
}) }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: j.dateTimeCompleted
|
|
151
|
+
? format(new Date(j.dateTimeCompleted), 'dd MMM yyyy h:mm a')
|
|
152
|
+
: '-' })] }, i)))
|
|
153
|
+
: 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))) })] }) }) })] }), isPayingOut && animate && (_jsx("div", { className: twMerge(styles['light-rays'], 'absolute top-safe-area-inset-top right-0 rounded-2xl [--light-rays-top:25%] lg:[--light-rays-top:9.375rem]') }))] }));
|
|
154
|
+
}
|
|
155
|
+
function getPercentage(value, total) {
|
|
156
|
+
const v = parseDecimal(value, 0);
|
|
157
|
+
const t = parseDecimal(total, 0);
|
|
158
|
+
return t === 0 ? 0 : (v / t) * 100;
|
|
159
|
+
}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { Progress } from '@ark-ui/react/progress';
|
|
3
3
|
import { format } from 'date-fns';
|
|
4
4
|
import Image, {} from 'next/image';
|
|
5
|
-
import {
|
|
5
|
+
import { useEffect, useState } from 'react';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
7
|
import { ArrowNarrowDownIcon } from '../../../icons/ArrowNarrowDownIcon.js';
|
|
8
8
|
import { ArrowNarrowUpIcon } from '../../../icons/ArrowNarrowUpIcon.js';
|
|
@@ -31,7 +31,7 @@ function getPercentage(value, total) {
|
|
|
31
31
|
}
|
|
32
32
|
export function JackpotMultiStageMobile({ animate = true, customJackpotChestImage, jackpotProfileShape = 'oval', customJackpotStageChest, chestImagesByTier, className, ...props }) {
|
|
33
33
|
const jackpot = useJackpotsListItemContext();
|
|
34
|
-
const { rootRef,
|
|
34
|
+
const { rootRef, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, } = useJackpotsListItemData();
|
|
35
35
|
const getChestImages = (stage) => {
|
|
36
36
|
if (stage === 1) {
|
|
37
37
|
return {
|
|
@@ -60,16 +60,6 @@ export function JackpotMultiStageMobile({ animate = true, customJackpotChestImag
|
|
|
60
60
|
const [isDetailsVisible, setIsDetailsVisible] = useState(false);
|
|
61
61
|
const [mainTooltipOpen, setMainTooltipOpen] = useState(false);
|
|
62
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
63
|
useEffect(() => {
|
|
74
64
|
if (mainTooltipOpen) {
|
|
75
65
|
const timeout = setTimeout(() => setMainTooltipOpen(false), 3000);
|
|
@@ -39,9 +39,9 @@ export function JackpotsListNext(props) {
|
|
|
39
39
|
: (props.className ?? {});
|
|
40
40
|
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) => {
|
|
41
41
|
if (jackpot?.stages?.length) {
|
|
42
|
-
return (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotMultiStageDesktop, { style: styles.itemRoot, className: classNames, animate:
|
|
42
|
+
return (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotMultiStageDesktop, { style: styles.itemRoot, className: classNames, animate: props.animate, customJackpotChestImage: props.customJackpotChestImage, jackpotProfileShape: props.jackpotProfileShape, customJackpotStageChest: props.customJackpotStageChest, medalImage: props.medalImage }) }, index));
|
|
43
43
|
}
|
|
44
|
-
return (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotsListItemDesktop, { style: styles.itemRoot, className: classNames, animate:
|
|
44
|
+
return (_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));
|
|
45
45
|
}) }), _jsx("div", { className: "flex flex-col gap-6 lg:hidden", children: jackpots.map((jackpot, index) => {
|
|
46
46
|
if (jackpot?.stages?.length) {
|
|
47
47
|
return (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotMultiStageMobile, { style: styles.itemRoot, className: classNames, animate: props.animate, customJackpotChestImage: props.customJackpotChestImage, jackpotProfileShape: props.jackpotProfileShape, chestImagesByTier: props.chestImagesByTier, customJackpotStageChest: props.customJackpotStageChest, medalImage: props.medalImage }) }, index));
|
|
@@ -20,8 +20,8 @@ export function KYCVerificationStatus() {
|
|
|
20
20
|
return (_jsx(Dialog.Root, { open: globalStore.kycVerificationStatus.open, onOpenChange: (details) => {
|
|
21
21
|
globalStore.kycVerificationStatus.setOpen(details.open);
|
|
22
22
|
}, closeOnEscape: false, closeOnInteractOutside: false, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)] flex items-center justify-center", children: _jsx(Dialog.Content, { className: "mx-auto h-fit w-[450px] overflow-y-auto rounded-lg bg-bg-primary", children: _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mb-3xl grid h-[200px] w-full place-items-center rounded-xl bg-radial from-40% from-button-primary-bg to-bg-brand-solid", children: _jsx(Image, { src: icons, alt: "icon", className: "w-60 object-contain", draggable: false }) }), _jsxs("h1", { className: "font-semibold text-lg text-white", children: [status === 'PENDING' && 'Verification in Progress', status === 'REJECTED' && 'Verification Rejected', status === 'UNVERIFIED' && 'Verification Required'] }), _jsxs("p", { className: "mb-4xl text-[#94969C] text-base", children: [status === 'PENDING' &&
|
|
23
|
-
`Your account verification is still under review. Please wait
|
|
24
|
-
until it's approved before you can continue playing or
|
|
23
|
+
`Your account verification is still under review. Please wait
|
|
24
|
+
until it's approved before you can continue playing or
|
|
25
25
|
depositing.`, status === 'REJECTED' &&
|
|
26
26
|
'Your account verification was not approved. Please resubmit your verification to regain full access.', status === 'UNVERIFIED' &&
|
|
27
27
|
'Your account is not yet verified. Please complete the verification process to continue playing or depositing.'] }), _jsxs(Button, { variant: "solid", className: twMerge('mb-2 w-full', status === 'PENDING' && 'hidden'), onClick: () => {
|
|
@@ -15,25 +15,19 @@ export function KYCVerificationStatus() {
|
|
|
15
15
|
kyc: ctx.kyc,
|
|
16
16
|
})));
|
|
17
17
|
const verificationQuery = useMemberVerificationQuery();
|
|
18
|
-
|
|
19
|
-
const status = verificationQuery?.data?.status ?? 'UNVERIFIED';
|
|
18
|
+
const status = verificationQuery.data?.status ?? 'UNVERIFIED';
|
|
20
19
|
const icons = status === 'PENDING' ? bellIcon : alertIcon;
|
|
21
20
|
return (_jsx(Dialog.Root, { open: globalStore.kycVerificationStatus.open, onOpenChange: (details) => {
|
|
22
21
|
globalStore.kycVerificationStatus.setOpen(details.open);
|
|
23
|
-
}, closeOnEscape: false, closeOnInteractOutside: false, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)] flex items-center justify-center", children: _jsx(Dialog.Content, { className: "mx-auto h-fit w-[450px] overflow-y-auto rounded-lg bg-bg-primary", children: _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mb-3xl grid h-[200px] w-full place-items-center rounded-xl bg-radial from-40% from-button-primary-bg to-bg-brand-solid", children: _jsx(Image, { src: icons, alt: "icon", className: "w-60 object-contain", draggable: false, width: 120, height: 120 }) }), _jsxs("h1", { className: "font-semibold text-lg text-white", children: [status === 'PENDING' && 'Verification in Progress', status === 'REJECTED' && 'Verification Rejected', status === 'UNVERIFIED'
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
`Your account verification is still under review. Please wait
|
|
27
|
-
until it's approved before you can continue playing or
|
|
22
|
+
}, closeOnEscape: false, closeOnInteractOutside: false, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)] flex items-center justify-center", children: _jsx(Dialog.Content, { className: "mx-auto h-fit w-[450px] overflow-y-auto rounded-lg bg-bg-primary", children: _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mb-3xl grid h-[200px] w-full place-items-center rounded-xl bg-radial from-40% from-button-primary-bg to-bg-brand-solid", children: _jsx(Image, { src: icons, alt: "icon", className: "w-60 object-contain", draggable: false, width: 120, height: 120 }) }), _jsxs("h1", { className: "font-semibold text-lg text-white", children: [status === 'PENDING' && 'Verification in Progress', status === 'REJECTED' && 'Verification Rejected', status === 'UNVERIFIED' && 'Verification Required'] }), _jsxs("p", { className: "mb-4xl text-[#94969C] text-base", children: [status === 'PENDING' &&
|
|
23
|
+
`Your account verification is still under review. Please wait
|
|
24
|
+
until it's approved before you can continue playing or
|
|
28
25
|
depositing.`, status === 'REJECTED' &&
|
|
29
|
-
'Your account verification was not approved. Please resubmit your verification to regain full access.', status === 'UNVERIFIED'
|
|
30
|
-
status === '
|
|
31
|
-
(verificationQuery?.data === null &&
|
|
32
|
-
'Your account is not yet verified. Please complete the verification process to continue playing or depositing.')] }), _jsxs(Button, { variant: "solid", className: twMerge('mb-2 w-full', status === 'PENDING' && 'hidden'), onClick: () => {
|
|
26
|
+
'Your account verification was not approved. Please resubmit your verification to regain full access.', status === 'UNVERIFIED' &&
|
|
27
|
+
'Your account is not yet verified. Please complete the verification process to continue playing or depositing.'] }), _jsxs(Button, { variant: "solid", className: twMerge('mb-2 w-full', status === 'PENDING' && 'hidden'), onClick: () => {
|
|
33
28
|
globalStore.kycVerificationStatus.setOpen(false);
|
|
34
29
|
globalStore.kyc.setOpen(true);
|
|
35
|
-
}, children: [status === 'REJECTED' && 'Resubmit Verification', status === 'UNVERIFIED'
|
|
36
|
-
(status === 'CREATED' && 'Verify Now')] }), _jsx(Button, { type: "button", variant: "outline", onClick: () => {
|
|
30
|
+
}, children: [status === 'REJECTED' && 'Resubmit Verification', status === 'UNVERIFIED' && 'Verify Now'] }), _jsx(Button, { type: "button", variant: "outline", onClick: () => {
|
|
37
31
|
globalStore.kycVerificationStatus.setOpen(false);
|
|
38
32
|
}, children: "Close" })] }) }) })] }) }));
|
|
39
33
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AndroidOnlyComponents(): import("react/jsx-runtime").JSX.Element | null;
|