@opexa/portal-components 0.0.33 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/hooks/useMemberVerificationQuery.js +0 -1
- package/dist/client/hooks/useMessagesQuery.js +0 -1
- package/dist/client/hooks/useTransactionRecordsQuery.js +0 -1
- package/dist/client/hooks/useWithdrawalRecordsQuery.js +0 -1
- package/dist/components/Account/Account.js +1 -1
- package/dist/components/AccountInfo/AccountInfo.js +1 -1
- package/dist/components/AccountSecurity/AccountSecurity.js +2 -2
- package/dist/components/AccountVerification/AccountVerification.d.ts +4 -1
- package/dist/components/AccountVerification/AccountVerification.js +36 -2
- package/dist/components/AccountVerification/VerificationCapture.d.ts +1 -0
- package/dist/components/AccountVerification/VerificationCapture.js +57 -0
- package/dist/components/AccountVerification/selfie.png +0 -0
- package/dist/components/AccountVerification/upload-id.png +0 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositVCA.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositQrCode.js +1 -1
- package/dist/components/DepositWithdrawal/PaymentMethods.js +5 -5
- package/dist/components/Disclaimer/Disclaimer.js +2 -2
- package/dist/components/GamesSearch/GamesSearch.js +1 -1
- package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +0 -1
- package/dist/components/JackpotCounter/JackpotCounterItem.js +11 -22
- package/dist/components/Jackpots/JackpotItemDesktop.js +12 -11
- package/dist/components/Jackpots/JackpotItemMobile.js +11 -10
- package/dist/components/Jackpots/Jackpots.js +4 -2
- package/dist/components/Jackpots/useJackpotItemData.d.ts +0 -1
- package/dist/components/Jackpots/useJackpotItemData.js +0 -7
- package/dist/components/TournamentCounter/TournamentCounter.client.js +5 -12
- package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +3 -4
- package/dist/components/TournamentCounter/TournamentCounterItem.js +24 -13
- package/dist/components/Tournaments/TournamentGameProviders.d.ts +5 -1
- package/dist/components/Tournaments/TournamentGameProviders.js +3 -4
- package/dist/components/Tournaments/TournamentItemDesktop.d.ts +7 -0
- package/dist/components/Tournaments/TournamentItemDesktop.js +57 -0
- package/dist/components/Tournaments/TournamentItemMobile.d.ts +6 -6
- package/dist/components/Tournaments/TournamentItemMobile.js +21 -61
- package/dist/components/Tournaments/Tournaments.d.ts +3 -1
- package/dist/components/Tournaments/Tournaments.js +8 -15
- package/dist/components/Tournaments/useTournamentItemData.d.ts +16 -0
- package/dist/components/Tournaments/useTournamentItemData.js +64 -0
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.js +0 -1
- package/dist/icons/CreditCardCheckIcon.d.ts +2 -0
- package/dist/icons/CreditCardCheckIcon.js +4 -0
- package/dist/icons/FaceIdIcon.d.ts +2 -0
- package/dist/icons/FaceIdIcon.js +4 -0
- package/dist/icons/FileSearch02Icon.d.ts +2 -0
- package/dist/icons/FileSearch02Icon.js +4 -0
- package/dist/icons/FileX02Icon.d.ts +2 -0
- package/dist/icons/FileX02Icon.js +4 -0
- package/dist/icons/Globe05Icon.d.ts +2 -0
- package/dist/icons/Globe05Icon.js +4 -0
- package/dist/icons/index.d.ts +5 -0
- package/dist/icons/index.js +5 -0
- package/dist/next.config.d.ts +3 -0
- package/dist/next.config.js +51 -0
- package/dist/styles/theme.css +5 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/ui/Progress/progress.recipe.js +1 -1
- package/dist/utils/getPercentage.d.ts +1 -0
- package/dist/utils/getPercentage.js +5 -0
- package/dist/utils/maskDisplayName.d.ts +1 -0
- package/dist/utils/maskDisplayName.js +8 -0
- package/package.json +150 -150
- package/dist/components/KYC/KYC.d.ts +0 -5
- package/dist/components/KYC/KYC.js +0 -19
- package/dist/components/KYC/KYCContext.d.ts +0 -3
- package/dist/components/KYC/KYCContext.js +0 -8
- package/dist/components/KYC/KYCTrigger.d.ts +0 -5
- package/dist/components/KYC/KYCTrigger.js +0 -14
- package/dist/components/KYC/Step1.d.ts +0 -1
- package/dist/components/KYC/Step1.js +0 -10
- package/dist/components/KYC/Step2.d.ts +0 -1
- package/dist/components/KYC/Step2.js +0 -15
- package/dist/components/KYC/Step3.d.ts +0 -1
- package/dist/components/KYC/Step3.js +0 -11
- package/dist/components/KYC/StepIndicator.d.ts +0 -1
- package/dist/components/KYC/StepIndicator.js +0 -13
- package/dist/components/KYC/UploadDocument.d.ts +0 -1
- package/dist/components/KYC/UploadDocument.js +0 -8
- package/dist/components/KYC/UploadSelfie.d.ts +0 -1
- package/dist/components/KYC/UploadSelfie.js +0 -8
- package/dist/components/KYC/index.d.ts +0 -2
- package/dist/components/KYC/index.js +0 -2
- package/dist/components/KYC/useKYC.d.ts +0 -14
- package/dist/components/KYC/useKYC.js +0 -32
- package/dist/components/KYC/utils.d.ts +0 -0
- package/dist/components/KYC/utils.js +0 -1
- package/dist/components/Tournaments/TournamentItem.d.ts +0 -5
- package/dist/components/Tournaments/TournamentItem.js +0 -97
- package/dist/config.d.ts +0 -272
- package/dist/config.js +0 -39
|
@@ -18,7 +18,6 @@ export const useMemberVerificationQuery = (config) => {
|
|
|
18
18
|
queryFn: () => getSession(),
|
|
19
19
|
});
|
|
20
20
|
invariant(session.status === 'authenticated');
|
|
21
|
-
invariant(session.status === 'authenticated');
|
|
22
21
|
return await getMemberVerification({
|
|
23
22
|
signal,
|
|
24
23
|
environment: ENVIRONMENT,
|
|
@@ -20,7 +20,6 @@ export const useMessagesQuery = (input, config) => {
|
|
|
20
20
|
queryFn: () => getSession(),
|
|
21
21
|
});
|
|
22
22
|
invariant(session.status === 'authenticated');
|
|
23
|
-
invariant(session.status === 'authenticated');
|
|
24
23
|
return getMessages({ ...input, after: pageParam }, {
|
|
25
24
|
signal,
|
|
26
25
|
environment: ENVIRONMENT,
|
|
@@ -20,7 +20,6 @@ export const useTransactionRecordsQuery = (input, config) => {
|
|
|
20
20
|
queryFn: () => getSession(),
|
|
21
21
|
});
|
|
22
22
|
invariant(session.status === 'authenticated');
|
|
23
|
-
invariant(session.status === 'authenticated');
|
|
24
23
|
return getTransactionRecords({ ...input, after: pageParam }, {
|
|
25
24
|
signal,
|
|
26
25
|
environment: ENVIRONMENT,
|
|
@@ -20,7 +20,6 @@ export const useWithdrawalRecordsQuery = (input, config) => {
|
|
|
20
20
|
queryFn: () => getSession(),
|
|
21
21
|
});
|
|
22
22
|
invariant(session.status === 'authenticated');
|
|
23
|
-
invariant(session.status === 'authenticated');
|
|
24
23
|
return await getWithdrawalRecords({ ...input, after: pageParam }, {
|
|
25
24
|
signal,
|
|
26
25
|
environment: ENVIRONMENT,
|
|
@@ -6,7 +6,7 @@ import Link from 'next/link';
|
|
|
6
6
|
import { useShallow } from 'zustand/shallow';
|
|
7
7
|
import { useAccountQuery, useGlobalStore, useLocaleInfo, useSignOutMutation, useUnreadMessagesCountQuery, useWalletQuery, } from '../../client/hooks/index.js';
|
|
8
8
|
import { AlertCircleIcon, ChevronLeftIcon, ChevronRightIcon, CoinsStacked02Icon, CoinsSwap02Icon, CreditCard02Icon, FileCheck02Icon, Gift01Icon, Lock01Icon, Logout01Icon, Settings02Icon, User01Icon, XIcon, } from '../../icons/index.js';
|
|
9
|
-
import avatarPlaceholder from '
|
|
9
|
+
import avatarPlaceholder from '~/images/placeholder-avatar.png';
|
|
10
10
|
import { Badge, Button, Drawer, IconButton, Popover, Presence } from '../../ui/index.js';
|
|
11
11
|
import { formatNumber, parseDecimal } from '../../utils/index.js';
|
|
12
12
|
import { accountRecipe } from './account.recipe.js';
|
|
@@ -5,7 +5,7 @@ import { noop } from 'lodash-es';
|
|
|
5
5
|
import Image from 'next/image';
|
|
6
6
|
import { useAccountQuery, useLocaleInfo, useMobileNumberParser, } from '../../client/hooks/index.js';
|
|
7
7
|
import { FacebookIcon, GoogleIcon } from '../../icons/index.js';
|
|
8
|
-
import avatar from '
|
|
8
|
+
import avatar from '~/images/placeholder-avatar.png';
|
|
9
9
|
import { Button, Field, IconButton } from '../../ui/index.js';
|
|
10
10
|
export function AccountInfo(props) {
|
|
11
11
|
const localeInfo = useLocaleInfo();
|
|
@@ -8,11 +8,11 @@ import { Field, PasswordInput, Select } from '../../ui/index.js';
|
|
|
8
8
|
export function AccountSecurity(props) {
|
|
9
9
|
const profileCompletionQuery = useProfileCompletionQuery();
|
|
10
10
|
const profileCompletion = profileCompletionQuery.data;
|
|
11
|
-
return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-
|
|
11
|
+
return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Log in password" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "Access your account by logging in with your name and password." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountPassword
|
|
12
12
|
? 'text-text-success-primary'
|
|
13
13
|
: 'text-text-warning-primary'), children: profileCompletion?.accountPassword ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("div", { className: "shadow-xs bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border px-4 py-5", children: [_jsx(Field.Root, { children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, {}), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }) }), _jsx(Field.Root, { className: "mt-6", children: _jsxs(Select.Root, { collection: secretQuestionCollection, lazyMount: true, positioning: {
|
|
14
14
|
sameWidth: true,
|
|
15
|
-
}, children: [_jsx(Select.Label, { children: "Security Question" }), _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, { placeholder: "Game Vendor" }), _jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: secretQuestionCollection.items.map((provider) => (_jsxs(Select.Item, { item: provider, children: [_jsx(Select.ItemText, { children: secretQuestionCollection.stringifyItem(provider) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, provider))) }) }) }) })] }) }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Answer" }), _jsx(Field.Input, {})] })] }), _jsxs("div", { className: "mt-6 flex items-
|
|
15
|
+
}, children: [_jsx(Select.Label, { children: "Security Question" }), _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, { placeholder: "Game Vendor" }), _jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: secretQuestionCollection.items.map((provider) => (_jsxs(Select.Item, { item: provider, children: [_jsx(Select.ItemText, { children: secretQuestionCollection.stringifyItem(provider) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, provider))) }) }) }) })] }) }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Answer" }), _jsx(Field.Input, {})] })] }), _jsxs("div", { className: "mt-6 flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Transaction password" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "The transaction password secures and confirms your wallet withdrawals." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountPassword
|
|
16
16
|
? 'text-text-success-primary'
|
|
17
17
|
: 'text-text-warning-primary'), children: profileCompletion?.accountPassword ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsx("div", { className: "shadow-xs bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border px-4 py-5", children: _jsx(Field.Root, { children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, {}), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }) }) })] }));
|
|
18
18
|
}
|
|
@@ -1,3 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ark } from '@ark-ui/react';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { useMemberVerificationQuery, useProfileCompletionQuery, } from '../../client/hooks/index.js';
|
|
6
|
+
import { AlertCircleIcon, CheckVerified02Icon, CreditCard02Icon, FaceIdIcon, FileCheck02Icon, FileSearch02Icon, FileX02Icon, Globe05Icon, } from '../../icons/index.js';
|
|
7
|
+
import { Button } from '../../ui/index.js';
|
|
8
|
+
import { VerificationCapture } from './VerificationCapture.js';
|
|
9
|
+
export function AccountVerification(props) {
|
|
10
|
+
const profileCompletionQuery = useProfileCompletionQuery();
|
|
11
|
+
const profileCompletion = profileCompletionQuery.data;
|
|
12
|
+
const verificationQuery = useMemberVerificationQuery();
|
|
13
|
+
const verification = verificationQuery.data;
|
|
14
|
+
const empty = verification == null;
|
|
15
|
+
const pending = verification?.status === 'PENDING';
|
|
16
|
+
const success = verification?.status === 'VERIFIED' || verification?.status === 'APPROVED';
|
|
17
|
+
const failed = verification?.status === 'REJECTED' ||
|
|
18
|
+
verification?.status === 'UNVERIFIED';
|
|
19
|
+
if (1) {
|
|
20
|
+
return (_jsx("div", { className: props.className, children: _jsx(VerificationCapture, {}) }));
|
|
21
|
+
}
|
|
22
|
+
return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Verify your identity" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "Complete personal verification to unlock all features and enhance account security." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountVerification
|
|
23
|
+
? 'text-text-success-primary'
|
|
24
|
+
: 'text-text-warning-primary'), children: profileCompletion?.accountVerification ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("div", { className: "shadow-xs border-border-secondary bg-bg-primary-alt mt-5 rounded-xl border", children: [_jsx("div", { className: "px-4 py-5", children: _jsxs("ul", { className: "space-y-lg", children: [_jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FileCheck02Icon, {}), "Basic Information"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(Globe05Icon, {}), "Proof of address"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(CreditCard02Icon, {}), "Government ID"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FaceIdIcon, {}), "Facial Verification"] })] }) }), _jsx("div", { className: "border-border-secondary border-t px-4 py-3", children: _jsx(Button, { size: "sm", children: "Verify Now" }) })] }), success && _jsx(VerificationSuccess, {}), pending && _jsx(VerificationInProgress, {}), failed && _jsx(VerificationFailed, {}), empty && _jsx(VerificationNotSubmitted, {})] }));
|
|
25
|
+
}
|
|
26
|
+
function VerificationNotSubmitted() {
|
|
27
|
+
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-warning-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-warning-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(AlertCircleIcon, { className: "text-text-warning-primary size-5" }) }) }), _jsx("p", { className: "text-text-tertiary-600 mt-2 text-sm", children: "To serve you better and unlock all features, please provide valid identification documents. This helps protect your account and makes recovery easier if ever needed." })] }));
|
|
28
|
+
}
|
|
29
|
+
function VerificationInProgress() {
|
|
30
|
+
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-warning-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-warning-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileSearch02Icon, { className: "text-text-warning-primary size-5" }) }) }), _jsx("h2", { className: "text-text-secondary-700 mt-2 text-sm font-semibold", children: "Under review" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "To serve you better and unlock all features, please provide valid identification documents. This helps protect your account and makes recovery easier if ever needed." })] }));
|
|
31
|
+
}
|
|
32
|
+
function VerificationSuccess() {
|
|
33
|
+
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-success-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-success-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileCheck02Icon, { className: "text-text-success-primary size-5" }) }) }), _jsx("h2", { className: "text-text-secondary-700 mt-2 text-sm font-semibold", children: "Verification successful" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "Your account has been successfully verified. You now have full access to all features and improved account security." })] }));
|
|
34
|
+
}
|
|
35
|
+
function VerificationFailed() {
|
|
36
|
+
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-error-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-error-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileX02Icon, { className: "text-text-error-primary size-5" }) }) }), _jsx("h2", { className: "text-text-secondary-700 mt-2 text-sm font-semibold", children: "Verification failed" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "There was an issue with the verification process. Please try again or contact support for assistance." })] }));
|
|
3
37
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function VerificationCapture(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Portal } from '@ark-ui/react';
|
|
3
|
+
import { clamp, noop } from 'lodash-es';
|
|
4
|
+
import Image from 'next/image';
|
|
5
|
+
import { createContext, useContext, useState } from 'react';
|
|
6
|
+
import invariant from 'tiny-invariant';
|
|
7
|
+
import { toaster } from '../../client/utils/index.js';
|
|
8
|
+
import { ArrowLeftIcon, CheckCircleIcon, CheckIcon, XIcon } from '../../icons/index.js';
|
|
9
|
+
import { AlertDialog, Button, Checkbox, Field, Progress } from '../../ui/index.js';
|
|
10
|
+
import selfie from './selfie.png';
|
|
11
|
+
import uploadId from './upload-id.png';
|
|
12
|
+
function useVerificationCapture() {
|
|
13
|
+
const [step, setStep_] = useState(4);
|
|
14
|
+
function setStep(step) {
|
|
15
|
+
setStep_(step);
|
|
16
|
+
if (step === 4) {
|
|
17
|
+
toaster.success({
|
|
18
|
+
title: 'Submission Successful',
|
|
19
|
+
description: 'Your documents have been submitted successfully. They’re now under review, and you’ll receive a notification as soon as your account is verified.',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
step,
|
|
25
|
+
setStep,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const VerificationCaptureContext = createContext(null);
|
|
29
|
+
function useVerificationCaptureContext() {
|
|
30
|
+
const context = useContext(VerificationCaptureContext);
|
|
31
|
+
invariant(context);
|
|
32
|
+
return context;
|
|
33
|
+
}
|
|
34
|
+
export function VerificationCapture() {
|
|
35
|
+
const context = useVerificationCapture();
|
|
36
|
+
return (_jsx(VerificationCaptureContext, { value: context, children: _jsxs("div", { children: [_jsxs("div", { className: "grid grid-cols-4 items-center", children: [_jsxs("button", { className: "text-text-tertiary-600 flex gap-sm text-sm font-semibold", disabled: context.step <= 1, onClick: () => context.setStep(clamp(context.step - 1, 1, 4)), children: [_jsx(ArrowLeftIcon, { className: "size-5" }), "Back"] }), _jsxs("div", { className: "col-span-2 flex justify-center gap-2", children: [_jsx(Progress.Root, { value: context.step >= 2 ? 100 : context.step >= 1 ? 50 : 0, onValueChange: noop, className: "w-22.5 shrink-0", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) }), _jsx(Progress.Root, { value: context.step >= 4 ? 100 : context.step >= 3 ? 50 : 0, onValueChange: noop, className: "w-22.5 shrink-0", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) })] })] }), context.step === 1 && _jsx(Step1, {}), context.step === 2 && _jsx(Step2, {}), (context.step === 3 || context.step === 4) && _jsx(Step3, {}), _jsx(Congrats, {})] }) }));
|
|
37
|
+
}
|
|
38
|
+
function Step1() {
|
|
39
|
+
const context = useVerificationCaptureContext();
|
|
40
|
+
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Prepare to upload your ID" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsx(Image, { src: uploadId, alt: "", className: "h-auto w-full" }), _jsxs("ul", { className: "mt-2xl space-y-3", children: [_jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Upload front side of your ID"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Take a photo in a well lit room"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(XIcon, { className: "text-text-featured-icon-light-error size-6" }), "Don't edit image of your ID"] })] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => context.setStep(2), children: "Continue" }) })] })] }));
|
|
41
|
+
}
|
|
42
|
+
function Step2() {
|
|
43
|
+
const context = useVerificationCaptureContext();
|
|
44
|
+
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Take a selfie holding your ID" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsx(Image, { src: selfie, alt: "", className: "h-auto w-full" }), _jsxs("ul", { className: "mt-2xl space-y-3", children: [_jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Face and ID must be clearly visible"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Take a photo in a well lit room"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(XIcon, { className: "text-text-featured-icon-light-error size-6" }), "No hats, sunglasses, or masks"] })] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => context.setStep(3), children: "Continue" }) })] })] }));
|
|
45
|
+
}
|
|
46
|
+
function Step3() {
|
|
47
|
+
const context = useVerificationCaptureContext();
|
|
48
|
+
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Enter your basic and work-related information" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsxs(Field.Root, { children: [_jsx(Field.Label, { children: "Permanent address" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Current address" }), _jsx(Field.Input, {})] }), _jsxs(Checkbox.Root, { className: "mt-sm", children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.Label, { children: "Same as permanent address" }), _jsx(Checkbox.HiddenInput, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Source of income" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Nature of work" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Place of birth" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Nationality" }), _jsx(Field.Input, {})] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => context.setStep(4), children: "Continue" }) })] })] }));
|
|
49
|
+
}
|
|
50
|
+
function Congrats() {
|
|
51
|
+
const context = useVerificationCaptureContext();
|
|
52
|
+
return (_jsx(AlertDialog.Root, { open: context.step === 4, onOpenChange: (details) => {
|
|
53
|
+
if (!details.open) {
|
|
54
|
+
context.setStep(1);
|
|
55
|
+
}
|
|
56
|
+
}, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "bg-bg-overlay/75 backdrop-blur-sm" }), _jsx(AlertDialog.Positioner, { children: _jsxs(AlertDialog.Content, { className: "mx-auto w-[21.438rem] p-xl", children: [_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success mx-auto flex size-12 items-center justify-center rounded-full", children: _jsx(CheckCircleIcon, {}) }), _jsx(AlertDialog.Title, { className: "mt-3 text-center", children: "Submission Successful" }), _jsx(AlertDialog.Description, { className: "text-text-tertiary-600 text-center", children: "Your documents have been submitted successfully. They\u2019re now under review, and you\u2019ll receive a notification as soon as your account is verified." }), _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { className: "mt-3xl", onClick: () => api.setOpen(false), children: "Ok" })) })] }) })] }) }));
|
|
57
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Portal } from '@ark-ui/react';
|
|
3
3
|
import Image from 'next/image';
|
|
4
4
|
import { BankIcon, XIcon } from '../../../../icons/index.js';
|
|
5
|
-
import bankIcon from '
|
|
5
|
+
import bankIcon from '~/images/bank-icon.png';
|
|
6
6
|
import { Button, Clipboard, Dialog } from '../../../../ui/index.js';
|
|
7
7
|
import { useOnlineBankDepositContext } from './OnlineBankDepositContext.js';
|
|
8
8
|
export function OnlineBankDepositVCA() {
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Portal, QrCode } from '@ark-ui/react';
|
|
3
3
|
import Image from 'next/image';
|
|
4
4
|
import { QrCode02Icon, SpinnerIcon, XIcon } from '../../../../icons/index.js';
|
|
5
|
-
import qrphIcon from '
|
|
5
|
+
import qrphIcon from '~/images/qrph-icon.png';
|
|
6
6
|
import { Button, Dialog } from '../../../../ui/index.js';
|
|
7
7
|
import { useQRPHDepositContext } from './QRPHDepositContext.js';
|
|
8
8
|
export function QRPHDepositQrCode() {
|
|
@@ -2,11 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import Image from 'next/image';
|
|
3
3
|
import { useControllableState } from '../../client/hooks/index.js';
|
|
4
4
|
import { CheckIcon } from '../../icons/index.js';
|
|
5
|
-
import qrph from '
|
|
6
|
-
import gcash from '
|
|
7
|
-
import instapay from '
|
|
8
|
-
import maya from '
|
|
9
|
-
import onlineBank from '
|
|
5
|
+
import qrph from '~/images/QRPh.png';
|
|
6
|
+
import gcash from '~/images/gcash.png';
|
|
7
|
+
import instapay from '~/images/instapay.png';
|
|
8
|
+
import maya from '~/images/maya.png';
|
|
9
|
+
import onlineBank from '~/images/online-bank.png';
|
|
10
10
|
import { Checkbox, Field } from '../../ui/index.js';
|
|
11
11
|
import { PaymentMethodDefinition } from './utils.js';
|
|
12
12
|
const OPTIONS = [
|
|
@@ -3,8 +3,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { Portal } from '@ark-ui/react';
|
|
4
4
|
import Image from 'next/image';
|
|
5
5
|
import { useRef } from 'react';
|
|
6
|
-
import pagcorLogo from '
|
|
7
|
-
import responsibleGamingLogo from '
|
|
6
|
+
import pagcorLogo from '~/images/pagcor.png';
|
|
7
|
+
import responsibleGamingLogo from '~/images/responsible-gaming.png';
|
|
8
8
|
import { Button, Dialog } from '../../ui/index.js';
|
|
9
9
|
import { useDisclaimer } from './useDisclaimer.js';
|
|
10
10
|
export function Disclaimer(props) {
|
|
@@ -6,7 +6,7 @@ import { useRef, useState } from 'react';
|
|
|
6
6
|
import { useShallow } from 'zustand/shallow';
|
|
7
7
|
import { useGamesQuery, useGlobalStore } from '../../client/hooks/index.js';
|
|
8
8
|
import { SearchLgIcon, XIcon } from '../../icons/index.js';
|
|
9
|
-
import providerHacksaw from '
|
|
9
|
+
import providerHacksaw from '~/images/hacksaw-gaming.png';
|
|
10
10
|
import { Button, Dialog, Field, IconButton, Presence } from '../../ui/index.js';
|
|
11
11
|
import { GameLaunchTrigger } from '../GameLaunch/index.js';
|
|
12
12
|
export function GamesSearch(props) {
|
|
@@ -6,4 +6,3 @@ export interface JackpotCounterCardProps {
|
|
|
6
6
|
viewAllUrl?: string;
|
|
7
7
|
}
|
|
8
8
|
export declare function JackpotCounterItem({ jackpot, className, viewAllUrl, }: JackpotCounterCardProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare function maskName(name: string): string;
|
|
@@ -7,13 +7,15 @@ import { useCallback, useMemo } from 'react';
|
|
|
7
7
|
import { twMerge } from 'tailwind-merge';
|
|
8
8
|
import { useLocaleInfo } from '../../client/hooks/index.js';
|
|
9
9
|
import { useJackpotPayoutsQuery } from '../../client/hooks/useJackpotPayoutsQuery.js';
|
|
10
|
-
import { ArrowNarrowUpRightIcon, ChevronLeftIcon, ChevronRightIcon, Trophy01Icon, } from '../../icons/index.js';
|
|
10
|
+
import { ArrowNarrowUpRightIcon, ChevronLeftIcon, ChevronRightIcon, Trophy01Icon, User01Icon, } from '../../icons/index.js';
|
|
11
11
|
import { StarIcon } from '../../icons/StarIcon.js';
|
|
12
|
-
import closeChest from '
|
|
13
|
-
import firstPlace from '
|
|
14
|
-
import leaderboard from '
|
|
15
|
-
import openChest from '
|
|
12
|
+
import closeChest from '~/images/close-chest.png';
|
|
13
|
+
import firstPlace from '~/images/first-place.png';
|
|
14
|
+
import leaderboard from '~/images/leaderboard.png';
|
|
15
|
+
import openChest from '~/images/open-chest.png';
|
|
16
16
|
import { formatNumber } from '../../utils/index.js';
|
|
17
|
+
import { getPercentage } from '../../utils/getPercentage.js';
|
|
18
|
+
import { maskDisplayName } from '../../utils/maskDisplayName.js';
|
|
17
19
|
import styles from './JackpotCounterItem.module.css';
|
|
18
20
|
export function JackpotCounterItem({ jackpot, className, viewAllUrl, }) {
|
|
19
21
|
const jackpotPayoutsQuery = useJackpotPayoutsQuery({
|
|
@@ -50,40 +52,27 @@ export function JackpotCounterItem({ jackpot, className, viewAllUrl, }) {
|
|
|
50
52
|
currency: localeInfo.currency.code,
|
|
51
53
|
minDecimalPlaces: 2,
|
|
52
54
|
maxDecimalPlaces: 2,
|
|
53
|
-
}) })] }), _jsx("div", { className: "z-1 bottom-[-60] right-0 lg:absolute", children: _jsx(Image, { width: 150, height: 150, src: isPayingOut ? openChest : closeChest, alt: "closeChest", quality: 100, className: "h-25 w-25 lg:h-37.5 lg:w-37.5 size-full p-2" }) })] }), topJackpotPayout.amount ? (_jsx("div", { children: _jsxs("div", { className: "bg-bg-primary relative mt-4 hidden w-full gap-4 rounded-lg p-4 lg:flex", children: [
|
|
55
|
+
}) })] }), _jsx("div", { className: "z-1 bottom-[-60] right-0 lg:absolute", children: _jsx(Image, { width: 150, height: 150, src: isPayingOut ? openChest : closeChest, alt: "closeChest", quality: 100, className: "h-25 w-25 lg:h-37.5 lg:w-37.5 size-full p-2" }) })] }), topJackpotPayout.amount ? (_jsx("div", { children: _jsxs("div", { className: "bg-bg-primary relative mt-4 hidden w-full gap-4 rounded-lg p-4 lg:flex", children: [_jsxs("div", { className: "bg-bg-tertiary relative flex h-18 w-18 items-center justify-center rounded-full", children: [_jsx(User01Icon, { className: "text-text-quarterary-500 size-9" }), _jsx("div", { className: "bg-yellow-400 text-brand-950 border-bg-primary absolute bottom-0 right-0 flex h-6 w-6 items-center justify-center rounded-full border-[1.5px] text-xs font-bold", children: "1st" })] }), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsxs("div", { className: "border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-sm border px-2 py-0.5 text-xs font-medium", children: [_jsx(Trophy01Icon, { className: "text-utility-brand-600 size-3.5" }), "Top Payout"] }), _jsx("div", { className: "font-semibold", children: maskDisplayName(topJackpotPayout.member.name) }), _jsx("div", { className: "text-brand-400 text-2xl", children: formatNumber(topJackpotPayout.amount, {
|
|
54
56
|
currency: localeInfo.currency.code,
|
|
55
57
|
minDecimalPlaces: 2,
|
|
56
58
|
maxDecimalPlaces: 2,
|
|
57
|
-
}) })] })] }) })) : (_jsxs("div", { className: "bg-bg-primary relative mt-4 hidden w-full gap-4 rounded-lg p-4 lg:flex", children: [_jsx(Image, { width: 66, height: 87, src: firstPlace, alt: "
|
|
59
|
+
}) })] })] }) })) : (_jsxs("div", { className: "bg-bg-primary relative mt-4 hidden w-full gap-4 rounded-lg p-4 lg:flex", children: [_jsx(Image, { width: 66, height: 87, src: firstPlace, alt: "firstPlace", className: "size-full h-auto w-[66px] mix-blend-luminosity" }), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsxs("div", { className: "border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-sm border px-2 py-0.5 text-xs font-medium", children: [_jsx(Trophy01Icon, { className: "text-utility-brand-600 size-3.5" }), "Top Payout"] }), _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: "text-text-primary-900 text-xs font-semibold", children: formatNumber(0, {
|
|
58
60
|
currency: localeInfo.currency.code,
|
|
59
61
|
compact: true,
|
|
60
62
|
}) }), _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: "text-text-primary-900 text-xs font-semibold", children: formatNumber(jackpot?.maximumJackpotPoolLimit, {
|
|
61
63
|
currency: localeInfo.currency.code,
|
|
62
64
|
compact: true,
|
|
63
|
-
}) })] })] }), _jsx(Progress.Root, { className: "bg-bg-primary h-2 w-full rounded-full lg:h-4", max: 100, value:
|
|
65
|
+
}) })] })] }), _jsx(Progress.Root, { className: "bg-bg-primary h-2 w-full rounded-full lg:h-4", max: 100, value: getPercentage(Number(jackpot.pool), Number(jackpot.maximumJackpotPoolLimit)), children: _jsx(Progress.Track, { className: "bg-bg-primary h-full overflow-hidden rounded-full", children: _jsx(Progress.Range, { className: "bg-brand-500 relative h-full overflow-hidden rounded-full 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 }) }) }) }), _jsx("div", { className: "mt-1 block text-start text-2xs lg:hidden", children: isPayingOut
|
|
64
66
|
? `The pot has hit ${formatNumber(jackpot?.maximumJackpotPoolLimit, {
|
|
65
67
|
currency: localeInfo.currency.code,
|
|
66
68
|
compact: true,
|
|
67
69
|
})} Play now for your chance to win big! 🔥`
|
|
68
|
-
: 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, quality: 100, alt: "leaderboardIcon", className: "size-full h-auto w-6" }), _jsx("div", { className: "text-text-primary-900 text-lg font-semibold", children: jackpotPayouts.length ? 'Leaderboard' : 'Starting soon!' })] }), _jsxs(Link, { className: "text-button-tertiary-fg flex text-sm font-semibold", href: viewAllUrl ?? '/jackpots', children: ["See details", _jsx(ChevronRightIcon, { className: "size-5" })] })] }), _jsx("div", { className: twMerge('max-h-[272px] overflow-y-scroll', styles['scrollArea']), children: _jsx("div", { className: "border-gray-200 overflow-hidden rounded-xl", children: _jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-bg-secondary text-text-tertiary-600 h-8 text-xs font-medium", children: [_jsx("th", { className: "w-[52px]", children: "#" }), _jsx("th", { children: "Player" }), _jsx("th", { children: "Multiplier" }), _jsx("th", { children: "Prize" })] }) }), _jsx("tbody", { children: jackpotPayouts.length ? (_jsx(_Fragment, { children: jackpotPayouts.map((jackpotPayout, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children:
|
|
70
|
+
: 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, quality: 100, alt: "leaderboardIcon", className: "size-full h-auto w-6" }), _jsx("div", { className: "text-text-primary-900 text-lg font-semibold", children: jackpotPayouts.length ? 'Leaderboard' : 'Starting soon!' })] }), _jsxs(Link, { className: "text-button-tertiary-fg flex text-sm font-semibold", href: viewAllUrl ?? '/jackpots', children: ["See details", _jsx(ChevronRightIcon, { className: "size-5" })] })] }), _jsx("div", { className: twMerge('max-h-[272px] overflow-y-scroll', styles['scrollArea']), children: _jsx("div", { className: "border-gray-200 overflow-hidden rounded-xl", children: _jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-bg-secondary text-text-tertiary-600 h-8 text-xs font-medium", children: [_jsx("th", { className: "w-[52px]", children: "#" }), _jsx("th", { children: "Player" }), _jsx("th", { children: "Multiplier" }), _jsx("th", { children: "Prize" })] }) }), _jsx("tbody", { children: jackpotPayouts.length ? (_jsx(_Fragment, { children: jackpotPayouts.map((jackpotPayout, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: maskDisplayName(jackpotPayout.member.name) }), _jsxs("td", { className: "border-border-secondary h-12 border-t-2", children: [jackpotPayout.multiplier, "x"] }), _jsx("td", { className: "border-border-secondary text-brand-400 h-12 border-t-2", children: formatNumber(jackpotPayout.amount, {
|
|
69
71
|
currency: localeInfo.currency.code,
|
|
70
72
|
minDecimalPlaces: 2,
|
|
71
73
|
maxDecimalPlaces: 2,
|
|
72
74
|
}) })] }, i))) })) : (_jsx(_Fragment, { children: Array.from({ length: 10 }).map((_, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" })] }, i))) })) })] }) }) })] }), isPayingOut && (_jsx("div", { className: twMerge(styles['light-rays'], 'absolute right-0 top-0 rounded-2xl [--light-rays-top:25%] lg:[--light-rays-top:150px]') }))] }));
|
|
73
75
|
}
|
|
74
|
-
export function maskName(name) {
|
|
75
|
-
if (name.length <= 7) {
|
|
76
|
-
return '*'.repeat(name.length);
|
|
77
|
-
}
|
|
78
|
-
const visiblePart = name.slice(0, 3);
|
|
79
|
-
const maskedPart = '*'.repeat(7);
|
|
80
|
-
return visiblePart + maskedPart;
|
|
81
|
-
}
|
|
82
|
-
const calculatePercentage = (part, total) => {
|
|
83
|
-
if (total === 0)
|
|
84
|
-
return 0;
|
|
85
|
-
return (part / total) * 100;
|
|
86
|
-
};
|
|
87
76
|
const getAccumulatingJackpotDescription = (part, total) => {
|
|
88
77
|
const percentage = total === 0 ? 0 : (part / total) * 100;
|
|
89
78
|
return percentage <= 90
|
|
@@ -3,25 +3,26 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { Progress } from '@ark-ui/react';
|
|
4
4
|
import Image from 'next/image';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
|
-
import { ArrowNarrowUpRightIcon, ChevronLeftIcon, ChevronRightIcon, Trophy01Icon, } from '../../icons/index.js';
|
|
6
|
+
import { ArrowNarrowUpRightIcon, ChevronLeftIcon, ChevronRightIcon, Trophy01Icon, User01Icon, } from '../../icons/index.js';
|
|
7
7
|
import { StarIcon } from '../../icons/StarIcon.js';
|
|
8
|
-
import closeChest from '
|
|
9
|
-
import firstPlace from '
|
|
10
|
-
import leaderboard from '
|
|
11
|
-
import openChest from '
|
|
8
|
+
import closeChest from '~/images/close-chest.png';
|
|
9
|
+
import firstPlace from '~/images/first-place.png';
|
|
10
|
+
import leaderboard from '~/images/leaderboard.png';
|
|
11
|
+
import openChest from '~/images/open-chest.png';
|
|
12
12
|
import { formatNumber } from '../../utils/index.js';
|
|
13
|
-
import {
|
|
13
|
+
import { getPercentage } from '../../utils/getPercentage.js';
|
|
14
|
+
import { maskDisplayName } from '../../utils/maskDisplayName.js';
|
|
14
15
|
import styles from '../JackpotCounter/JackpotCounterItem.module.css';
|
|
15
16
|
import { JackpotGameProviders } from './JackpotGameProviders.js';
|
|
16
17
|
import { JackpotRules } from './JackpotRules.js';
|
|
17
18
|
import { useJackpotItemData } from './useJackpotItemData.js';
|
|
18
19
|
export function JackpotItemDesktop({ jackpot, gameProviders, }) {
|
|
19
|
-
const { jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages,
|
|
20
|
+
const { jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, getAccumulatingJackpotDescription, starTierStyles, } = useJackpotItemData({ jackpot, gameProviders });
|
|
20
21
|
return (_jsxs("div", { className: twMerge('bg-bg-tertiary border-border-primary rounded-2xl border'), children: [_jsxs("div", { className: twMerge('relative flex shrink-0 p-3 text-center lg:gap-4 lg:p-5'), children: [_jsxs("div", { className: "z-1 relative 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: "border-utility-success-200 bg-utility-success-50 text-utility-success-700 flex w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium", children: [_jsx("span", { className: "full bg-utility-success-500 size-1.5 animate-pulse rounded" }), "Paying Out"] })) : (_jsxs("div", { className: "border-utility-blue-200 bg-utility-blue-50 text-utility-blue-700 flex w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium", children: [_jsx(ArrowNarrowUpRightIcon, { className: "text-utility-blue-500 size-3.5" }), "Accumulating"] })), _jsx("div", { className: "text-text-primary-900 mt-1 text-left text-lg font-medium lg:mt-5 lg:text-2xl", children: jackpot.name }), _jsx("div", { className: "bg-bg-primary text-brand-400 mt-1.5 w-fit rounded-md px-2 py-1 text-2xl font-bold lg:mt-2 lg:text-4xl", children: formatNumber(jackpotAmount, {
|
|
21
22
|
currency: localeInfo.currency.code,
|
|
22
23
|
minDecimalPlaces: 2,
|
|
23
24
|
maxDecimalPlaces: 2,
|
|
24
|
-
}) })] }), _jsx("div", { className: "z-1 bottom-[-60] right-0 block lg:absolute", children: _jsx(Image, { width: 150, height: 150, src: isPayingOut ? openChest : closeChest, alt: "closeChest", quality: 100, className: "h-25 w-25 lg:h-37.5 lg:w-37.5 size-full p-2" }) })] }), topJackpotPayout.amount ? (_jsx("div", { children: _jsxs("div", { className: "bg-bg-primary relative mt-4 hidden w-full gap-4 rounded-lg p-4 lg:flex", children: [
|
|
25
|
+
}) })] }), _jsx("div", { className: "z-1 bottom-[-60] right-0 block lg:absolute", children: _jsx(Image, { width: 150, height: 150, src: isPayingOut ? openChest : closeChest, alt: "closeChest", quality: 100, className: "h-25 w-25 lg:h-37.5 lg:w-37.5 size-full p-2" }) })] }), topJackpotPayout.amount ? (_jsx("div", { children: _jsxs("div", { className: "bg-bg-primary relative mt-4 hidden w-full gap-4 rounded-lg p-4 lg:flex", children: [_jsxs("div", { className: "bg-bg-tertiary relative flex h-18 w-18 items-center justify-center rounded-full", children: [_jsx(User01Icon, { className: "text-text-quarterary-500 size-9" }), _jsx("div", { className: "bg-yellow-400 text-brand-950 border-bg-primary absolute bottom-0 right-0 flex h-6 w-6 items-center justify-center rounded-full border-[1.5px] text-xs font-bold", children: "1st" })] }), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsxs("div", { className: "border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-sm border px-2 py-0.5 text-xs font-medium", children: [_jsx(Trophy01Icon, { className: "text-utility-brand-600 size-3.5" }), "Top Payout"] }), _jsx("div", { className: "font-semibold", children: maskDisplayName(topJackpotPayout.member.name) }), _jsx("div", { className: "text-brand-400 text-2xl", children: formatNumber(topJackpotPayout.amount, {
|
|
25
26
|
currency: localeInfo.currency.code,
|
|
26
27
|
minDecimalPlaces: 2,
|
|
27
28
|
maxDecimalPlaces: 2,
|
|
@@ -31,14 +32,14 @@ export function JackpotItemDesktop({ jackpot, gameProviders, }) {
|
|
|
31
32
|
}) }), _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: "text-text-primary-900 text-xs font-semibold", children: formatNumber(jackpot?.maximumJackpotPoolLimit, {
|
|
32
33
|
currency: localeInfo.currency.code,
|
|
33
34
|
compact: true,
|
|
34
|
-
}) })] })] }), _jsx(Progress.Root, { className: "bg-bg-primary h-2 w-full rounded-full lg:h-4", max: 100, value:
|
|
35
|
+
}) })] })] }), _jsx(Progress.Root, { className: "bg-bg-primary h-2 w-full rounded-full lg:h-4", max: 100, value: getPercentage(Number(jackpot.pool), Number(jackpot.maximumJackpotPoolLimit)), children: _jsx(Progress.Track, { className: "bg-bg-primary h-full overflow-hidden rounded-full", children: _jsx(Progress.Range, { className: "bg-brand-500 relative h-full overflow-hidden rounded-full 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 }) }) }) }), _jsx("div", { className: "mt-1 block text-start text-2xs lg:hidden", children: isPayingOut
|
|
35
36
|
? `The pot has hit ${formatNumber(jackpot?.maximumJackpotPoolLimit, {
|
|
36
37
|
currency: localeInfo.currency.code,
|
|
37
38
|
compact: true,
|
|
38
39
|
})} Play now for your chance to win big! 🔥`
|
|
39
|
-
: 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, quality: 100, alt: "leaderboardIcon", className: "size-full h-auto w-6" }), _jsx("div", { className: "text-text-primary-900 text-lg font-semibold", children: jackpotPayouts.length ? 'Leaderboard' : 'Starting soon!' })] }), _jsx(JackpotRules, { jackpotRules: jackpot.description })] }), _jsx("div", { className: twMerge('max-h-[272px] overflow-y-scroll', styles['scrollArea']), children: _jsx("div", { className: "border-gray-200 overflow-hidden rounded-xl", children: _jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-bg-secondary text-text-tertiary-600 h-8 text-xs font-medium", children: [_jsx("th", { className: "w-[52px]", children: "#" }), _jsx("th", { children: "Player" }), _jsx("th", { children: "Multiplier" }), _jsx("th", { children: "Prize" })] }) }), _jsx("tbody", { children: jackpotPayouts.length ? (_jsx(_Fragment, { children: jackpotPayouts.map((jackpotPayout, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children:
|
|
40
|
+
: 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, quality: 100, alt: "leaderboardIcon", className: "size-full h-auto w-6" }), _jsx("div", { className: "text-text-primary-900 text-lg font-semibold", children: jackpotPayouts.length ? 'Leaderboard' : 'Starting soon!' })] }), _jsx(JackpotRules, { jackpotRules: jackpot.description })] }), _jsx("div", { className: twMerge('max-h-[272px] overflow-y-scroll', styles['scrollArea']), children: _jsx("div", { className: "border-gray-200 overflow-hidden rounded-xl", children: _jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-bg-secondary text-text-tertiary-600 h-8 text-xs font-medium", children: [_jsx("th", { className: "w-[52px]", children: "#" }), _jsx("th", { children: "Player" }), _jsx("th", { children: "Multiplier" }), _jsx("th", { children: "Prize" })] }) }), _jsx("tbody", { children: jackpotPayouts.length ? (_jsx(_Fragment, { children: jackpotPayouts.map((jackpotPayout, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: maskDisplayName(jackpotPayout.member.name) }), _jsxs("td", { className: "border-border-secondary h-12 border-t-2", children: [jackpotPayout.multiplier, "x"] }), _jsx("td", { className: "border-border-secondary text-brand-400 h-12 border-t-2", children: formatNumber(jackpotPayout.amount, {
|
|
40
41
|
currency: localeInfo.currency.code,
|
|
41
42
|
minDecimalPlaces: 2,
|
|
42
43
|
maxDecimalPlaces: 2,
|
|
43
|
-
}) })] }, i))) })) : (_jsx(_Fragment, { children: Array.from({ length: 10 }).map((_, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" })] }, i))) })) })] }) }) })] }), isPayingOut && (_jsx("div", { className: twMerge(styles['light-rays'], 'absolute right-0 top-0 rounded-2xl') }))] }), Boolean(filteredGameProviders.length) && (_jsx(JackpotGameProviders, { gameProviders:
|
|
44
|
+
}) })] }, i))) })) : (_jsx(_Fragment, { children: Array.from({ length: 10 }).map((_, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" })] }, i))) })) })] }) }) })] }), isPayingOut && (_jsx("div", { className: twMerge(styles['light-rays'], 'absolute right-0 top-0 rounded-2xl') }))] }), Boolean(filteredGameProviders.length) && (_jsx(JackpotGameProviders, { gameProviders: filteredGameProviders }))] }));
|
|
44
45
|
}
|
|
@@ -4,22 +4,23 @@ import { Progress } from '@ark-ui/react';
|
|
|
4
4
|
import Image from 'next/image';
|
|
5
5
|
import { useState } from 'react';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
|
-
import { ArrowNarrowUpRightIcon, ChevronLeftIcon, ChevronRightIcon, Trophy01Icon, } from '../../icons/index.js';
|
|
7
|
+
import { ArrowNarrowUpRightIcon, ChevronLeftIcon, ChevronRightIcon, Trophy01Icon, User01Icon, } from '../../icons/index.js';
|
|
8
8
|
import { ArrowNarrowDownIcon } from '../../icons/ArrowNarrowDownIcon.js';
|
|
9
9
|
import { ArrowNarrowUpIcon } from '../../icons/ArrowNarrowUpIcon.js';
|
|
10
10
|
import { StarIcon } from '../../icons/StarIcon.js';
|
|
11
|
-
import closeChest from '
|
|
12
|
-
import firstPlace from '
|
|
13
|
-
import openChest from '
|
|
11
|
+
import closeChest from '~/images/close-chest.png';
|
|
12
|
+
import firstPlace from '~/images/first-place.png';
|
|
13
|
+
import openChest from '~/images/open-chest.png';
|
|
14
14
|
import { Button } from '../../ui/index.js';
|
|
15
15
|
import { formatNumber } from '../../utils/index.js';
|
|
16
|
-
import {
|
|
16
|
+
import { getPercentage } from '../../utils/getPercentage.js';
|
|
17
|
+
import { maskDisplayName } from '../../utils/maskDisplayName.js';
|
|
17
18
|
import styles from '../JackpotCounter/JackpotCounterItem.module.css';
|
|
18
19
|
import { JackpotGameProviders } from './JackpotGameProviders.js';
|
|
19
20
|
import { JackpotRules } from './JackpotRules.js';
|
|
20
21
|
import { useJackpotItemData } from './useJackpotItemData.js';
|
|
21
22
|
export function JackpotItemMobile({ jackpot, gameProviders, }) {
|
|
22
|
-
const { jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages,
|
|
23
|
+
const { jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, getAccumulatingJackpotDescription, starTierStyles, } = useJackpotItemData({ jackpot, gameProviders });
|
|
23
24
|
const [isDetailsVisible, setIsDetailsVisible] = useState(false);
|
|
24
25
|
return (_jsxs("div", { className: "bg-bg-primary border-border-primary rounded-2xl border", children: [_jsxs("div", { className: twMerge('bg-bg-tertiary relative flex shrink-0 rounded-2xl p-3 text-center lg:gap-4 lg:p-5'), children: [_jsxs("div", { className: "z-1 relative 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: "border-utility-success-200 bg-utility-success-50 text-utility-success-700 flex w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium", children: [_jsx("span", { className: "full bg-utility-success-500 size-1.5 animate-pulse rounded" }), "Paying Out"] })) : (_jsxs("div", { className: "border-utility-blue-200 bg-utility-blue-50 text-utility-blue-700 flex w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium", children: [_jsx(ArrowNarrowUpRightIcon, { className: "text-utility-blue-500 size-3.5" }), "Accumulating"] })), _jsx("div", { className: "text-text-primary-900 mt-1 text-left text-lg font-medium lg:mt-5 lg:text-2xl", children: jackpot.name }), _jsx("div", { className: "bg-bg-primary text-brand-400 mt-1.5 w-fit rounded-md px-2 py-1 text-2xl font-bold lg:mt-2 lg:text-4xl", children: formatNumber(jackpotAmount, {
|
|
25
26
|
currency: localeInfo.currency.code,
|
|
@@ -31,18 +32,18 @@ export function JackpotItemMobile({ jackpot, gameProviders, }) {
|
|
|
31
32
|
}) }), _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: "text-text-primary-900 text-xs font-semibold", children: formatNumber(jackpot?.maximumJackpotPoolLimit, {
|
|
32
33
|
currency: localeInfo.currency.code,
|
|
33
34
|
compact: true,
|
|
34
|
-
}) })] })] }), _jsx(Progress.Root, { className: "bg-bg-primary h-2 w-full rounded-full lg:h-4", max: 100, value:
|
|
35
|
+
}) })] })] }), _jsx(Progress.Root, { className: "bg-bg-primary h-2 w-full rounded-full lg:h-4", max: 100, value: getPercentage(Number(jackpot.pool), Number(jackpot.maximumJackpotPoolLimit)), children: _jsx(Progress.Track, { className: "bg-bg-primary h-full overflow-hidden rounded-full", children: _jsx(Progress.Range, { className: "bg-brand-500 relative h-full overflow-hidden rounded-full 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 }) }) }) }), _jsx("div", { className: "mt-1 block text-start text-2xs lg:hidden", children: isPayingOut
|
|
35
36
|
? `The pot has hit ${formatNumber(jackpot?.maximumJackpotPoolLimit, {
|
|
36
37
|
currency: localeInfo.currency.code,
|
|
37
38
|
compact: true,
|
|
38
39
|
})} Play now for your chance to win big! 🔥`
|
|
39
|
-
: getAccumulatingJackpotDescription(Number(jackpot?.pool) ?? 0, Number(jackpot?.maximumJackpotPoolLimit) ?? 0) })] }), topJackpotPayout.amount ? (_jsx("div", { children: _jsxs("div", { className: "bg-bg-primary relative mt-4 flex w-full gap-4 rounded-lg p-4", children: [
|
|
40
|
+
: getAccumulatingJackpotDescription(Number(jackpot?.pool) ?? 0, Number(jackpot?.maximumJackpotPoolLimit) ?? 0) })] }), topJackpotPayout.amount ? (_jsx("div", { children: _jsxs("div", { className: "bg-bg-primary relative mt-4 flex w-full gap-4 rounded-lg p-4", children: [_jsxs("div", { className: "bg-bg-tertiary relative flex h-18 w-18 items-center justify-center rounded-full", children: [_jsx(User01Icon, { className: "text-text-quarterary-500 size-9" }), _jsx("div", { className: "bg-yellow-400 text-brand-950 border-bg-primary absolute bottom-0 right-0 flex h-6 w-6 items-center justify-center rounded-full border-[1.5px] text-xs font-bold", children: "1st" })] }), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsxs("div", { className: "border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-sm border px-2 py-0.5 text-xs font-medium", children: [_jsx(Trophy01Icon, { className: "text-utility-brand-600 size-3.5" }), "Top Payout"] }), _jsx("div", { className: "font-semibold", children: maskDisplayName(topJackpotPayout.member.name) }), _jsx("div", { className: "text-brand-400 text-2xl", children: formatNumber(topJackpotPayout.amount, {
|
|
40
41
|
currency: localeInfo.currency.code,
|
|
41
42
|
minDecimalPlaces: 2,
|
|
42
43
|
maxDecimalPlaces: 2,
|
|
43
|
-
}) })] })] }) })) : (_jsxs("div", { className: "bg-bg-primary relative mt-4 flex w-full gap-4 rounded-lg p-4", children: [_jsx(Image, { width: 66, height: 87, src: firstPlace, alt: "closeChest", className: "size-full h-auto w-[66px] mix-blend-luminosity" }), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsxs("div", { className: "border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-sm border px-2 py-0.5 text-xs font-medium", children: [_jsx(Trophy01Icon, { className: "text-utility-brand-600 size-3.5" }), "Top Payout"] }), _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 && (_jsx("div", { className: twMerge(styles['light-rays'], 'absolute right-0 top-0 rounded-2xl [--light-rays-top:15%] lg:[--light-rays-top:150px]') }))] }), 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: "text-text-primary-900 text-lg font-semibold", children: jackpotPayouts.length ? 'Leaderboard' : 'Starting soon!' }) }), _jsx(JackpotRules, { jackpotRules: jackpot.description })] }), _jsx("div", { children: _jsx("div", { className: "border-gray-200 overflow-hidden", children: _jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-bg-secondary text-text-tertiary-600 h-8 text-center text-xs font-medium", children: [_jsx("th", { className: "w-[52px]", children: "#" }), _jsx("th", { children: "Player" }), _jsx("th", { children: "Multiplier" }), _jsx("th", { children: "Prize" })] }) }), _jsx("tbody", { children: jackpotPayouts.length ? (_jsx(_Fragment, { children: jackpotPayouts.map((jackpotPayout, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-center text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children:
|
|
44
|
+
}) })] })] }) })) : (_jsxs("div", { className: "bg-bg-primary relative mt-4 flex w-full gap-4 rounded-lg p-4", children: [_jsx(Image, { width: 66, height: 87, src: firstPlace, alt: "closeChest", className: "size-full h-auto w-[66px] mix-blend-luminosity" }), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsxs("div", { className: "border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-sm border px-2 py-0.5 text-xs font-medium", children: [_jsx(Trophy01Icon, { className: "text-utility-brand-600 size-3.5" }), "Top Payout"] }), _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 && (_jsx("div", { className: twMerge(styles['light-rays'], 'absolute right-0 top-0 rounded-2xl [--light-rays-top:15%] lg:[--light-rays-top:150px]') }))] }), 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: "text-text-primary-900 text-lg font-semibold", children: jackpotPayouts.length ? 'Leaderboard' : 'Starting soon!' }) }), _jsx(JackpotRules, { jackpotRules: jackpot.description })] }), _jsx("div", { children: _jsx("div", { className: "border-gray-200 overflow-hidden", children: _jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-bg-secondary text-text-tertiary-600 h-8 text-center text-xs font-medium", children: [_jsx("th", { className: "w-[52px]", children: "#" }), _jsx("th", { children: "Player" }), _jsx("th", { children: "Multiplier" }), _jsx("th", { children: "Prize" })] }) }), _jsx("tbody", { children: jackpotPayouts.length ? (_jsx(_Fragment, { children: jackpotPayouts.map((jackpotPayout, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-center text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: maskDisplayName(jackpotPayout.member.name) }), _jsxs("td", { className: "border-border-secondary h-12 border-t-2", children: [jackpotPayout.multiplier, "x"] }), _jsx("td", { className: "border-border-secondary text-brand-400 h-12 border-t-2", children: formatNumber(jackpotPayout.amount, {
|
|
44
45
|
currency: localeInfo.currency.code,
|
|
45
46
|
minDecimalPlaces: 2,
|
|
46
47
|
maxDecimalPlaces: 2,
|
|
47
|
-
}) })] }, i))) })) : (_jsx(_Fragment, { children: Array.from({ length: 10 }).map((_, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-center text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" })] }, i))) })) })] }) }) })] }), Boolean(filteredGameProviders.length) && (_jsx(JackpotGameProviders, { gameProviders:
|
|
48
|
+
}) })] }, i))) })) : (_jsx(_Fragment, { children: Array.from({ length: 10 }).map((_, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-center text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" })] }, i))) })) })] }) }) })] }), Boolean(filteredGameProviders.length) && (_jsx(JackpotGameProviders, { 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" })] }) }) })] }))] }));
|
|
48
49
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Image from 'next/image';
|
|
3
4
|
import { useJackpotsQuery } from '../../client/hooks/index.js';
|
|
5
|
+
import closeChest from '~/images/close-chest.png';
|
|
4
6
|
import { JackpotItemDesktop } from './JackpotItemDesktop.js';
|
|
5
7
|
import { JackpotItemMobile } from './JackpotItemMobile.js';
|
|
6
8
|
export function Jackpots(props) {
|
|
@@ -22,5 +24,5 @@ export function Jackpots(props) {
|
|
|
22
24
|
const jackpots = jackpotsQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
|
|
23
25
|
if (jackpots.length <= 0)
|
|
24
26
|
return null;
|
|
25
|
-
return (_jsxs("div", { className: props.className, children: [_jsx("div", { className: "mb-3 text-lg font-semibold lg:mb-4.5", children: props.heading ?? 'Jackpots' }), _jsx("div", { className: "hidden flex-col gap-6 lg:flex", children: jackpots.map((jackpot) => (_jsx(JackpotItemDesktop, { gameProviders: props.gameProviders, jackpot: jackpot, viewAllUrl: props.viewAllUrl }, jackpot.id))) }), _jsx("div", { className: "flex flex-col gap-6 lg:hidden", children: jackpots.map((jackpot) => (_jsx(JackpotItemMobile, { gameProviders: props.gameProviders, jackpot: jackpot, viewAllUrl: props.viewAllUrl }, jackpot.id))) })] }));
|
|
27
|
+
return (_jsxs("div", { className: props.className, children: [_jsx("div", { className: "mb-3 text-lg font-semibold 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(JackpotItemDesktop, { gameProviders: props.gameProviders, jackpot: jackpot, viewAllUrl: props.viewAllUrl }, jackpot.id))) }), _jsx("div", { className: "flex flex-col gap-6 lg:hidden", children: jackpots.map((jackpot) => (_jsx(JackpotItemMobile, { gameProviders: props.gameProviders, jackpot: jackpot, viewAllUrl: props.viewAllUrl }, jackpot.id))) })] })) : (_jsxs("div", { className: "mt-11 flex flex-col items-center justify-center", children: [_jsx(Image, { width: 100, height: 100, src: closeChest, alt: "closeChest", quality: 100, className: "h-29.5 w-29.5 lg:h-25 lg:w-25 size-full mix-blend-luminosity" }), _jsx("div", { className: "text-text-primary-900 mt-4 text-base font-semibold", children: props.heading ?? 'Jackpots' }), _jsxs("div", { className: "text-text-tertiary-600 mt-1 text-center text-sm", children: ["No ", props.heading?.toLocaleLowerCase() ?? 'jackpots', " are running at the moment. ", _jsx("br", {}), "Please check back later!"] })] }))] }));
|
|
26
28
|
}
|