@opexa/portal-components 0.0.106 → 0.0.108
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/useAuthenticateMutation.js +2 -1
- package/dist/client/hooks/useCheckInDailyCheckInQuestMutation.d.ts +1 -1
- package/dist/client/hooks/useCheckInDailyCheckInQuestMutation.js +20 -2
- package/dist/client/hooks/useClaimCashbackBonusMutation.js +2 -1
- package/dist/client/hooks/useClaimSpotBonusMutation.js +2 -1
- package/dist/client/hooks/useCompleteOnboardingMutation.d.ts +3 -0
- package/dist/client/hooks/useCompleteOnboardingMutation.js +25 -0
- package/dist/client/hooks/useCreateGCashDepositMutation.js +2 -1
- package/dist/client/hooks/useCreateGCashWithdrawalMutation.js +1 -1
- package/dist/client/hooks/useCreateGameSessionMutation.js +1 -1
- package/dist/client/hooks/useCreateInstapayWithdrawalMutation.js +1 -1
- package/dist/client/hooks/useCreateMayaAppDepositMutation.js +2 -1
- package/dist/client/hooks/useCreateMayaAppWithdrawalMutation.js +1 -1
- package/dist/client/hooks/useCreateMayaDepositMutation.js +2 -1
- package/dist/client/hooks/useCreateMayaWithdrawalMutation.js +1 -1
- package/dist/client/hooks/useCreateMemberVerificationMutation.d.ts +4 -0
- package/dist/client/hooks/useCreateMemberVerificationMutation.js +45 -0
- package/dist/client/hooks/useCreateOnlineBankDepositMutation.js +2 -1
- package/dist/client/hooks/useCreateQRPHDepositMutation.js +2 -1
- package/dist/client/hooks/useEndGameSessionMutation.js +1 -1
- package/dist/client/hooks/useFileQuery.d.ts +2 -0
- package/dist/client/hooks/useFileQuery.js +30 -0
- package/dist/client/hooks/useMarkGameAsFavoriteMutation.js +24 -5
- package/dist/client/hooks/useMarkMessageAsReadMutation.js +16 -7
- package/dist/client/hooks/useOnboardingStatusQuery.d.ts +2 -0
- package/dist/client/hooks/useOnboardingStatusQuery.js +28 -0
- package/dist/client/hooks/useRecommendedGamesQuery.d.ts +2 -0
- package/dist/client/hooks/useRecommendedGamesQuery.js +27 -0
- package/dist/client/hooks/useSendVerificationCodeMutation.js +1 -1
- package/dist/client/hooks/useSignInMutation.js +2 -1
- package/dist/client/hooks/useSignOutMutation.js +2 -1
- package/dist/client/hooks/useSignUpMutation.js +1 -1
- package/dist/client/hooks/useSiteQuery.d.ts +2 -0
- package/dist/client/hooks/useSiteQuery.js +16 -0
- package/dist/client/hooks/useSkipOnboardingMutation.d.ts +2 -0
- package/dist/client/hooks/useSkipOnboardingMutation.js +25 -0
- package/dist/client/hooks/useUnmarkGameAsFavoriteMutation.js +5 -5
- package/dist/client/hooks/useUpdateAccountMutation.js +2 -1
- package/dist/client/hooks/useUpdateMemberVerificationMutation.d.ts +6 -0
- package/dist/client/hooks/useUpdateMemberVerificationMutation.js +38 -0
- package/dist/client/hooks/useUploadImageFileMutation.d.ts +4 -0
- package/dist/client/hooks/useUploadImageFileMutation.js +24 -0
- package/dist/client/utils/createContext.js +1 -1
- package/dist/client/utils/createRecipeContext.js +1 -1
- package/dist/components/BetRecords/BetRecords.client.js +1 -1
- package/dist/components/Bonuses/Bonuses.client.js +1 -1
- package/dist/components/Disclaimer/DisclaimerV1.js +1 -1
- package/dist/components/Games/Game.js +1 -1
- package/dist/components/Games/GamesCarousel.client.js +1 -1
- package/dist/components/Games/GamesList.client.js +1 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsList.d.ts +1 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsList.js +1 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.d.ts +2 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.js +3 -3
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.d.ts +2 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.js +2 -2
- package/dist/components/KYC/BasicInformation.js +85 -4
- package/dist/components/KYC/CaptureIdDocument.d.ts +1 -0
- package/dist/components/KYC/CaptureIdDocument.js +11 -0
- package/dist/components/KYC/CaptureSelfie.d.ts +1 -0
- package/dist/components/KYC/CaptureSelfie.js +11 -0
- package/dist/components/KYC/IdentityVerification.js +20 -4
- package/dist/components/KYC/Indicator.js +1 -1
- package/dist/components/KYC/KYC.lazy.js +7 -1
- package/dist/components/KYC/PersonalInformation.js +92 -5
- package/dist/components/KYC/useKYC.d.ts +15 -0
- package/dist/components/KYC/useKYC.js +18 -1
- package/dist/components/Messages/Messages.lazy.js +1 -1
- package/dist/components/News/News.d.ts +10 -0
- package/dist/components/News/News.js +10 -0
- package/dist/components/News/index.d.ts +1 -0
- package/dist/components/News/index.js +1 -0
- package/dist/components/NewsFeed/NewsFeed.d.ts +18 -0
- package/dist/components/NewsFeed/NewsFeed.js +11 -0
- package/dist/components/NewsFeed/index.d.ts +1 -0
- package/dist/components/NewsFeed/index.js +1 -0
- package/dist/components/Promos/PromosCarousel.js +1 -1
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +1 -4
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +28 -25
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestRules.d.ts +6 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestRules.js +15 -0
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +1 -4
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +27 -3
- package/dist/components/Quests/OnboardingQuest/OnboardingQuestRules.d.ts +6 -0
- package/dist/components/Quests/OnboardingQuest/OnboardingQuestRules.js +15 -0
- package/dist/components/Quests/Quests.client.js +22 -7
- package/dist/components/Quests/QuestsContext.d.ts +2 -0
- package/dist/components/Quests/QuestsContext.js +2 -0
- package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +1 -4
- package/dist/components/Quests/WageringQuest/WageringQuest.js +12 -9
- package/dist/components/Quests/WageringQuest/WageringQuestRules.d.ts +7 -0
- package/dist/components/Quests/WageringQuest/WageringQuestRules.js +17 -0
- package/dist/components/Search/Search.lazy.d.ts +8 -0
- package/dist/components/Search/Search.lazy.js +8 -3
- package/dist/components/SignIn/MobileNumberSignIn.js +7 -4
- package/dist/components/SignIn/NameAndPasswordSignIn.js +10 -5
- package/dist/components/SignUp/SignUpForm.js +13 -7
- package/dist/components/TransactionRecords/DepositRecordsTable.js +1 -1
- package/dist/components/TransactionRecords/TransactionRecordsTable.js +1 -1
- package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +1 -1
- package/dist/constants/{endpoints.js → Endpoint.js} +1 -1
- package/dist/constants/index.d.ts +7 -7
- package/dist/constants/index.js +7 -7
- package/dist/server/utils/prefetchAccountQuery.js +5 -2
- package/dist/server/utils/prefetchAvailablePromosQuery.js +5 -2
- package/dist/server/utils/prefetchAvailableQuestsCountQuery.js +5 -2
- package/dist/server/utils/prefetchAvailableQuestsQuery.js +5 -2
- package/dist/server/utils/prefetchBetRecordsQuery.js +5 -2
- package/dist/server/utils/prefetchBonusQuery.js +5 -2
- package/dist/server/utils/prefetchBonusesCountQuery.js +5 -2
- package/dist/server/utils/prefetchBonusesQuery.js +5 -2
- package/dist/server/utils/prefetchCashbackBonusQuery.js +5 -2
- package/dist/server/utils/prefetchCashbackBonusesCountQuery.js +5 -2
- package/dist/server/utils/prefetchCashbackBonusesQuery.js +5 -2
- package/dist/server/utils/prefetchCashbackQuery.js +5 -2
- package/dist/server/utils/prefetchCashbacksQuery.js +5 -2
- package/dist/server/utils/prefetchDepositQuery.js +5 -2
- package/dist/server/utils/prefetchDepositRecordsQuery.js +5 -2
- package/dist/server/utils/prefetchDepositsCountQuery.js +5 -2
- package/dist/server/utils/prefetchFavoriteGamesQuery.js +5 -2
- package/dist/server/utils/prefetchFileQuery.d.ts +1 -0
- package/dist/server/utils/prefetchFileQuery.js +23 -0
- package/dist/server/utils/prefetchGamesQuery.js +5 -2
- package/dist/server/utils/prefetchInstapayBankListQuery.js +5 -2
- package/dist/server/utils/prefetchIsMayaSessionValidQuery.js +5 -2
- package/dist/server/utils/prefetchJackpotsCountQuery.js +5 -2
- package/dist/server/utils/prefetchJackpotsQuery.js +5 -2
- package/dist/server/utils/prefetchMemberVerificationQuery.js +5 -2
- package/dist/server/utils/prefetchOnboardingStatusQuery.d.ts +1 -0
- package/dist/server/utils/prefetchOnboardingStatusQuery.js +24 -0
- package/dist/server/utils/prefetchPaymentSettingsQuery.js +5 -2
- package/dist/server/utils/prefetchPlatformQuery.js +5 -2
- package/dist/server/utils/prefetchProfileCompletionQuery.js +5 -2
- package/dist/server/utils/prefetchPromoQuery.js +5 -2
- package/dist/server/utils/prefetchPromosQuery.js +5 -2
- package/dist/server/utils/prefetchRecommendedGamesQuery.d.ts +1 -0
- package/dist/server/utils/prefetchRecommendedGamesQuery.js +23 -0
- package/dist/server/utils/prefetchSessionQuery.js +6 -3
- package/dist/server/utils/prefetchSiteQuery.d.ts +1 -0
- package/dist/server/utils/prefetchSiteQuery.js +17 -0
- package/dist/server/utils/prefetchTopWinsQuery.js +5 -2
- package/dist/server/utils/prefetchTournamentsCountQuery.js +5 -2
- package/dist/server/utils/prefetchTournamentsQuery.js +5 -2
- package/dist/server/utils/prefetchTransactionRecordsQuery.js +5 -2
- package/dist/server/utils/prefetchUnreadMessagesCountQuery.js +5 -2
- package/dist/server/utils/prefetchWalletQuery.js +5 -2
- package/dist/server/utils/prefetchWithdrawalRecordsQuery.js +5 -2
- package/dist/services/account.d.ts +1 -0
- package/dist/services/account.js +11 -1
- package/dist/services/queries.d.ts +2 -1
- package/dist/services/queries.js +19 -1
- package/dist/styles/theme.css +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Checkbox/checkbox.recipe.js +2 -2
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/Dialog/dialog.recipe.js +1 -1
- package/dist/ui/Menu/Menu.d.ts +144 -144
- package/dist/ui/Menu/menu.recipe.d.ts +8 -8
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.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/callIfFn.d.ts +8 -0
- package/dist/utils/callIfFn.js +8 -0
- package/dist/utils/createPoll.d.ts +1 -0
- package/dist/utils/createPoll.js +1 -0
- package/dist/utils/createSplitProps.d.ts +9 -0
- package/dist/utils/createSplitProps.js +9 -0
- package/dist/utils/log.d.ts +3 -0
- package/dist/utils/log.js +18 -0
- package/dist/utils/mutationKeys.d.ts +29 -0
- package/dist/utils/mutationKeys.js +104 -0
- package/dist/utils/queryKeys.d.ts +5 -24
- package/dist/utils/queryKeys.js +80 -97
- package/package.json +1 -1
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +0 -8
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +0 -9
- package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +0 -9
- package/dist/components/Quests/WageringQuest/WageringQuestModal.js +0 -9
- /package/dist/components/{Empty.d.ts → shared/Empty.d.ts} +0 -0
- /package/dist/components/{Empty.js → shared/Empty.js} +0 -0
- /package/dist/components/{InfiniteScroll.d.ts → shared/InfiniteScroll.d.ts} +0 -0
- /package/dist/components/{InfiniteScroll.js → shared/InfiniteScroll.js} +0 -0
- /package/dist/constants/{endpoints.d.ts → Endpoint.d.ts} +0 -0
- /package/dist/constants/{envVars.d.ts → EnvVar.d.ts} +0 -0
- /package/dist/constants/{envVars.js → EnvVar.js} +0 -0
- /package/dist/constants/{gameProviders.d.ts → GameProvider.d.ts} +0 -0
- /package/dist/constants/{gameProviders.js → GameProvider.js} +0 -0
- /package/dist/constants/{gameTypes.d.ts → GameType.d.ts} +0 -0
- /package/dist/constants/{gameTypes.js → GameType.js} +0 -0
- /package/dist/constants/{headerKeys.d.ts → HeaderKey.d.ts} +0 -0
- /package/dist/constants/{headerKeys.js → HeaderKey.js} +0 -0
- /package/dist/constants/{secretQuestions.d.ts → SecretQuestion.d.ts} +0 -0
- /package/dist/constants/{secretQuestions.js → SecretQuestion.js} +0 -0
- /package/dist/constants/{storageKeys.d.ts → StorageKey.d.ts} +0 -0
- /package/dist/constants/{storageKeys.js → StorageKey.js} +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useControllableState } from '../../../client/hooks/useControllableState.js';
|
|
4
|
+
import { XIcon } from '../../../icons/XIcon.js';
|
|
5
|
+
import { Button } from '../../../ui/Button/index.js';
|
|
6
|
+
import { Dialog } from '../../../ui/Dialog/index.js';
|
|
7
|
+
import { Portal } from '../../../ui/Portal/index.js';
|
|
8
|
+
import { useQuestContext } from '../QuestsContext.js';
|
|
9
|
+
export function WageringQuestModal(props) {
|
|
10
|
+
const quest = useQuestContext();
|
|
11
|
+
const [open, setOpen] = useControllableState({
|
|
12
|
+
value: props.open,
|
|
13
|
+
defaultValue: props.defaultOpen ?? false,
|
|
14
|
+
onChange: props.onOpenChange,
|
|
15
|
+
});
|
|
16
|
+
return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: open, onOpenChange: (details) => setOpen(details.open), closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "min-h-auto mx-auto max-w-[343px] rounded-xl px-4 pb-0 pt-5", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "flex flex-col space-y-5", children: [_jsx("h2", { className: "text-text-primary-900 text-lg font-semibold", children: quest.name }), _jsxs("ol", { className: "text-text-tertiary-600 group list-disc text-wrap pl-4 text-sm font-normal", children: [_jsx("li", { children: "Earn extra rewards just by playing Slots, every bet counts, win or lose!" }), _jsx("li", { children: "Reach the wagering requirement in bets to complete the quest and claim your reward." })] })] }), _jsx("div", { className: "pb-4 pt-6", children: _jsx(Button, { onClick: () => setOpen(false), children: "Ok" }) })] }) })] }) }));
|
|
17
|
+
}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { type ImageProps } from 'next/image';
|
|
2
2
|
import type { GameProvider, GameProviderData, GameType } from '../../types';
|
|
3
|
+
export interface ClassNameEntries {
|
|
4
|
+
root?: string;
|
|
5
|
+
gameThumbnailRoot?: string;
|
|
6
|
+
gameThumbnailTitle?: string;
|
|
7
|
+
providerThumbnailRoot?: string;
|
|
8
|
+
providerThumbnailImage?: string;
|
|
9
|
+
}
|
|
3
10
|
export interface SearchProps {
|
|
11
|
+
className?: string | ClassNameEntries;
|
|
4
12
|
logo: ImageProps['src'];
|
|
5
13
|
gameTypes: GameType[];
|
|
6
14
|
gameProviders: GameProvider[];
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { isString } from 'lodash-es';
|
|
3
4
|
import Image, {} from 'next/image';
|
|
4
5
|
import Link from 'next/link';
|
|
5
6
|
import { useRef, useState } from 'react';
|
|
7
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
8
|
import { useShallow } from 'zustand/shallow';
|
|
7
9
|
import { useGamesQuery } from '../../client/hooks/useGamesQuery.js';
|
|
8
10
|
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
@@ -55,6 +57,9 @@ export function Search(props) {
|
|
|
55
57
|
.replace(':slug', data.slug)
|
|
56
58
|
: `/providers/${data.slug}`;
|
|
57
59
|
};
|
|
60
|
+
const classNames = isString(props.className)
|
|
61
|
+
? { root: props.className }
|
|
62
|
+
: (props.className ?? {});
|
|
58
63
|
return (_jsx(Dialog.Root, { open: globalStore.search.open, onOpenChange: (details) => {
|
|
59
64
|
globalStore.search.setOpen(details.open);
|
|
60
65
|
setSearch('');
|
|
@@ -63,15 +68,15 @@ export function Search(props) {
|
|
|
63
68
|
}, className: "pl-10 pr-16", placeholder: "Search", autoComplete: "off" }), _jsx(Presence, { present: search.length > 0, asChild: true, lazyMount: true, children: _jsx("button", { type: "button", className: "text-text-secondary-700 absolute right-3.5 top-1/2 -translate-y-1/2 font-semibold", onClick: () => {
|
|
64
69
|
setSearch('');
|
|
65
70
|
inputRef.current?.focus();
|
|
66
|
-
}, children: "Clear" }) })] }) }), _jsx("div", { className: "lg:bg-bg-primary lg:border-border-primary mt-2xl p-xl pb-3xl lg:mt-2 lg:rounded-xl lg:border", children: search.length <= 0 ? (_jsx(Alert, { message: "Search for your favorite game or provider." })) : search.length >= 1 && search.length <= 2 ? (_jsx(Alert, { message: "Search requires at least 3 characters." })) : (_jsxs(_Fragment, { children: [empty && _jsx(Alert, { message: "No results found" }), !empty && (_jsxs(_Fragment, { children: [gameProviders.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "text-lg font-semibold", children: "Providers" }), _jsx("div", { className: "mt-3.5 grid grid-cols-3 gap-1.5 lg:grid-cols-9 lg:gap-3.5", children: gameProviders.map((provider) => (_jsx(Link, { href: viewGamesUrl(provider), "aria-label": `View ${provider.name} games`, className:
|
|
71
|
+
}, children: "Clear" }) })] }) }), _jsx("div", { className: "lg:bg-bg-primary lg:border-border-primary mt-2xl p-xl pb-3xl lg:mt-2 lg:rounded-xl lg:border", children: search.length <= 0 ? (_jsx(Alert, { message: "Search for your favorite game or provider." })) : search.length >= 1 && search.length <= 2 ? (_jsx(Alert, { message: "Search requires at least 3 characters." })) : (_jsxs(_Fragment, { children: [empty && _jsx(Alert, { message: "No results found" }), !empty && (_jsxs(_Fragment, { children: [gameProviders.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "text-lg font-semibold", children: "Providers" }), _jsx("div", { className: "mt-3.5 grid grid-cols-3 gap-1.5 lg:grid-cols-9 lg:gap-3.5", children: gameProviders.map((provider) => (_jsx(Link, { href: viewGamesUrl(provider), "aria-label": `View ${provider.name} games`, className: twMerge('bg-gray-800 flex h-14 w-full items-center rounded-md', classNames.providerThumbnailRoot), onClick: () => {
|
|
67
72
|
globalStore.search.setOpen(false);
|
|
68
73
|
}, children: _jsx(Image, { src: props.gameProviderImages?.[provider.id] ??
|
|
69
|
-
provider.logo, alt: "", width: 100, height: 50, className:
|
|
74
|
+
provider.logo, alt: "", width: 100, height: 50, className: twMerge('mx-auto h-auto w-full', classNames.providerThumbnailImage) }) }, provider.id))) })] })), games.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-3xl text-lg font-semibold", children: "Games" }), _jsx("div", { className: "mt-3.5 grid grid-cols-3 gap-1.5 lg:grid-cols-9 lg:gap-3.5", children: games.map((game) => (_jsxs(GameLaunchTrigger, { game: game, className: twMerge('block w-full shadow-sm', classNames.gameThumbnailRoot), onClick: () => {
|
|
70
75
|
globalStore.search.setOpen(false);
|
|
71
76
|
}, children: [_jsx(Image, { src: getGameImageUrl({
|
|
72
77
|
reference: game.reference,
|
|
73
78
|
provider: game.provider,
|
|
74
|
-
}), alt: "", width: 200, height: 200, priority: true, className: "aspect-square w-full rounded-t-md object-cover" }), _jsx("span", { className:
|
|
79
|
+
}), alt: "", width: 200, height: 200, priority: true, className: "aspect-square w-full rounded-t-md object-cover" }), _jsx("span", { className: twMerge('bg-bg-tertiary text-text-primary-brand block w-full truncate rounded-b-md px-2 py-2.5 text-center text-xs font-semibold', classNames.gameThumbnailTitle), children: game.name })] }, game.id))) })] })), _jsx(Presence, { present: gamesQuery.hasNextPage, children: _jsx(Button, { variant: "outline", className: "mx-auto mt-12 w-fit", onClick: () => gamesQuery.fetchNextPage(), children: "Load More" }) })] }))] })) })] }) })] }) }));
|
|
75
80
|
}
|
|
76
81
|
function Alert({ message }) {
|
|
77
82
|
return (_jsxs("div", { className: "py-lg", role: "alert", "aria-live": "polite", children: [_jsx("div", { className: "bg-bg-secondary shadow-xs border-border-primary mx-auto flex size-12 items-center justify-center rounded-lg border", children: _jsx(SearchLgIcon, { className: "text-text-secondary-700 size-6" }) }), _jsx("p", { className: "text-text-secondary-700 mt-4 text-center", children: message })] }));
|
|
@@ -30,7 +30,10 @@ export function MobileNumberSignIn() {
|
|
|
30
30
|
const localeInfo = useLocaleInfo();
|
|
31
31
|
const mobileNumberParser = useMobileNumberParser();
|
|
32
32
|
const Step1Definition = z.object({
|
|
33
|
-
mobileNumber: z
|
|
33
|
+
mobileNumber: z
|
|
34
|
+
.string()
|
|
35
|
+
.min(1, 'Mobile number is required')
|
|
36
|
+
.superRefine((v, ctx) => {
|
|
34
37
|
if (!mobileNumberParser.validate(v)) {
|
|
35
38
|
ctx.addIssue({
|
|
36
39
|
code: z.ZodIssueCode.custom,
|
|
@@ -85,9 +88,9 @@ export function MobileNumberSignIn() {
|
|
|
85
88
|
: 'Failed to send verification code',
|
|
86
89
|
});
|
|
87
90
|
}
|
|
88
|
-
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsx(localeInfo.country.flag, { className: "absolute left-3.5 top-1/2 size-5 shrink-0 -translate-y-1/2" }), _jsx(Field.Input, { className: "pl-11", placeholder: `${localeInfo.mobileNumber.areaCode}${localeInfo.mobileNumber.example}`, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Log In" }), _jsx(Controller, { control: step1Form.control, name: "termsAccepted", render: (o) => (_jsxs(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsx(localeInfo.country.flag, { className: "absolute left-3.5 top-1/2 size-5 shrink-0 -translate-y-1/2" }), _jsx(Field.Input, { className: "pl-11", placeholder: `${localeInfo.mobileNumber.areaCode}${localeInfo.mobileNumber.example}`, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Log In" }), _jsx(Controller, { control: step1Form.control, name: "termsAccepted", render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, className: "mt-xl", children: [_jsxs(Checkbox.Root, { checked: o.field.value, onCheckedChange: (details) => {
|
|
92
|
+
o.field.onChange(details.checked);
|
|
93
|
+
}, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["I am at least 21 years of age and I accept the", ' ', _jsx("span", { className: "text-brand-400 whitespace-nowrap underline underline-offset-2", children: "Terms and Conditions." })] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) })] }), _jsxs("div", { className: "relative mt-6 text-center", children: [_jsx("hr", { className: "-translte-y-1/2 text-text-tertiary-600/50 absolute top-1/2 w-full" }), _jsx("span", { className: "text-text-tertiary-600 bg-bg-primary-alt relative px-md text-center text-sm font-semibold", children: "Log in directly with" })] }), _jsxs("div", { className: "mt-6", children: [_jsxs(Button, { variant: "outline", colorScheme: "gray", onClick: () => {
|
|
91
94
|
dialog.setOpen(false);
|
|
92
95
|
}, className: "border-border-primary bg-bg-primary text-text-secondary-700", children: [_jsx(GoogleIcon, { className: "size-6" }), "Continue with Google"] }), _jsxs(Button, { variant: "outline", colorScheme: "gray", onClick: () => {
|
|
93
96
|
dialog.setOpen(false);
|
|
@@ -70,8 +70,13 @@ export function NameAndPasswordSignIn() {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
}),
|
|
73
|
-
termsAccepted: z.boolean().
|
|
74
|
-
|
|
73
|
+
termsAccepted: z.boolean().superRefine((v, ctx) => {
|
|
74
|
+
if (!v) {
|
|
75
|
+
ctx.addIssue({
|
|
76
|
+
code: z.ZodIssueCode.custom,
|
|
77
|
+
message: 'You must accept the terms and conditions',
|
|
78
|
+
});
|
|
79
|
+
}
|
|
75
80
|
}),
|
|
76
81
|
});
|
|
77
82
|
const form = useForm({
|
|
@@ -112,9 +117,9 @@ export function NameAndPasswordSignIn() {
|
|
|
112
117
|
signInMutation.reset();
|
|
113
118
|
form.setValue('secretAnswer', '');
|
|
114
119
|
},
|
|
115
|
-
}) }), _jsx(Field.ErrorText, { children: form.formState.errors.name?.message })] }), _jsx(Field.Root, { disabled: !!signInMutation.data, invalid: !!form.formState.errors.name, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs("div", { children: [_jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter your password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx("div", { className: "mt-2 flex justify-end", children: _jsx("button", { type: "button", tabIndex: -1, className: "text-button-tertiary-fg text-sm font-semibold", children: "Forgot Password" }) })] }) }), signInMutation.data && (_jsxs(Field.Root, { invalid: !!form.formState.errors.secretAnswer, className: "mt-xl", children: [_jsx(Field.Label, { children: secretQuestion }), _jsx(Field.Input, { placeholder: "Answer the security question", ...form.register('secretAnswer') }), _jsx(Field.ErrorText, { children: form.formState.errors.secretAnswer?.message })] })), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: signInMutation.isPending || authenticateMutation.isPending, children: "Log In" }), _jsx(Controller, { control: form.control, name: "termsAccepted", render: (o) => (_jsxs(
|
|
116
|
-
|
|
117
|
-
|
|
120
|
+
}) }), _jsx(Field.ErrorText, { children: form.formState.errors.name?.message })] }), _jsx(Field.Root, { disabled: !!signInMutation.data, invalid: !!form.formState.errors.name, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs("div", { children: [_jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter your password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx("div", { className: "mt-2 flex justify-end", children: _jsx("button", { type: "button", tabIndex: -1, className: "text-button-tertiary-fg text-sm font-semibold", children: "Forgot Password" }) })] }) }), signInMutation.data && (_jsxs(Field.Root, { invalid: !!form.formState.errors.secretAnswer, className: "mt-xl", children: [_jsx(Field.Label, { children: secretQuestion }), _jsx(Field.Input, { placeholder: "Answer the security question", ...form.register('secretAnswer') }), _jsx(Field.ErrorText, { children: form.formState.errors.secretAnswer?.message })] })), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: signInMutation.isPending || authenticateMutation.isPending, children: "Log In" }), _jsx(Controller, { control: form.control, name: "termsAccepted", render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, className: "mt-xl", children: [_jsxs(Checkbox.Root, { checked: o.field.value, onCheckedChange: (details) => {
|
|
121
|
+
o.field.onChange(details.checked);
|
|
122
|
+
}, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["I am at least 21 years of age and I accept the", ' ', _jsx("span", { className: "text-brand-400 whitespace-nowrap underline underline-offset-2", children: "Terms and Conditions." })] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) })] }), _jsxs("div", { className: "relative mt-6 text-center", children: [_jsx("hr", { className: "-translte-y-1/2 text-text-tertiary-600/50 absolute top-1/2 w-full" }), _jsx("span", { className: "text-text-tertiary-600 bg-bg-primary-alt relative px-md text-center text-sm font-semibold", children: "Log in directly with" })] }), _jsxs("div", { className: "mt-6", children: [_jsxs(Button, { variant: "outline", colorScheme: "gray", onClick: () => {
|
|
118
123
|
dialog.setOpen(false);
|
|
119
124
|
}, className: "border-border-primary bg-bg-primary text-text-secondary-700", children: [_jsx(GoogleIcon, { className: "size-6" }), "Continue with Google"] }), _jsxs(Button, { variant: "outline", colorScheme: "gray", onClick: () => {
|
|
120
125
|
dialog.setOpen(false);
|
|
@@ -4,7 +4,7 @@ import { useDialogContext } from '@ark-ui/react/dialog';
|
|
|
4
4
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
5
5
|
import { ObjectId } from '@opexa/object-id';
|
|
6
6
|
import { useSearchParams } from 'next/navigation';
|
|
7
|
-
import { useState } from 'react';
|
|
7
|
+
import { useRef, useState } from 'react';
|
|
8
8
|
import { Controller, useForm } from 'react-hook-form';
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
import { useShallow } from 'zustand/shallow';
|
|
@@ -71,6 +71,7 @@ export function SignUpForm() {
|
|
|
71
71
|
max: 60,
|
|
72
72
|
duration: 1000 * 60,
|
|
73
73
|
});
|
|
74
|
+
const form2Ref = useRef(null);
|
|
74
75
|
return (_jsxs(_Fragment, { children: [step === 1 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Create an account" }), _jsx("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: "Register instantly and start playing!" }), _jsxs("form", { className: "mt-3xl", onSubmit: step1Form.handleSubmit(async (data) => {
|
|
75
76
|
try {
|
|
76
77
|
await sendVerificationCodeMutation.mutateAsync({
|
|
@@ -87,12 +88,12 @@ export function SignUpForm() {
|
|
|
87
88
|
: 'Failed to send verification code',
|
|
88
89
|
});
|
|
89
90
|
}
|
|
90
|
-
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsx(localeInfo.country.flag, { className: "absolute left-3.5 top-1/2 size-5 shrink-0 -translate-y-1/2" }), _jsx(Field.Input, { className: "pl-11", placeholder: `${localeInfo.mobileNumber.areaCode}${localeInfo.mobileNumber.example}`, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Create Account" }), _jsx(Controller, { control: step1Form.control, name: "termsAccepted", render: (o) => (_jsxs(
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsx(localeInfo.country.flag, { className: "absolute left-3.5 top-1/2 size-5 shrink-0 -translate-y-1/2" }), _jsx(Field.Input, { className: "pl-11", placeholder: `${localeInfo.mobileNumber.areaCode}${localeInfo.mobileNumber.example}`, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Create Account" }), _jsx(Controller, { control: step1Form.control, name: "termsAccepted", render: (o) => (_jsxs(Field.Root, { className: "mt-xl", invalid: o.fieldState.invalid, children: [_jsxs(Checkbox.Root, { checked: o.field.value, onCheckedChange: (details) => {
|
|
92
|
+
o.field.onChange(details.checked);
|
|
93
|
+
}, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["I am at least 21 years of age and I accept the", ' ', _jsx("span", { className: "text-brand-400 whitespace-nowrap underline underline-offset-2", children: "Terms and Conditions." })] }), ' ', _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) })] }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-tertiary-600", children: "Don't have an account?" }), _jsx("button", { type: "submit", className: "text-button-tertiary-fg font-semibold", onClick: () => {
|
|
93
94
|
dialog.setOpen(false);
|
|
94
95
|
signInStore.setOpen(true);
|
|
95
|
-
}, children: "Log In" })] })] })), step === 2 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Check your Phone" }), _jsxs("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: ["We\u2019ve sent a verification code to your mobile number", ' ', _jsx("span", { className: "font-semibold", children: mobileNumberParser.format(step1Form.getValues('mobileNumber')) }), ' ', "via text"] }), _jsxs("form", { className: "mt-5", onSubmit: step2Form.handleSubmit(async ({ verificationCode }) => {
|
|
96
|
+
}, children: "Log In" })] })] })), step === 2 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Check your Phone" }), _jsxs("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: ["We\u2019ve sent a verification code to your mobile number", ' ', _jsx("span", { className: "font-semibold", children: mobileNumberParser.format(step1Form.getValues('mobileNumber')) }), ' ', "via text"] }), _jsxs("form", { ref: form2Ref, className: "mt-5", onSubmit: step2Form.handleSubmit(async ({ verificationCode }) => {
|
|
96
97
|
const id = ObjectId.generate(ObjectType.MemberAccount).toString();
|
|
97
98
|
const { mobileNumber } = step1Form.getValues();
|
|
98
99
|
try {
|
|
@@ -121,13 +122,18 @@ export function SignUpForm() {
|
|
|
121
122
|
step2Form.reset();
|
|
122
123
|
setStep(1);
|
|
123
124
|
}
|
|
124
|
-
catch {
|
|
125
|
+
catch (error) {
|
|
125
126
|
toaster.error({
|
|
126
|
-
title: '
|
|
127
|
+
title: 'Login Failed',
|
|
128
|
+
description: error instanceof Error
|
|
129
|
+
? error.message
|
|
130
|
+
: 'Invalid Verification Code',
|
|
127
131
|
});
|
|
128
132
|
}
|
|
129
133
|
}), children: [_jsx(Controller, { name: "verificationCode", control: step2Form.control, render: (o) => (_jsxs(PinInput.Root, { placeholder: "0", invalid: o.fieldState.invalid, value: o.field.value, onValueChange: (details) => {
|
|
130
134
|
o.field.onChange(details.value);
|
|
135
|
+
}, onValueComplete: () => {
|
|
136
|
+
form2Ref.current?.requestSubmit();
|
|
131
137
|
}, children: [_jsxs(PinInput.Control, { className: "grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md", children: [_jsx(PinInput.Input, { index: 0 }), _jsx(PinInput.Input, { index: 1 }), _jsx(PinInput.Input, { index: 2 }), _jsx("span", { className: "text-text-placeholder-subtle text-2xl font-medium", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: step2Form.formState.isSubmitting, children: "Verify" }), _jsxs("div", { className: "mt-3 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-secondary-700", children: "Didn't recieve the code?" }), _jsx("button", { type: "button", className: "text-button-secondary-fg font-semibold disabled:cursor-not-allowed disabled:opacity-75", disabled: cooldown.cooling, onClick: async () => {
|
|
132
138
|
await sendVerificationCodeMutation.mutateAsync({
|
|
133
139
|
channel: 'SMS',
|
|
@@ -16,7 +16,7 @@ import { IconButton } from '../../ui/IconButton/index.js';
|
|
|
16
16
|
import { Table } from '../../ui/Table/index.js';
|
|
17
17
|
import { capitalize } from '../../utils/capitalize.js';
|
|
18
18
|
import { formatNumber } from '../../utils/formatNumber.js';
|
|
19
|
-
import { Empty } from '../Empty.js';
|
|
19
|
+
import { Empty } from '../shared/Empty.js';
|
|
20
20
|
import { TableFilters } from './TableFilters.js';
|
|
21
21
|
export function DepositRecordsTable() {
|
|
22
22
|
const [timestamp, setTimestamp] = useState();
|
|
@@ -15,7 +15,7 @@ import { IconButton } from '../../ui/IconButton/index.js';
|
|
|
15
15
|
import { Table } from '../../ui/Table/index.js';
|
|
16
16
|
import { capitalize } from '../../utils/capitalize.js';
|
|
17
17
|
import { formatNumber } from '../../utils/formatNumber.js';
|
|
18
|
-
import { Empty } from '../Empty.js';
|
|
18
|
+
import { Empty } from '../shared/Empty.js';
|
|
19
19
|
import { TableFilters } from './TableFilters.js';
|
|
20
20
|
export function TransactionRecordsTable() {
|
|
21
21
|
const [timestamp, setTimestamp] = useState();
|
|
@@ -16,7 +16,7 @@ import { IconButton } from '../../ui/IconButton/index.js';
|
|
|
16
16
|
import { Table } from '../../ui/Table/index.js';
|
|
17
17
|
import { capitalize } from '../../utils/capitalize.js';
|
|
18
18
|
import { formatNumber } from '../../utils/formatNumber.js';
|
|
19
|
-
import { Empty } from '../Empty.js';
|
|
19
|
+
import { Empty } from '../shared/Empty.js';
|
|
20
20
|
import { TableFilters } from './TableFilters.js';
|
|
21
21
|
export function WithdrawalRecordsTable() {
|
|
22
22
|
const [timestamp, setTimestamp] = useState();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
1
|
+
export * from './Endpoint';
|
|
2
|
+
export * from './EnvVar';
|
|
3
|
+
export * from './GameProvider';
|
|
4
|
+
export * from './GameType';
|
|
5
|
+
export * from './HeaderKey';
|
|
6
|
+
export * from './SecretQuestion';
|
|
7
|
+
export * from './StorageKey';
|
package/dist/constants/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
1
|
+
export * from './Endpoint.js';
|
|
2
|
+
export * from './EnvVar.js';
|
|
3
|
+
export * from './GameProvider.js';
|
|
4
|
+
export * from './GameType.js';
|
|
5
|
+
export * from './HeaderKey.js';
|
|
6
|
+
export * from './SecretQuestion.js';
|
|
7
|
+
export * from './StorageKey.js';
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { getMemberAccount } from '../../services/account.js';
|
|
2
2
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
3
|
+
import { log } from '../../utils/log.js';
|
|
3
4
|
import { getAccountQueryKey } from '../../utils/queryKeys.js';
|
|
4
5
|
import { getSession } from '../services/getSession.js';
|
|
5
6
|
export const prefetchAccountQuery = async () => {
|
|
6
7
|
const session = await getSession();
|
|
7
8
|
if (session.status === 'unauthenticated')
|
|
8
9
|
return;
|
|
9
|
-
await getQueryClient()
|
|
10
|
+
await getQueryClient()
|
|
11
|
+
.prefetchQuery({
|
|
10
12
|
queryKey: getAccountQueryKey(),
|
|
11
13
|
queryFn: async ({ signal }) => {
|
|
12
14
|
return await getMemberAccount({
|
|
@@ -16,5 +18,6 @@ export const prefetchAccountQuery = async () => {
|
|
|
16
18
|
},
|
|
17
19
|
});
|
|
18
20
|
},
|
|
19
|
-
})
|
|
21
|
+
})
|
|
22
|
+
.catch(() => log.text("'prefetchAccountQuery' failed", 'error'));
|
|
20
23
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { getAvailablePromos, } from '../../services/wallet.js';
|
|
2
2
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
3
|
+
import { log } from '../../utils/log.js';
|
|
3
4
|
import { getAvailablePromosQueryKey } from '../../utils/queryKeys.js';
|
|
4
5
|
import { getSession } from '../services/getSession.js';
|
|
5
6
|
export const prefetchAvailablePromosQuery = async (input) => {
|
|
6
7
|
const session = await getSession();
|
|
7
8
|
if (session.status === 'unauthenticated')
|
|
8
9
|
return;
|
|
9
|
-
await getQueryClient()
|
|
10
|
+
await getQueryClient()
|
|
11
|
+
.prefetchQuery({
|
|
10
12
|
queryKey: getAvailablePromosQueryKey(input),
|
|
11
13
|
queryFn: async ({ signal }) => {
|
|
12
14
|
return await getAvailablePromos(input, {
|
|
@@ -16,5 +18,6 @@ export const prefetchAvailablePromosQuery = async (input) => {
|
|
|
16
18
|
},
|
|
17
19
|
});
|
|
18
20
|
},
|
|
19
|
-
})
|
|
21
|
+
})
|
|
22
|
+
.catch(() => log.text("'prefetchAvailablePromosQuery' failed", 'error'));
|
|
20
23
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { getAvailableQuestsCount } from '../../services/trigger.js';
|
|
2
2
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
3
|
+
import { log } from '../../utils/log.js';
|
|
3
4
|
import { getAvailableQuestsCountQueryKey } from '../../utils/queryKeys.js';
|
|
4
5
|
import { getSession } from '../services/getSession.js';
|
|
5
6
|
export const prefetchAvailableQuestsCountQuery = async () => {
|
|
6
7
|
const session = await getSession();
|
|
7
8
|
if (session.status === 'unauthenticated')
|
|
8
9
|
return;
|
|
9
|
-
await getQueryClient()
|
|
10
|
+
await getQueryClient()
|
|
11
|
+
.prefetchQuery({
|
|
10
12
|
queryKey: getAvailableQuestsCountQueryKey(),
|
|
11
13
|
queryFn: async ({ signal }) => {
|
|
12
14
|
return await getAvailableQuestsCount({
|
|
@@ -16,5 +18,6 @@ export const prefetchAvailableQuestsCountQuery = async () => {
|
|
|
16
18
|
},
|
|
17
19
|
});
|
|
18
20
|
},
|
|
19
|
-
})
|
|
21
|
+
})
|
|
22
|
+
.catch(() => log.text("'prefetchAvailableQuestsCountQuery' failed", 'error'));
|
|
20
23
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { getAvailableQuests } from '../../services/trigger.js';
|
|
2
2
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
3
|
+
import { log } from '../../utils/log.js';
|
|
3
4
|
import { getAvailableQuestsQueryKey } from '../../utils/queryKeys.js';
|
|
4
5
|
import { getSession } from '../services/getSession.js';
|
|
5
6
|
export const prefetchAvailableQuestsQuery = async () => {
|
|
6
7
|
const session = await getSession();
|
|
7
8
|
if (session.status === 'unauthenticated')
|
|
8
9
|
return;
|
|
9
|
-
await getQueryClient()
|
|
10
|
+
await getQueryClient()
|
|
11
|
+
.prefetchQuery({
|
|
10
12
|
queryKey: getAvailableQuestsQueryKey(),
|
|
11
13
|
queryFn: async ({ signal }) => {
|
|
12
14
|
return await getAvailableQuests({
|
|
@@ -16,5 +18,6 @@ export const prefetchAvailableQuestsQuery = async () => {
|
|
|
16
18
|
},
|
|
17
19
|
});
|
|
18
20
|
},
|
|
19
|
-
})
|
|
21
|
+
})
|
|
22
|
+
.catch(() => log.text("'prefetchAvailableQuestsQuery' failed", 'error'));
|
|
20
23
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { getBetRecords } from '../../services/report.js';
|
|
2
2
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
3
|
+
import { log } from '../../utils/log.js';
|
|
3
4
|
import { getBetRecordsQueryKey } from '../../utils/queryKeys.js';
|
|
4
5
|
import { getSession } from '../services/getSession.js';
|
|
5
6
|
export const prefetchBetRecordsQuery = async (input) => {
|
|
6
7
|
const session = await getSession();
|
|
7
8
|
if (session.status === 'unauthenticated')
|
|
8
9
|
return;
|
|
9
|
-
await getQueryClient()
|
|
10
|
+
await getQueryClient()
|
|
11
|
+
.prefetchInfiniteQuery({
|
|
10
12
|
queryKey: getBetRecordsQueryKey(input),
|
|
11
13
|
queryFn: async ({ signal }) => {
|
|
12
14
|
return await getBetRecords(input, {
|
|
@@ -17,5 +19,6 @@ export const prefetchBetRecordsQuery = async (input) => {
|
|
|
17
19
|
});
|
|
18
20
|
},
|
|
19
21
|
initialPageParam: undefined,
|
|
20
|
-
})
|
|
22
|
+
})
|
|
23
|
+
.catch(() => log.text("'prefetchBetRecordsQuery' failed", 'error'));
|
|
21
24
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { getBonus } from '../../services/wallet.js';
|
|
2
2
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
3
|
+
import { log } from '../../utils/log.js';
|
|
3
4
|
import { getBonusQueryKey } from '../../utils/queryKeys.js';
|
|
4
5
|
import { getSession } from '../services/getSession.js';
|
|
5
6
|
export const prefetchBonusQuery = async (id) => {
|
|
6
7
|
const session = await getSession();
|
|
7
8
|
if (session.status === 'unauthenticated')
|
|
8
9
|
return;
|
|
9
|
-
await getQueryClient()
|
|
10
|
+
await getQueryClient()
|
|
11
|
+
.prefetchQuery({
|
|
10
12
|
queryKey: getBonusQueryKey(id),
|
|
11
13
|
queryFn: async ({ signal }) => {
|
|
12
14
|
const bonus = await getBonus(id, {
|
|
@@ -17,5 +19,6 @@ export const prefetchBonusQuery = async (id) => {
|
|
|
17
19
|
});
|
|
18
20
|
return bonus ?? null;
|
|
19
21
|
},
|
|
20
|
-
})
|
|
22
|
+
})
|
|
23
|
+
.catch(() => log.text("'prefetchBonusQuery' failed", 'error'));
|
|
21
24
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { getBonusesCount } from '../../services/wallet.js';
|
|
2
2
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
3
|
+
import { log } from '../../utils/log.js';
|
|
3
4
|
import { getBonusesCountQueryKey } from '../../utils/queryKeys.js';
|
|
4
5
|
import { getSession } from '../services/getSession.js';
|
|
5
6
|
export const prefetchBonusesCountQuery = async () => {
|
|
6
7
|
const session = await getSession();
|
|
7
8
|
if (session.status === 'unauthenticated')
|
|
8
9
|
return;
|
|
9
|
-
await getQueryClient()
|
|
10
|
+
await getQueryClient()
|
|
11
|
+
.prefetchQuery({
|
|
10
12
|
queryKey: getBonusesCountQueryKey(),
|
|
11
13
|
queryFn: async ({ signal }) => {
|
|
12
14
|
return await getBonusesCount({
|
|
@@ -16,5 +18,6 @@ export const prefetchBonusesCountQuery = async () => {
|
|
|
16
18
|
},
|
|
17
19
|
});
|
|
18
20
|
},
|
|
19
|
-
})
|
|
21
|
+
})
|
|
22
|
+
.catch(() => log.text("'prefetchBonusesCountQuery' failed", 'error'));
|
|
20
23
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { getBonuses } from '../../services/wallet.js';
|
|
2
2
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
3
|
+
import { log } from '../../utils/log.js';
|
|
3
4
|
import { getBonusesQueryKey } from '../../utils/queryKeys.js';
|
|
4
5
|
import { getSession } from '../services/getSession.js';
|
|
5
6
|
export const prefetchBonusesQuery = async () => {
|
|
6
7
|
const session = await getSession();
|
|
7
8
|
if (session.status === 'unauthenticated')
|
|
8
9
|
return;
|
|
9
|
-
await getQueryClient()
|
|
10
|
+
await getQueryClient()
|
|
11
|
+
.prefetchQuery({
|
|
10
12
|
queryKey: getBonusesQueryKey(),
|
|
11
13
|
queryFn: async ({ signal }) => {
|
|
12
14
|
return await getBonuses({
|
|
@@ -16,5 +18,6 @@ export const prefetchBonusesQuery = async () => {
|
|
|
16
18
|
},
|
|
17
19
|
});
|
|
18
20
|
},
|
|
19
|
-
})
|
|
21
|
+
})
|
|
22
|
+
.catch(() => log.text("'prefetchBonusesQuery' failed", 'error'));
|
|
20
23
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { getCashbackBonus } from '../../services/wallet.js';
|
|
2
2
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
3
|
+
import { log } from '../../utils/log.js';
|
|
3
4
|
import { getCashbackBonusQueryKey } from '../../utils/queryKeys.js';
|
|
4
5
|
import { getSession } from '../services/getSession.js';
|
|
5
6
|
export const prefetchCashbackBonusQuery = async (id) => {
|
|
6
7
|
const session = await getSession();
|
|
7
8
|
if (session.status === 'unauthenticated')
|
|
8
9
|
return;
|
|
9
|
-
await getQueryClient()
|
|
10
|
+
await getQueryClient()
|
|
11
|
+
.prefetchQuery({
|
|
10
12
|
queryKey: getCashbackBonusQueryKey(id),
|
|
11
13
|
queryFn: async ({ signal }) => {
|
|
12
14
|
return await getCashbackBonus(id, {
|
|
@@ -16,5 +18,6 @@ export const prefetchCashbackBonusQuery = async (id) => {
|
|
|
16
18
|
},
|
|
17
19
|
});
|
|
18
20
|
},
|
|
19
|
-
})
|
|
21
|
+
})
|
|
22
|
+
.catch(() => log.text("'prefetchCashbackBonusQuery' failed", 'error'));
|
|
20
23
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { getCashbackBonusesCount } from '../../services/wallet.js';
|
|
2
2
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
3
|
+
import { log } from '../../utils/log.js';
|
|
3
4
|
import { getCashbackBonusesCountQueryKey } from '../../utils/queryKeys.js';
|
|
4
5
|
import { getSession } from '../services/getSession.js';
|
|
5
6
|
export const prefetchCashbackBonusesCountQuery = async () => {
|
|
6
7
|
const session = await getSession();
|
|
7
8
|
if (session.status === 'unauthenticated')
|
|
8
9
|
return;
|
|
9
|
-
await getQueryClient()
|
|
10
|
+
await getQueryClient()
|
|
11
|
+
.prefetchQuery({
|
|
10
12
|
queryKey: getCashbackBonusesCountQueryKey(),
|
|
11
13
|
queryFn: async ({ signal }) => {
|
|
12
14
|
return await getCashbackBonusesCount({
|
|
@@ -16,5 +18,6 @@ export const prefetchCashbackBonusesCountQuery = async () => {
|
|
|
16
18
|
},
|
|
17
19
|
});
|
|
18
20
|
},
|
|
19
|
-
})
|
|
21
|
+
})
|
|
22
|
+
.catch(() => log.text("'prefetchCashbackBonusesCountQuery' failed", 'error'));
|
|
20
23
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { getCashbackBonuses } from '../../services/wallet.js';
|
|
2
2
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
3
|
+
import { log } from '../../utils/log.js';
|
|
3
4
|
import { getCashbackBonusesQueryKey } from '../../utils/queryKeys.js';
|
|
4
5
|
import { getSession } from '../services/getSession.js';
|
|
5
6
|
export const prefetchCashbackBonusesQuery = async () => {
|
|
6
7
|
const session = await getSession();
|
|
7
8
|
if (session.status === 'unauthenticated')
|
|
8
9
|
return;
|
|
9
|
-
await getQueryClient()
|
|
10
|
+
await getQueryClient()
|
|
11
|
+
.prefetchQuery({
|
|
10
12
|
queryKey: getCashbackBonusesQueryKey(),
|
|
11
13
|
queryFn: async ({ signal }) => {
|
|
12
14
|
return await getCashbackBonuses({
|
|
@@ -16,5 +18,6 @@ export const prefetchCashbackBonusesQuery = async () => {
|
|
|
16
18
|
},
|
|
17
19
|
});
|
|
18
20
|
},
|
|
19
|
-
})
|
|
21
|
+
})
|
|
22
|
+
.catch(() => log.text("'prefetchCashbackBonusesQuery' failed", 'error'));
|
|
20
23
|
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { getCashback } from '../../services/wallet.js';
|
|
2
2
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
3
|
+
import { log } from '../../utils/log.js';
|
|
3
4
|
import { getCashbackQueryKey } from '../../utils/queryKeys.js';
|
|
4
5
|
export const prefetchCashbackQuery = async (id) => {
|
|
5
|
-
await getQueryClient()
|
|
6
|
+
await getQueryClient()
|
|
7
|
+
.prefetchQuery({
|
|
6
8
|
queryKey: getCashbackQueryKey(id),
|
|
7
9
|
queryFn: async ({ signal }) => {
|
|
8
10
|
const cashback = await getCashback(id, { signal });
|
|
9
11
|
return cashback ?? null;
|
|
10
12
|
},
|
|
11
|
-
})
|
|
13
|
+
})
|
|
14
|
+
.catch(() => log.text("'prefetchCashbackQuery' failed", 'error'));
|
|
12
15
|
};
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { getCashbacks } from '../../services/wallet.js';
|
|
2
2
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
3
|
+
import { log } from '../../utils/log.js';
|
|
3
4
|
import { getCashbacksQueryKey } from '../../utils/queryKeys.js';
|
|
4
5
|
export const prefetchCashbacksQuery = async () => {
|
|
5
|
-
await getQueryClient()
|
|
6
|
+
await getQueryClient()
|
|
7
|
+
.prefetchQuery({
|
|
6
8
|
queryKey: getCashbacksQueryKey(),
|
|
7
9
|
queryFn: async ({ signal }) => {
|
|
8
10
|
return await getCashbacks({
|
|
9
11
|
signal,
|
|
10
12
|
});
|
|
11
13
|
},
|
|
12
|
-
})
|
|
14
|
+
})
|
|
15
|
+
.catch(() => log.text("'prefetchCashbacksQuery' failed", 'error'));
|
|
13
16
|
};
|