@opexa/portal-components 0.0.93 → 0.0.95
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/index.d.ts +2 -0
- package/dist/client/hooks/index.js +2 -0
- package/dist/client/hooks/useBonusesCountQuery.d.ts +2 -0
- package/dist/client/hooks/useBonusesCountQuery.js +27 -0
- package/dist/client/hooks/useCashbackBonusesCountQuery.d.ts +2 -0
- package/dist/client/hooks/useCashbackBonusesCountQuery.js +26 -0
- package/dist/client/hooks/useClaimCashbackBonusMutation.js +4 -1
- package/dist/components/Account/Account.js +13 -4
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.d.ts +3 -2
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.js +3 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsList.d.ts +13 -2
- package/dist/components/Jackpots/JackpotsList/JackpotsList.js +10 -2
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.d.ts +7 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.js +2 -2
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.d.ts +7 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.js +2 -2
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarousel.d.ts +19 -2
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarousel.js +26 -2
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.d.ts +17 -2
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.js +17 -6
- package/dist/components/Tournaments/TournamentsList/TournamentsList.d.ts +19 -2
- package/dist/components/Tournaments/TournamentsList/TournamentsList.js +36 -2
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemDesktop.d.ts +19 -1
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemDesktop.js +18 -6
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemMobile.d.ts +19 -1
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemMobile.js +16 -4
- package/dist/server/utils/index.d.ts +2 -0
- package/dist/server/utils/index.js +2 -0
- package/dist/server/utils/prefetchBonusesCountQuery.d.ts +1 -0
- package/dist/server/utils/prefetchBonusesCountQuery.js +19 -0
- package/dist/server/utils/prefetchCashbackBonusesCountQuery.d.ts +1 -0
- package/dist/server/utils/prefetchCashbackBonusesCountQuery.js +19 -0
- package/dist/services/queries.d.ts +2 -0
- package/dist/services/queries.js +14 -0
- package/dist/services/wallet.service.d.ts +13 -1
- package/dist/services/wallet.service.js +10 -2
- 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.recipe.d.ts +3 -3
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/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 +192 -192
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +8 -8
- package/dist/ui/Dialog/Dialog.d.ts +88 -88
- package/dist/ui/Dialog/dialog.recipe.d.ts +8 -8
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Field/Field.d.ts +21 -21
- package/dist/ui/Field/field.recipe.d.ts +3 -3
- 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/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/dist/utils/isStyleEntries.d.ts +1 -1
- package/dist/utils/isStyleEntries.js +1 -1
- package/dist/utils/queryKeys.d.ts +2 -0
- package/dist/utils/queryKeys.js +4 -0
- package/package.json +1 -1
|
@@ -4,8 +4,10 @@ export * from './useAvailablePromosQuery';
|
|
|
4
4
|
export * from './useAvailableQuestsCountQuery';
|
|
5
5
|
export * from './useAvailableQuestsQuery';
|
|
6
6
|
export * from './useBetRecordsQuery';
|
|
7
|
+
export * from './useBonusesCountQuery';
|
|
7
8
|
export * from './useBonusesQuery';
|
|
8
9
|
export * from './useBonusQuery';
|
|
10
|
+
export * from './useCashbackBonusesCountQuery';
|
|
9
11
|
export * from './useCashbackBonusesQuery';
|
|
10
12
|
export * from './useCashbackBonusQuery';
|
|
11
13
|
export * from './useCashbackQuery';
|
|
@@ -4,8 +4,10 @@ export * from './useAvailablePromosQuery.js';
|
|
|
4
4
|
export * from './useAvailableQuestsCountQuery.js';
|
|
5
5
|
export * from './useAvailableQuestsQuery.js';
|
|
6
6
|
export * from './useBetRecordsQuery.js';
|
|
7
|
+
export * from './useBonusesCountQuery.js';
|
|
7
8
|
export * from './useBonusesQuery.js';
|
|
8
9
|
export * from './useBonusQuery.js';
|
|
10
|
+
export * from './useCashbackBonusesCountQuery.js';
|
|
9
11
|
export * from './useCashbackBonusesQuery.js';
|
|
10
12
|
export * from './useCashbackBonusQuery.js';
|
|
11
13
|
export * from './useCashbackQuery.js';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import invariant from 'tiny-invariant';
|
|
3
|
+
import { getBonusesCount } from '../../services/index.js';
|
|
4
|
+
import { getBonusesCountQueryKey } from '../../utils/index.js';
|
|
5
|
+
import { getSession } from '../services/index.js';
|
|
6
|
+
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
|
+
export const useBonusesCountQuery = (config) => {
|
|
8
|
+
const sessionQuery = useSessionQuery();
|
|
9
|
+
const query = useQuery({
|
|
10
|
+
...config,
|
|
11
|
+
enabled: config?.enabled === false
|
|
12
|
+
? false
|
|
13
|
+
: sessionQuery.data?.status === 'authenticated',
|
|
14
|
+
queryKey: getBonusesCountQueryKey(),
|
|
15
|
+
queryFn: async ({ signal }) => {
|
|
16
|
+
const session = await getSession();
|
|
17
|
+
invariant(session.status === 'authenticated');
|
|
18
|
+
return await getBonusesCount({
|
|
19
|
+
signal,
|
|
20
|
+
headers: {
|
|
21
|
+
Authorization: `Bearer ${session.token}`,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
return query;
|
|
27
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import invariant from 'tiny-invariant';
|
|
3
|
+
import { getCashbackBonusesCount } from '../../services/index.js';
|
|
4
|
+
import { getCashbackBonusesCountQueryKey } from '../../utils/index.js';
|
|
5
|
+
import { getSession } from '../services/index.js';
|
|
6
|
+
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
|
+
export const useCashbackBonusesCountQuery = (config) => {
|
|
8
|
+
const sessionQuery = useSessionQuery();
|
|
9
|
+
return useQuery({
|
|
10
|
+
...config,
|
|
11
|
+
enabled: config?.enabled === false
|
|
12
|
+
? false
|
|
13
|
+
: sessionQuery.data?.status === 'authenticated',
|
|
14
|
+
queryKey: getCashbackBonusesCountQueryKey(),
|
|
15
|
+
queryFn: async ({ signal }) => {
|
|
16
|
+
const session = await getSession();
|
|
17
|
+
invariant(session.status === 'authenticated');
|
|
18
|
+
return await getCashbackBonusesCount({
|
|
19
|
+
signal,
|
|
20
|
+
headers: {
|
|
21
|
+
Authorization: `Bearer ${session.token}`,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMutation } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { claimCashbackBonus } from '../../services/index.js';
|
|
4
|
-
import { getCashbackBonusesQueryKey, getClaimCashbackBonusMutationKey, getQueryClient, } from '../../utils/index.js';
|
|
4
|
+
import { getCashbackBonusesCountQueryKey, getCashbackBonusesQueryKey, getClaimCashbackBonusMutationKey, getQueryClient, } from '../../utils/index.js';
|
|
5
5
|
import { getSession } from '../services/index.js';
|
|
6
6
|
export const useClaimCashbackBonusMutation = (config) => {
|
|
7
7
|
const queryClient = getQueryClient();
|
|
@@ -17,6 +17,9 @@ export const useClaimCashbackBonusMutation = (config) => {
|
|
|
17
17
|
},
|
|
18
18
|
});
|
|
19
19
|
queryClient.setQueryData(getCashbackBonusesQueryKey(), (prev) => prev?.filter((bonus) => bonus.id !== id));
|
|
20
|
+
queryClient.setQueryData(getCashbackBonusesCountQueryKey(), (prev) => {
|
|
21
|
+
return !prev ? 0 : prev > 0 ? prev - 1 : 0;
|
|
22
|
+
});
|
|
20
23
|
},
|
|
21
24
|
});
|
|
22
25
|
};
|
|
@@ -5,7 +5,7 @@ import Image from 'next/image';
|
|
|
5
5
|
import Link from 'next/link';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
7
|
import { useShallow } from 'zustand/shallow';
|
|
8
|
-
import { useAccountQuery, useGlobalStore, useLocaleInfo, useSignOutMutation, useUnreadMessagesCountQuery, useWalletQuery, } from '../../client/hooks/index.js';
|
|
8
|
+
import { useAccountQuery, useBonusesCountQuery, useCashbackBonusesCountQuery, useGlobalStore, useLocaleInfo, useProfileCompletionQuery, useSignOutMutation, useUnreadMessagesCountQuery, useWalletQuery, } from '../../client/hooks/index.js';
|
|
9
9
|
import { AlertCircleIcon, Bell01Icon, ChevronRightIcon, CoinsStacked02Icon, CoinsSwap02Icon, Gift01Icon, Logout01Icon, Settings02Icon, } from '../../icons/index.js';
|
|
10
10
|
import avatarPlaceholder from '../../images/placeholder-avatar.png';
|
|
11
11
|
import { Badge, Button, Drawer, Popover } from '../../ui/index.js';
|
|
@@ -86,17 +86,26 @@ function Links(props) {
|
|
|
86
86
|
messages: ctx.messages,
|
|
87
87
|
})));
|
|
88
88
|
const unreadMessagesCountQuery = useUnreadMessagesCountQuery({}, { refetchInterval: 5000 });
|
|
89
|
+
const unreadMessagesCount = unreadMessagesCountQuery.data ?? 0;
|
|
90
|
+
const profileCompletionQuery = useProfileCompletionQuery();
|
|
91
|
+
const profileCompletion = profileCompletionQuery.data;
|
|
92
|
+
const profileCompletionPercentage = parseDecimal(profileCompletion?.completionPercentage, 0);
|
|
93
|
+
const bonusesCountQuery = useBonusesCountQuery();
|
|
94
|
+
const bonusesCount = bonusesCountQuery.data ?? 0;
|
|
95
|
+
const cashbackBonusesCountQuery = useCashbackBonusesCountQuery();
|
|
96
|
+
const cashbackBonusesCount = cashbackBonusesCountQuery.data ?? 0;
|
|
97
|
+
const rewardsCount = bonusesCount + cashbackBonusesCount;
|
|
89
98
|
return (_jsxs("nav", { className: recipe.nav({ className: 'mt-xl' }), children: [_jsxs("ul", { children: [_jsx("li", { className: recipe.navItemRoot(), children: _jsxs("button", { type: "button", className: recipe.navItemLink(), onClick: () => {
|
|
90
99
|
globalStore.account.setOpen(false);
|
|
91
100
|
globalStore.account__mobile.setOpen(false);
|
|
92
101
|
globalStore.messages.setOpen(true);
|
|
93
|
-
}, children: [_jsx(Bell01Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Notifications" }), _jsx("span", { className: recipe.navItemBadge(), "data-type": "warning", children:
|
|
102
|
+
}, children: [_jsx(Bell01Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Notifications" }), unreadMessagesCount > 0 && (_jsx("span", { className: recipe.navItemBadge(), "data-type": "warning", children: unreadMessagesCount })), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) }), _jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.rewardsUrl, className: recipe.navItemLink(), onClick: () => {
|
|
94
103
|
globalStore.account.setOpen(false);
|
|
95
104
|
globalStore.account__mobile.setOpen(false);
|
|
96
|
-
}, children: [_jsx(Gift01Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Rewards" }), _jsx("span", { className: recipe.navItemBadge(), "data-type": "warning", children:
|
|
105
|
+
}, children: [_jsx(Gift01Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Rewards" }), rewardsCount > 0 && (_jsx("span", { className: recipe.navItemBadge(), "data-type": "warning", children: rewardsCount })), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) })] }), props.shouldShowSettings && (_jsx("ul", { children: _jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.accountSettingsUrl, className: recipe.navItemLink(), onClick: () => {
|
|
97
106
|
globalStore.account.setOpen(false);
|
|
98
107
|
globalStore.account__mobile.setOpen(false);
|
|
99
|
-
}, children: [_jsx(Settings02Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Settings" }), _jsx("span", { className: recipe.navItemBadge(), "data-type": "error", children: _jsx(AlertCircleIcon, {}) }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) }) })), _jsxs("ul", { children: [_jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.betRecordsUrl, className: recipe.navItemLink(), onClick: () => {
|
|
108
|
+
}, children: [_jsx(Settings02Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Settings" }), profileCompletionPercentage < 100 && (_jsx("span", { className: recipe.navItemBadge(), "data-type": "error", children: _jsx(AlertCircleIcon, {}) })), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) }) })), _jsxs("ul", { children: [_jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.betRecordsUrl, className: recipe.navItemLink(), onClick: () => {
|
|
100
109
|
globalStore.account.setOpen(false);
|
|
101
110
|
globalStore.account__mobile.setOpen(false);
|
|
102
111
|
}, children: [_jsx(CoinsStacked02Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Bet Records" }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) }), _jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.transactionsUrl, className: recipe.navItemLink(), onClick: () => {
|
package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const OnlineBankDepositContext: import("react").Context<{
|
|
2
|
-
view: "
|
|
2
|
+
view: "form" | "vca";
|
|
3
3
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
4
4
|
verify: () => void;
|
|
5
5
|
reset: () => void;
|
|
@@ -9,7 +9,7 @@ export declare const OnlineBankDepositContext: import("react").Context<{
|
|
|
9
9
|
promo?: string | null;
|
|
10
10
|
}) => void;
|
|
11
11
|
}>, useOnlineBankDepositContext: () => {
|
|
12
|
-
view: "
|
|
12
|
+
view: "form" | "vca";
|
|
13
13
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
14
14
|
verify: () => void;
|
|
15
15
|
reset: () => void;
|
package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Deposit } from '../../../../types';
|
|
2
2
|
export type UseOnlineBankDepositReturn = ReturnType<typeof useOnlineBankDeposit>;
|
|
3
3
|
export declare function useOnlineBankDeposit(): {
|
|
4
|
-
view: "
|
|
4
|
+
view: "form" | "vca";
|
|
5
5
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
6
6
|
verify: () => void;
|
|
7
7
|
reset: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const QRPHDepositContext: import("react").Context<{
|
|
2
|
-
view: "
|
|
2
|
+
view: "form" | "qrCode";
|
|
3
3
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
4
4
|
verify: () => void;
|
|
5
5
|
reset: () => void;
|
|
@@ -9,7 +9,7 @@ export declare const QRPHDepositContext: import("react").Context<{
|
|
|
9
9
|
promo?: string | null;
|
|
10
10
|
}) => void;
|
|
11
11
|
}>, useQRPHDepositContext: () => {
|
|
12
|
-
view: "
|
|
12
|
+
view: "form" | "qrCode";
|
|
13
13
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
14
14
|
verify: () => void;
|
|
15
15
|
reset: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Deposit } from '../../../../types';
|
|
2
2
|
export type UseQRPHDepositReturn = ReturnType<typeof useQRPHDeposit>;
|
|
3
3
|
export declare function useQRPHDeposit(): {
|
|
4
|
-
view: "
|
|
4
|
+
view: "form" | "qrCode";
|
|
5
5
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
6
6
|
verify: () => void;
|
|
7
7
|
reset: () => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type CSSProperties } from 'react';
|
|
2
|
-
|
|
2
|
+
interface ClassNameEntries {
|
|
3
3
|
root?: string;
|
|
4
4
|
itemRoot?: string;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
interface StyleEntries {
|
|
7
7
|
root?: CSSProperties;
|
|
8
8
|
itemRoot?: CSSProperties;
|
|
9
9
|
}
|
|
@@ -18,3 +18,4 @@ export interface JackpotsCarouselProps {
|
|
|
18
18
|
animate?: boolean;
|
|
19
19
|
}
|
|
20
20
|
export declare function JackpotsCarousel({ style, className, ...props }: JackpotsCarouselProps): import("react/jsx-runtime").JSX.Element | null;
|
|
21
|
+
export {};
|
|
@@ -56,7 +56,9 @@ export function JackpotsCarousel({ style, className, ...props }) {
|
|
|
56
56
|
const jackpots = jackpotsQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
|
|
57
57
|
if (jackpots.length <= 0)
|
|
58
58
|
return null;
|
|
59
|
-
const styles = isStyleEntries(style
|
|
59
|
+
const styles = isStyleEntries(style, ['root', 'itemRoot'])
|
|
60
|
+
? style
|
|
61
|
+
: { root: style };
|
|
60
62
|
const classNames = isString(className)
|
|
61
63
|
? { root: className }
|
|
62
64
|
: (className ?? {});
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import { type ImageProps } from 'next/image';
|
|
2
|
+
import type { CSSProperties } from 'react';
|
|
2
3
|
import type { GameProvider } from '../../../types';
|
|
4
|
+
interface ClassNameEntries {
|
|
5
|
+
root?: string;
|
|
6
|
+
itemRoot?: string;
|
|
7
|
+
}
|
|
8
|
+
interface StyleEntries {
|
|
9
|
+
root?: CSSProperties;
|
|
10
|
+
itemRoot?: CSSProperties;
|
|
11
|
+
}
|
|
3
12
|
export interface JackpotsListProps {
|
|
4
13
|
layout: 'list';
|
|
5
14
|
/** @default "Jackpots" */
|
|
6
15
|
heading?: string;
|
|
7
|
-
className?: string;
|
|
16
|
+
className?: string | ClassNameEntries;
|
|
17
|
+
style?: CSSProperties | StyleEntries;
|
|
8
18
|
gameProviders: GameProvider[];
|
|
9
19
|
gameProviderImages?: Partial<Record<GameProvider, ImageProps['src']>>;
|
|
10
20
|
}
|
|
11
|
-
export declare function JackpotsList(props: JackpotsListProps): import("react/jsx-runtime").JSX.Element | null;
|
|
21
|
+
export declare function JackpotsList({ style, className, ...props }: JackpotsListProps): import("react/jsx-runtime").JSX.Element | null;
|
|
22
|
+
export {};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { isString } from 'lodash-es';
|
|
3
4
|
import Image, {} from 'next/image';
|
|
4
5
|
import { useJackpotsQuery } from '../../../client/hooks/index.js';
|
|
5
6
|
import closeChest from '../../../images/close-chest.png';
|
|
7
|
+
import { isStyleEntries } from '../../../utils/index.js';
|
|
6
8
|
import { JackpotsListItemContext, JackpotsListPropsContext, } from './JackpotsListContext.js';
|
|
7
9
|
import { JackpotsListItemDesktop } from './JackpotsListItemDesktop.js';
|
|
8
10
|
import { JackpotsListItemMobile } from './JackpotsListItemMobile.js';
|
|
9
|
-
export function JackpotsList(props) {
|
|
11
|
+
export function JackpotsList({ style, className, ...props }) {
|
|
10
12
|
const jackpotsQuery = useJackpotsQuery({
|
|
11
13
|
first: 100,
|
|
12
14
|
filter: {
|
|
@@ -25,5 +27,11 @@ export function JackpotsList(props) {
|
|
|
25
27
|
const jackpots = jackpotsQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
|
|
26
28
|
if (jackpots.length <= 0)
|
|
27
29
|
return null;
|
|
28
|
-
|
|
30
|
+
const styles = isStyleEntries(style, ['root', 'itemRoot'])
|
|
31
|
+
? style
|
|
32
|
+
: { root: style };
|
|
33
|
+
const classNames = isString(className)
|
|
34
|
+
? { root: className }
|
|
35
|
+
: (className ?? {});
|
|
36
|
+
return (_jsx(JackpotsListPropsContext, { value: props, children: _jsxs("div", { style: styles.root, className: classNames.root, 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(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotsListItemDesktop, { style: styles.itemRoot, className: classNames.itemRoot }) }, jackpot.id))) }), _jsx("div", { className: "flex flex-col gap-6 lg:hidden", children: jackpots.map((jackpot) => (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotsListItemMobile, { style: styles.itemRoot, className: classNames.itemRoot }) }, 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!"] })] }))] }) }));
|
|
29
37
|
}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
interface JackpotsListItemDesktopProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
style?: CSSProperties;
|
|
5
|
+
}
|
|
6
|
+
export declare function JackpotsListItemDesktop(props: JackpotsListItemDesktopProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -14,10 +14,10 @@ import styles from './JackpotsListItem.module.css';
|
|
|
14
14
|
import { JackpotsListItemGameProviders } from './JackpotsListItemGameProviders.js';
|
|
15
15
|
import { JackpotsListItemRules } from './JackpotsListItemRules.js';
|
|
16
16
|
import { useJackpotsListItemData } from './useJackpotsListItemData.js';
|
|
17
|
-
export function JackpotsListItemDesktop() {
|
|
17
|
+
export function JackpotsListItemDesktop(props) {
|
|
18
18
|
const jackpot = useJackpotsListItemContext();
|
|
19
19
|
const { jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, getAccumulatingJackpotDescription, starTierStyles, } = useJackpotsListItemData();
|
|
20
|
-
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, {
|
|
20
|
+
return (_jsxs("div", { style: props.style, className: twMerge('bg-bg-tertiary border-border-primary rounded-2xl border', props.className), 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
21
|
currency: localeInfo.currency.code,
|
|
22
22
|
minDecimalPlaces: 2,
|
|
23
23
|
maxDecimalPlaces: 2,
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
interface JackpotsListItemMobileProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
style?: CSSProperties;
|
|
5
|
+
}
|
|
6
|
+
export declare function JackpotsListItemMobile(props: JackpotsListItemMobileProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -14,11 +14,11 @@ import styles from './JackpotsListItem.module.css';
|
|
|
14
14
|
import { JackpotsListItemGameProviders } from './JackpotsListItemGameProviders.js';
|
|
15
15
|
import { JackpotsListItemRules } from './JackpotsListItemRules.js';
|
|
16
16
|
import { useJackpotsListItemData } from './useJackpotsListItemData.js';
|
|
17
|
-
export function JackpotsListItemMobile() {
|
|
17
|
+
export function JackpotsListItemMobile(props) {
|
|
18
18
|
const jackpot = useJackpotsListItemContext();
|
|
19
19
|
const { jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, getAccumulatingJackpotDescription, starTierStyles, } = useJackpotsListItemData();
|
|
20
20
|
const [isDetailsVisible, setIsDetailsVisible] = useState(false);
|
|
21
|
-
return (_jsxs("div", { className:
|
|
21
|
+
return (_jsxs("div", { style: props.style, className: twMerge('bg-bg-primary border-border-primary rounded-2xl border', props.className), children: [_jsxs("div", { className: "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, {
|
|
22
22
|
currency: localeInfo.currency.code,
|
|
23
23
|
minDecimalPlaces: 2,
|
|
24
24
|
maxDecimalPlaces: 2,
|
|
@@ -1,9 +1,26 @@
|
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
interface ClassNameEntries {
|
|
3
|
+
root?: string;
|
|
4
|
+
itemRoot?: string;
|
|
5
|
+
itemBadgeRoot?: string;
|
|
6
|
+
itemBadgeLabel?: string;
|
|
7
|
+
itemBadgeIcon?: string;
|
|
8
|
+
}
|
|
9
|
+
interface StyleEntries {
|
|
10
|
+
root?: CSSProperties;
|
|
11
|
+
itemRoot?: CSSProperties;
|
|
12
|
+
itemBadgeRoot?: CSSProperties;
|
|
13
|
+
itemBadgeLabel?: CSSProperties;
|
|
14
|
+
itemBadgeIcon?: CSSProperties;
|
|
15
|
+
}
|
|
1
16
|
export interface TournamentsCarouselProps {
|
|
2
17
|
layout: 'carousel';
|
|
3
18
|
/** @default "Tournaments" */
|
|
4
19
|
heading?: string;
|
|
5
20
|
/** @default "/tournaments" */
|
|
6
21
|
viewAllUrl?: string;
|
|
7
|
-
className?: string;
|
|
22
|
+
className?: string | ClassNameEntries;
|
|
23
|
+
style?: CSSProperties | StyleEntries;
|
|
8
24
|
}
|
|
9
|
-
export declare function TournamentsCarousel(props: TournamentsCarouselProps): import("react/jsx-runtime").JSX.Element | null;
|
|
25
|
+
export declare function TournamentsCarousel({ style, className, ...props }: TournamentsCarouselProps): import("react/jsx-runtime").JSX.Element | null;
|
|
26
|
+
export {};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import useEmblaCarousel from 'embla-carousel-react';
|
|
4
|
+
import { isString } from 'lodash-es';
|
|
4
5
|
import Link from 'next/link';
|
|
5
6
|
import { useCallback, useEffect, useState } from 'react';
|
|
6
7
|
import { useTournamentsQuery } from '../../../client/hooks/index.js';
|
|
7
8
|
import { ArrowLeftIcon, ArrowRightIcon, ChevronRightIcon, } from '../../../icons/index.js';
|
|
8
9
|
import { Button } from '../../../ui/index.js';
|
|
10
|
+
import { isStyleEntries } from '../../../utils/index.js';
|
|
9
11
|
import { TournamentsCarouselItemContext } from './TournamentsCarouselContext.js';
|
|
10
12
|
import { TournamentsCarouselItem } from './TournamentsCarouselItem.js';
|
|
11
|
-
export function TournamentsCarousel(props) {
|
|
13
|
+
export function TournamentsCarousel({ style, className, ...props }) {
|
|
12
14
|
const [emblaRef, emblaApi] = useEmblaCarousel({
|
|
13
15
|
align: 'start',
|
|
14
16
|
slidesToScroll: 1,
|
|
@@ -47,5 +49,27 @@ export function TournamentsCarousel(props) {
|
|
|
47
49
|
const tournaments = tournamentsQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
|
|
48
50
|
if (tournaments.length <= 0)
|
|
49
51
|
return null;
|
|
50
|
-
|
|
52
|
+
const styles = isStyleEntries(style, [
|
|
53
|
+
'root',
|
|
54
|
+
'itemRoot',
|
|
55
|
+
'itemBadgeRoot',
|
|
56
|
+
'itemBadgeLabel',
|
|
57
|
+
'itemBadgeIcon',
|
|
58
|
+
])
|
|
59
|
+
? style
|
|
60
|
+
: { root: style };
|
|
61
|
+
const classNames = isString(className)
|
|
62
|
+
? { root: className }
|
|
63
|
+
: (className ?? {});
|
|
64
|
+
return (_jsxs("div", { className: classNames.root, style: styles.root, children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-lg font-semibold", children: props.heading ?? 'Tournaments' }), _jsxs("div", { className: "flex items-center md:gap-3xl", children: [_jsxs(Link, { href: props.viewAllUrl ?? '/tournaments', className: "text-button-tertiary-fg flex gap-sm text-sm font-semibold", children: ["See All", _jsx(ChevronRightIcon, { className: "size-5 lg:hidden" })] }), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { disabled: !canScrollPrev, onClick: scrollPrev, variant: "outline", colorScheme: "gray", className: "rounded-r-none border-r-0", "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsxs(Button, { disabled: !canScrollNext, onClick: scrollNext, variant: "outline", colorScheme: "gray", className: "rounded-l-none", "aria-label": "Next", children: [_jsx("span", { className: "sr-only", children: "Next" }), _jsx(ArrowRightIcon, { className: "size-5" })] })] })] })] }), _jsx("div", { className: "relative mt-lg lg:overflow-hidden", ref: emblaRef, children: _jsx("div", { className: "flex gap-2.5", children: tournaments.map((tournament) => (_jsx(TournamentsCarouselItemContext, { value: tournament, children: _jsx(TournamentsCarouselItem, { viewAllUrl: props.viewAllUrl, style: {
|
|
65
|
+
root: styles.itemRoot,
|
|
66
|
+
badgeIcon: styles.itemBadgeIcon,
|
|
67
|
+
badgeRoot: styles.itemBadgeRoot,
|
|
68
|
+
badgeLabel: styles.itemBadgeLabel,
|
|
69
|
+
}, className: {
|
|
70
|
+
root: classNames.itemRoot,
|
|
71
|
+
badgeRoot: classNames.itemBadgeRoot,
|
|
72
|
+
badgeLabel: classNames.itemBadgeLabel,
|
|
73
|
+
badgeIcon: classNames.itemBadgeIcon,
|
|
74
|
+
} }) }, tournament.id))) }) })] }));
|
|
51
75
|
}
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
interface ClassNameEntries {
|
|
3
|
+
root?: string;
|
|
4
|
+
badgeRoot?: string;
|
|
5
|
+
badgeLabel?: string;
|
|
6
|
+
badgeIcon?: string;
|
|
7
|
+
}
|
|
8
|
+
interface StyleEntries {
|
|
9
|
+
root?: CSSProperties;
|
|
10
|
+
badgeRoot?: CSSProperties;
|
|
11
|
+
badgeLabel?: CSSProperties;
|
|
12
|
+
badgeIcon?: CSSProperties;
|
|
13
|
+
}
|
|
1
14
|
export interface TournamentsCarouselItemProps {
|
|
2
|
-
|
|
15
|
+
style?: CSSProperties | StyleEntries;
|
|
16
|
+
className?: string | ClassNameEntries;
|
|
3
17
|
/** @default "/tournaments" */
|
|
4
18
|
viewAllUrl?: string;
|
|
5
19
|
}
|
|
6
|
-
export declare function TournamentsCarouselItem({ className, viewAllUrl, }: TournamentsCarouselItemProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function TournamentsCarouselItem({ style, className, viewAllUrl, }: TournamentsCarouselItemProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { pick } from 'lodash-es';
|
|
3
|
+
import { isString, pick } from 'lodash-es';
|
|
4
4
|
import Image from 'next/image';
|
|
5
5
|
import Link from 'next/link';
|
|
6
6
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
@@ -11,10 +11,10 @@ import { StarIcon } from '../../../icons/StarIcon.js';
|
|
|
11
11
|
import firstPlace from '../../../images/first-place.png';
|
|
12
12
|
import trophyTwo from '../../../images/trophy-two.png';
|
|
13
13
|
import trophy from '../../../images/trophy.png';
|
|
14
|
-
import { formatNumber, mask } from '../../../utils/index.js';
|
|
14
|
+
import { formatNumber, isStyleEntries, mask } from '../../../utils/index.js';
|
|
15
15
|
import { useTournamentsCarouselItemContext } from './TournamentsCarouselContext.js';
|
|
16
|
-
import
|
|
17
|
-
export function TournamentsCarouselItem({ className, viewAllUrl, }) {
|
|
16
|
+
import css from './TournamentsCarouselItem.module.css';
|
|
17
|
+
export function TournamentsCarouselItem({ style, className, viewAllUrl, }) {
|
|
18
18
|
const tournament = useTournamentsCarouselItemContext();
|
|
19
19
|
const localeInfo = useLocaleInfo();
|
|
20
20
|
const [timeRemaining, setTimeRemaining] = useState({
|
|
@@ -67,7 +67,18 @@ export function TournamentsCarouselItem({ className, viewAllUrl, }) {
|
|
|
67
67
|
.map(Number)
|
|
68
68
|
.reduce((sum, val) => sum + val, 0);
|
|
69
69
|
const prizeAmountsByRank = Object.values(tournament.rewardSettings).map(Number);
|
|
70
|
-
|
|
70
|
+
const styles = isStyleEntries(style, [
|
|
71
|
+
'root',
|
|
72
|
+
'badgeRoot',
|
|
73
|
+
'badgeLabel',
|
|
74
|
+
'badgeIcon',
|
|
75
|
+
])
|
|
76
|
+
? style
|
|
77
|
+
: { root: style };
|
|
78
|
+
const classNames = isString(className)
|
|
79
|
+
? { root: className }
|
|
80
|
+
: (className ?? {});
|
|
81
|
+
return (_jsxs("div", { className: twMerge('bg-bg-tertiary border-border-primary relative flex w-full shrink-0 rounded-2xl border p-3 text-center lg:gap-6 lg:p-5', classNames.root), style: styles.root, children: [_jsx("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", { className: "w-full", children: [_jsxs("div", { className: "flex w-full justify-between", children: [_jsxs("div", { style: styles.badgeRoot, className: twMerge('border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium', classNames.badgeRoot), children: [_jsx(Award01Icon, { style: styles.badgeIcon, className: twMerge('text-utility-brand-500 size-3.5', classNames.badgeIcon) }), _jsx("span", { style: styles.badgeLabel, className: classNames.badgeLabel, children: "Multiplier" })] }), _jsx("div", { className: "flex h-fit", children: timeParts.map((part, idx) => (_jsxs(React.Fragment, { children: [_jsxs("div", { className: twMerge('bg-bg-primary text-text-primary-900 flex h-fit w-8 flex-col items-center rounded-[4px] pb-1.5'), children: [_jsx("span", { className: "text-base font-medium", children: String(part.value).padStart(2, '0') }), _jsx("span", { className: "text-[8px]", children: part.label })] }), idx < timeParts.length - 1 && (_jsxs("div", { className: "flex flex-col justify-center gap-[6px] px-[6px]", children: [_jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" }), _jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" })] }))] }, part.label))) })] }), _jsxs("div", { className: "flex justify-between", children: [_jsxs("div", { children: [_jsx("div", { className: "text-text-primary-900 mt-2.5 text-left text-lg font-medium lg:mt-5 lg:text-2xl", children: tournament.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(tournamentReward, {
|
|
71
82
|
currency: localeInfo.currency.code,
|
|
72
83
|
minDecimalPlaces: 2,
|
|
73
84
|
maxDecimalPlaces: 2,
|
|
@@ -77,7 +88,7 @@ export function TournamentsCarouselItem({ className, viewAllUrl, }) {
|
|
|
77
88
|
maxDecimalPlaces: 2,
|
|
78
89
|
}) })] })] }) })) : (_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: "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!" })] })] }))] }) }) }) }), _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 items-center gap-2", children: [_jsx(Image, { width: 24, height: 24, src: trophyTwo, quality: 100, alt: "leaderboardIcon", className: "size-full w-6" }), _jsx("div", { className: "text-text-primary-900 text-lg font-semibold", children: tournament.currentLeaderboard.edges.length
|
|
79
90
|
? 'Leaderboard'
|
|
80
|
-
: 'Starting soon!' })] }), _jsxs(Link, { className: "text-button-tertiary-fg flex text-sm font-semibold", href: viewAllUrl ?? '/tournaments', children: ["See details", _jsx(ChevronRightIcon, { className: "size-5" })] })] }), _jsx("div", { className: twMerge('max-h-[272px] overflow-y-scroll',
|
|
91
|
+
: 'Starting soon!' })] }), _jsxs(Link, { className: "text-button-tertiary-fg flex text-sm font-semibold", href: viewAllUrl ?? '/tournaments', children: ["See details", _jsx(ChevronRightIcon, { className: "size-5" })] })] }), _jsx("div", { className: twMerge('max-h-[272px] overflow-y-scroll', css['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: tournament.currentLeaderboard.edges.length ? (_jsx(_Fragment, { children: tournament.currentLeaderboard.edges.map((tournament, 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: mask(tournament.node.username) }), _jsxs("td", { className: "border-border-secondary h-12 border-t-2", children: [tournament.node.multiplier, "x"] }), i + 1 <= prizeAmountsByRank.length ? (_jsx("td", { className: "border-border-secondary text-brand-400 h-12 border-t-2", children: formatNumber(prizeAmountsByRank[i], {
|
|
81
92
|
currency: localeInfo.currency.code,
|
|
82
93
|
minDecimalPlaces: 2,
|
|
83
94
|
maxDecimalPlaces: 2,
|
|
@@ -1,9 +1,26 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
1
2
|
import type { GameProvider } from '../../../types';
|
|
3
|
+
interface ClassNameEntries {
|
|
4
|
+
root?: string;
|
|
5
|
+
itemRoot?: string;
|
|
6
|
+
itemBadgeRoot?: string;
|
|
7
|
+
itemBadgeLabel?: string;
|
|
8
|
+
itemBadgeIcon?: string;
|
|
9
|
+
}
|
|
10
|
+
interface StyleEntries {
|
|
11
|
+
root?: CSSProperties;
|
|
12
|
+
itemRoot?: CSSProperties;
|
|
13
|
+
itemBadgeRoot?: CSSProperties;
|
|
14
|
+
itemBadgeLabel?: CSSProperties;
|
|
15
|
+
itemBadgeIcon?: CSSProperties;
|
|
16
|
+
}
|
|
2
17
|
export interface TournamentsListProps {
|
|
3
18
|
layout: 'list';
|
|
4
19
|
/** @default "Tournaments" */
|
|
5
20
|
heading?: string;
|
|
6
|
-
className?: string;
|
|
21
|
+
className?: string | ClassNameEntries;
|
|
22
|
+
style?: CSSProperties | StyleEntries;
|
|
7
23
|
gameProviders: GameProvider[];
|
|
8
24
|
}
|
|
9
|
-
export declare function TournamentsList(props: TournamentsListProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare function TournamentsList({ style, className, ...props }: TournamentsListProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export {};
|