@opexa/portal-components 0.0.98 → 0.0.100
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/useAccountQuery.js +3 -3
- package/dist/client/hooks/useAuthenticateMutation.d.ts +1 -1
- package/dist/client/hooks/useAuthenticateMutation.js +3 -2
- package/dist/client/hooks/useAvailablePromosQuery.d.ts +1 -1
- package/dist/client/hooks/useAvailablePromosQuery.js +3 -3
- package/dist/client/hooks/useAvailableQuestsCountQuery.js +3 -3
- package/dist/client/hooks/useAvailableQuestsQuery.js +3 -3
- package/dist/client/hooks/useBetRecordsQuery.d.ts +1 -1
- package/dist/client/hooks/useBetRecordsQuery.js +3 -3
- package/dist/client/hooks/useBonusQuery.js +3 -3
- package/dist/client/hooks/useBonusesCountQuery.js +3 -3
- package/dist/client/hooks/useBonusesQuery.js +3 -3
- package/dist/client/hooks/useCashbackBonusQuery.js +3 -3
- package/dist/client/hooks/useCashbackBonusesCountQuery.js +3 -3
- package/dist/client/hooks/useCashbackBonusesQuery.js +3 -3
- package/dist/client/hooks/useCashbackQuery.js +2 -2
- package/dist/client/hooks/useCashbacksQuery.js +2 -2
- package/dist/client/hooks/useCheckInDailyCheckInQuestMutation.js +3 -3
- package/dist/client/hooks/useClaimCashbackBonusMutation.js +4 -3
- package/dist/client/hooks/useClaimSpotBonusMutation.js +4 -3
- package/dist/client/hooks/useCreateGCashDepositMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateGCashDepositMutation.js +5 -3
- package/dist/client/hooks/useCreateGCashWithdrawalMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateGCashWithdrawalMutation.js +3 -3
- package/dist/client/hooks/useCreateGameSessionMutation.js +5 -3
- package/dist/client/hooks/useCreateInstapayWithdrawalMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateInstapayWithdrawalMutation.js +3 -3
- package/dist/client/hooks/useCreateMayaAppDepositMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateMayaAppDepositMutation.js +5 -3
- package/dist/client/hooks/useCreateMayaAppWithdrawalMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateMayaAppWithdrawalMutation.js +3 -3
- package/dist/client/hooks/useCreateMayaDepositMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateMayaDepositMutation.js +5 -3
- package/dist/client/hooks/useCreateMayaWithdrawalMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateMayaWithdrawalMutation.js +3 -3
- package/dist/client/hooks/useCreateOnlineBankDepositMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateOnlineBankDepositMutation.js +5 -3
- package/dist/client/hooks/useCreateQRPHDepositMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateQRPHDepositMutation.js +5 -3
- package/dist/client/hooks/useDepositQuery.js +3 -3
- package/dist/client/hooks/useDepositRecordsQuery.d.ts +1 -1
- package/dist/client/hooks/useDepositRecordsQuery.js +3 -3
- package/dist/client/hooks/useDepositsCountQuery.js +3 -3
- package/dist/client/hooks/useEndGameSessionMutation.js +4 -3
- package/dist/client/hooks/useFavoriteGamesQuery.js +3 -3
- package/dist/client/hooks/useGamesQuery.d.ts +1 -1
- package/dist/client/hooks/useGamesQuery.js +2 -2
- package/dist/client/hooks/useGlobalStore.d.ts +3 -0
- package/dist/client/hooks/useGlobalStore.js +41 -1
- package/dist/client/hooks/useInstapayBankListQuery.js +3 -3
- package/dist/client/hooks/useIsMayaSessionValidQuery.js +5 -5
- package/dist/client/hooks/useJackpotPayoutsQuery.d.ts +1 -1
- package/dist/client/hooks/useJackpotPayoutsQuery.js +2 -2
- package/dist/client/hooks/useJackpotsCountQuery.d.ts +1 -1
- package/dist/client/hooks/useJackpotsCountQuery.js +2 -2
- package/dist/client/hooks/useJackpotsQuery.d.ts +1 -1
- package/dist/client/hooks/useJackpotsQuery.js +2 -2
- package/dist/client/hooks/useLocaleInfo.d.ts +1 -1
- package/dist/client/hooks/useLocaleInfo.js +1 -1
- package/dist/client/hooks/useMarkGameAsFavoriteMutation.js +4 -3
- package/dist/client/hooks/useMarkMessageAsReadMutation.js +4 -3
- package/dist/client/hooks/useMemberVerificationQuery.js +3 -3
- package/dist/client/hooks/useMessagesQuery.d.ts +1 -1
- package/dist/client/hooks/useMessagesQuery.js +3 -3
- package/dist/client/hooks/usePaymentSettingsQuery.js +3 -3
- package/dist/client/hooks/usePlatformQuery.js +2 -2
- package/dist/client/hooks/useProfileCompletionQuery.js +3 -3
- package/dist/client/hooks/usePromoQuery.js +2 -2
- package/dist/client/hooks/usePromosQuery.js +2 -2
- package/dist/client/hooks/useSendVerificationCodeMutation.d.ts +1 -1
- package/dist/client/hooks/useSendVerificationCodeMutation.js +2 -2
- package/dist/client/hooks/useSessionQuery.js +4 -4
- package/dist/client/hooks/useSignInMutation.d.ts +1 -1
- package/dist/client/hooks/useSignInMutation.js +3 -2
- package/dist/client/hooks/useSignOutMutation.js +3 -2
- package/dist/client/hooks/useSignUpMutation.d.ts +1 -1
- package/dist/client/hooks/useSignUpMutation.js +2 -2
- package/dist/client/hooks/useTopWinsQuery.js +2 -2
- package/dist/client/hooks/useTournamentsCountQuery.d.ts +1 -1
- package/dist/client/hooks/useTournamentsCountQuery.js +2 -2
- package/dist/client/hooks/useTournamentsQuery.d.ts +1 -1
- package/dist/client/hooks/useTournamentsQuery.js +2 -2
- package/dist/client/hooks/useTransactionRecordsQuery.d.ts +1 -1
- package/dist/client/hooks/useTransactionRecordsQuery.js +3 -3
- package/dist/client/hooks/useUnmarkGameAsFavoriteMutation.js +4 -3
- package/dist/client/hooks/useUnreadMessagesCountQuery.d.ts +1 -1
- package/dist/client/hooks/useUnreadMessagesCountQuery.js +3 -3
- package/dist/client/hooks/useUpdateAccountMutation.d.ts +1 -1
- package/dist/client/hooks/useUpdateAccountMutation.js +4 -3
- package/dist/client/hooks/useWalletQuery.js +3 -3
- package/dist/client/hooks/useWithdrawalRecordsQuery.d.ts +1 -1
- package/dist/client/hooks/useWithdrawalRecordsQuery.js +3 -3
- package/dist/client/services/authenticate.d.ts +1 -1
- package/dist/client/services/signIn.d.ts +1 -1
- package/dist/client/utils/createRecipeContext.js +1 -1
- package/dist/client/utils/toaster.d.ts +1 -1
- package/dist/client/utils/toaster.js +1 -1
- package/dist/components/Account/Account.d.ts +3 -23
- package/dist/components/Account/Account.js +10 -115
- package/dist/components/Account/Account.lazy.d.ts +23 -0
- package/dist/components/Account/Account.lazy.js +138 -0
- package/dist/components/Account/AccountTrigger.js +2 -2
- package/dist/components/AccountInfo/AccountInfo.js +10 -4
- package/dist/components/AccountSecurity/AccountSecurity.js +13 -4
- package/dist/components/AccountVerification/AccountVerification.js +12 -3
- package/dist/components/Banner/Banner.d.ts +2 -2
- package/dist/components/Banner/Banner.js +2 -2
- package/dist/components/BetRecords/BetRecords.client.d.ts +7 -0
- package/dist/components/BetRecords/BetRecords.client.js +189 -0
- package/dist/components/BetRecords/BetRecords.d.ts +3 -7
- package/dist/components/BetRecords/BetRecords.js +8 -174
- package/dist/components/Bonus/Bonus.client.d.ts +9 -1
- package/dist/components/Bonus/Bonus.client.js +13 -4
- package/dist/components/Bonus/Bonus.d.ts +2 -9
- package/dist/components/Bonus/Bonus.js +22 -6
- package/dist/components/Bonuses/Bonuses.client.d.ts +9 -1
- package/dist/components/Bonuses/Bonuses.client.js +14 -4
- package/dist/components/Bonuses/Bonuses.d.ts +2 -9
- package/dist/components/Bonuses/Bonuses.js +3 -2
- package/dist/components/Bonuses/BonusesTrigger.js +7 -6
- package/dist/components/Cashback/Cashback.client.d.ts +6 -1
- package/dist/components/Cashback/Cashback.client.js +7 -3
- package/dist/components/Cashback/Cashback.d.ts +2 -6
- package/dist/components/Cashback/Cashback.js +11 -6
- package/dist/components/DepositWithdrawal/AmountChoices.js +5 -3
- package/dist/components/DepositWithdrawal/Deposit/AvailablePromos.js +5 -3
- package/dist/components/DepositWithdrawal/Deposit/Deposit.js +6 -3
- package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +15 -4
- package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.js +15 -4
- package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +15 -4
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositAlert.js +5 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositDetails.js +5 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.js +10 -4
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.js +2 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositAlert.js +5 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositDetails.js +4 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.js +10 -4
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.js +2 -1
- package/dist/components/DepositWithdrawal/DepositWithdrawal.d.ts +1 -1
- package/dist/components/DepositWithdrawal/DepositWithdrawal.js +10 -27
- package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.d.ts +1 -0
- package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.js +36 -0
- package/dist/components/DepositWithdrawal/DepositWithdrawalTrigger.js +5 -2
- package/dist/components/DepositWithdrawal/PaymentMethods.js +4 -3
- package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.js +17 -4
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js +18 -4
- package/dist/components/DepositWithdrawal/Withdrawal/MayaAppWithdrawal/MayaAppWithdrawal.js +15 -4
- package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.js +17 -4
- package/dist/components/DepositWithdrawal/Withdrawal/Withdrawal.js +11 -4
- package/dist/components/Disclaimer/DisclaimerV1.js +2 -1
- package/dist/components/Disclaimer/DisclaimerV2.js +2 -1
- package/dist/components/Disclaimer/ResponsibleGaming.js +2 -1
- package/dist/components/Disclaimer/TermsOfUse.js +3 -2
- package/dist/components/Empty.d.ts +1 -2
- package/dist/components/FavoriteGames/FavoriteGames.client.d.ts +5 -1
- package/dist/components/FavoriteGames/FavoriteGames.client.js +8 -4
- package/dist/components/FavoriteGames/FavoriteGames.d.ts +2 -5
- package/dist/components/FavoriteGames/FavoriteGames.js +2 -2
- package/dist/components/GameLaunch/GameLaunch.d.ts +1 -1
- package/dist/components/GameLaunch/GameLaunch.js +10 -71
- package/dist/components/GameLaunch/GameLaunch.lazy.d.ts +1 -0
- package/dist/components/GameLaunch/GameLaunch.lazy.js +90 -0
- package/dist/components/GameLaunch/GameLaunchTrigger.js +4 -2
- package/dist/components/GameProviders/GameProvidersCarousel.js +5 -3
- package/dist/components/GameProviders/GameProvidersList.js +4 -3
- package/dist/components/Games/Game.js +14 -5
- package/dist/components/Games/GamesCarousel.client.d.ts +24 -1
- package/dist/components/Games/GamesCarousel.client.js +7 -3
- package/dist/components/Games/GamesCarousel.d.ts +2 -23
- package/dist/components/Games/GamesCarousel.js +2 -2
- package/dist/components/Games/GamesContext.js +1 -1
- package/dist/components/Games/GamesList.client.d.ts +19 -1
- package/dist/components/Games/GamesList.client.js +6 -3
- package/dist/components/Games/GamesList.d.ts +2 -18
- package/dist/components/Games/GamesList.js +1 -1
- package/dist/components/GamesSearch/GamesSearch.d.ts +1 -1
- package/dist/components/GamesSearch/GamesSearch.js +10 -4
- package/dist/components/Jackpots/Jackpots.js +1 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.js +6 -4
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselContext.js +1 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.js +9 -3
- package/dist/components/Jackpots/JackpotsList/JackpotsList.js +2 -2
- package/dist/components/Jackpots/JackpotsList/JackpotsListContext.js +1 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.js +8 -2
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemGameProviders.js +3 -2
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.js +12 -3
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemRules.js +2 -2
- package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.d.ts +1 -1
- package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.js +3 -2
- package/dist/components/KYC/Header.js +4 -2
- package/dist/components/KYC/Indicator.js +2 -2
- package/dist/components/KYC/KYC.d.ts +1 -1
- package/dist/components/KYC/KYC.js +10 -22
- package/dist/components/KYC/KYC.lazy.d.ts +1 -0
- package/dist/components/KYC/KYC.lazy.js +26 -0
- package/dist/components/KYC/KYCContext.js +1 -1
- package/dist/components/KYC/KYCTrigger.js +1 -1
- package/dist/components/KYC/Step1.js +3 -2
- package/dist/components/KYC/Step2.js +3 -2
- package/dist/components/KYC/Step3.js +4 -2
- package/dist/components/KYC/Step4.js +3 -2
- package/dist/components/Messages/Message.js +3 -1
- package/dist/components/Messages/MessageContext.js +1 -1
- package/dist/components/Messages/MessagePopup.js +3 -3
- package/dist/components/Messages/MessageTrigger.js +2 -1
- package/dist/components/Messages/Messages.d.ts +3 -13
- package/dist/components/Messages/Messages.js +10 -35
- package/dist/components/Messages/Messages.lazy.d.ts +13 -0
- package/dist/components/Messages/Messages.lazy.js +48 -0
- package/dist/components/Messages/MessagesTrigger.js +7 -4
- package/dist/components/Messages/utils.d.ts +1 -1
- package/dist/components/Messages/utils.js +1 -1
- package/dist/components/PortalProvider/PortalProvider.js +8 -5
- package/dist/components/PortalProvider/Providers.js +1 -1
- package/dist/components/PortalProvider/Snackbar.js +4 -3
- package/dist/components/Promo/Promo.client.d.ts +6 -1
- package/dist/components/Promo/Promo.client.js +7 -3
- package/dist/components/Promo/Promo.d.ts +2 -6
- package/dist/components/Promo/Promo.js +11 -6
- package/dist/components/Promos/Cashback.js +3 -2
- package/dist/components/Promos/Promo.js +3 -2
- package/dist/components/Promos/Promos.js +3 -2
- package/dist/components/Promos/PromosCarousel.js +7 -3
- package/dist/components/Promos/PromosGrid.js +2 -1
- package/dist/components/Protected/Protected.d.ts +1 -2
- package/dist/components/Protected/Protected.js +1 -1
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +10 -5
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +3 -2
- package/dist/components/Quests/Quests.client.d.ts +5 -1
- package/dist/components/Quests/Quests.client.js +2 -2
- package/dist/components/Quests/Quests.d.ts +2 -5
- package/dist/components/Quests/Quests.js +1 -1
- package/dist/components/Quests/WageringQuest/WageringQuest.js +3 -2
- package/dist/components/Quests/WageringQuest/WageringQuestModal.js +3 -2
- package/dist/components/Search/Search.d.ts +3 -21
- package/dist/components/Search/Search.js +10 -64
- package/dist/components/Search/Search.lazy.d.ts +20 -0
- package/dist/components/Search/Search.lazy.js +78 -0
- package/dist/components/Search/SearchTrigger.js +1 -1
- package/dist/components/SignIn/MobileNumberSignIn.js +16 -5
- package/dist/components/SignIn/NameAndPasswordSignIn.js +16 -7
- package/dist/components/SignIn/SignIn.d.ts +3 -7
- package/dist/components/SignIn/SignIn.js +10 -14
- package/dist/components/SignIn/SignIn.lazy.d.ts +7 -0
- package/dist/components/SignIn/SignIn.lazy.js +18 -0
- package/dist/components/SignIn/SignInContext.js +1 -1
- package/dist/components/SignIn/SignInMethod.js +1 -1
- package/dist/components/SignIn/SignInTrigger.js +1 -1
- package/dist/components/SignUp/SignUp.d.ts +3 -7
- package/dist/components/SignUp/SignUp.js +10 -12
- package/dist/components/SignUp/SignUp.lazy.d.ts +7 -0
- package/dist/components/SignUp/SignUp.lazy.js +16 -0
- package/dist/components/SignUp/SignUpForm.js +15 -5
- package/dist/components/SignUp/SignUpTrigger.js +1 -1
- package/dist/components/TopWins/TopWins.client.d.ts +5 -1
- package/dist/components/TopWins/TopWins.client.js +8 -3
- package/dist/components/TopWins/TopWins.d.ts +2 -5
- package/dist/components/TopWins/TopWins.js +1 -1
- package/dist/components/Tournaments/Tournaments.js +1 -1
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarousel.js +6 -4
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselContext.js +1 -1
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.js +8 -3
- package/dist/components/Tournaments/TournamentsList/TournamentsList.js +2 -2
- package/dist/components/Tournaments/TournamentsList/TournamentsListContext.js +1 -1
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemDesktop.js +7 -2
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemGameProviders.js +3 -2
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemMobile.js +10 -3
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemRules.js +3 -2
- package/dist/components/Tournaments/TournamentsList/useTournamentListItemData.d.ts +1 -1
- package/dist/components/Tournaments/TournamentsList/useTournamentListItemData.js +1 -1
- package/dist/components/TransactionRecords/DepositRecordsTable.js +12 -4
- package/dist/components/TransactionRecords/TableFilters.js +9 -4
- package/dist/components/TransactionRecords/TransactionRecords.d.ts +1 -1
- package/dist/components/TransactionRecords/TransactionRecords.js +7 -2
- package/dist/components/TransactionRecords/TransactionRecordsTable.js +11 -4
- package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +12 -4
- package/dist/constants/endpoints.js +2 -2
- package/dist/handlers.js +1 -1
- package/dist/middleware.js +1 -1
- package/dist/server/services/authenticate.d.ts +1 -1
- package/dist/server/services/authenticate.js +1 -1
- package/dist/server/services/signIn.d.ts +1 -1
- package/dist/server/services/signIn.js +1 -1
- package/dist/server/services/signOut.js +1 -1
- package/dist/server/utils/prefetchAccountQuery.js +3 -2
- package/dist/server/utils/prefetchAvailablePromosQuery.d.ts +1 -1
- package/dist/server/utils/prefetchAvailablePromosQuery.js +3 -2
- package/dist/server/utils/prefetchAvailableQuestsCountQuery.js +3 -2
- package/dist/server/utils/prefetchAvailableQuestsQuery.js +3 -2
- package/dist/server/utils/prefetchBetRecordsQuery.d.ts +1 -1
- package/dist/server/utils/prefetchBetRecordsQuery.js +3 -2
- package/dist/server/utils/prefetchBonusQuery.js +3 -2
- package/dist/server/utils/prefetchBonusesCountQuery.js +3 -2
- package/dist/server/utils/prefetchBonusesQuery.js +3 -2
- package/dist/server/utils/prefetchCashbackBonusQuery.js +3 -2
- package/dist/server/utils/prefetchCashbackBonusesCountQuery.js +4 -3
- package/dist/server/utils/prefetchCashbackBonusesQuery.js +4 -3
- package/dist/server/utils/prefetchCashbackQuery.js +3 -2
- package/dist/server/utils/prefetchCashbacksQuery.js +3 -2
- package/dist/server/utils/prefetchDepositQuery.js +3 -2
- package/dist/server/utils/prefetchDepositRecordsQuery.d.ts +1 -1
- package/dist/server/utils/prefetchDepositRecordsQuery.js +3 -2
- package/dist/server/utils/prefetchDepositsCountQuery.js +3 -2
- package/dist/server/utils/prefetchFavoriteGamesQuery.js +4 -3
- package/dist/server/utils/prefetchGamesQuery.d.ts +1 -1
- package/dist/server/utils/prefetchGamesQuery.js +3 -2
- package/dist/server/utils/prefetchInstapayBankListQuery.js +3 -2
- package/dist/server/utils/prefetchIsMayaSessionValidQuery.js +3 -2
- package/dist/server/utils/prefetchJackpotsCountQuery.d.ts +1 -1
- package/dist/server/utils/prefetchJackpotsCountQuery.js +3 -2
- package/dist/server/utils/prefetchJackpotsQuery.d.ts +1 -1
- package/dist/server/utils/prefetchJackpotsQuery.js +3 -2
- package/dist/server/utils/prefetchMemberVerificationQuery.js +3 -2
- package/dist/server/utils/prefetchPaymentSettingsQuery.js +3 -2
- package/dist/server/utils/prefetchPlatformQuery.js +3 -2
- package/dist/server/utils/prefetchProfileCompletionQuery.js +3 -2
- package/dist/server/utils/prefetchPromoQuery.js +3 -2
- package/dist/server/utils/prefetchPromosQuery.js +3 -2
- package/dist/server/utils/prefetchSessionQuery.js +2 -1
- package/dist/server/utils/prefetchTopWinsQuery.js +3 -2
- package/dist/server/utils/prefetchTournamentsCountQuery.d.ts +1 -1
- package/dist/server/utils/prefetchTournamentsCountQuery.js +3 -2
- package/dist/server/utils/prefetchTournamentsQuery.d.ts +1 -1
- package/dist/server/utils/prefetchTournamentsQuery.js +3 -2
- package/dist/server/utils/prefetchTransactionRecordsQuery.d.ts +1 -1
- package/dist/server/utils/prefetchTransactionRecordsQuery.js +3 -2
- package/dist/server/utils/prefetchUnreadMessagesCountQuery.d.ts +1 -1
- package/dist/server/utils/prefetchUnreadMessagesCountQuery.js +3 -2
- package/dist/server/utils/prefetchWalletQuery.js +3 -2
- package/dist/server/utils/prefetchWithdrawalRecordsQuery.d.ts +1 -1
- package/dist/server/utils/prefetchWithdrawalRecordsQuery.js +3 -2
- package/dist/services/account.d.ts +341 -0
- package/dist/services/account.js +233 -0
- package/dist/services/auth.d.ts +80 -0
- package/dist/services/auth.js +152 -0
- package/dist/services/cmsPortal.d.ts +43 -0
- package/dist/services/cmsPortal.js +148 -0
- package/dist/services/file.d.ts +33 -0
- package/dist/services/file.js +18 -0
- package/dist/services/game.d.ts +44 -0
- package/dist/services/game.js +33 -0
- package/dist/services/graphqlRequest.js +0 -16
- package/dist/services/httpRequest.js +0 -10
- package/dist/services/portal.d.ts +37 -0
- package/dist/services/portal.js +44 -0
- package/dist/services/report.d.ts +223 -0
- package/dist/services/report.js +72 -0
- package/dist/services/trigger.d.ts +94 -0
- package/dist/services/trigger.js +88 -0
- package/dist/services/wallet.d.ts +475 -0
- package/dist/services/wallet.js +365 -0
- package/dist/ui/AlertDialog/AlertDialog.d.ts +154 -154
- package/dist/ui/AlertDialog/AlertDialog.js +1 -1
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +14 -14
- package/dist/ui/AlertDialog/alertDialog.recipe.js +1 -1
- package/dist/ui/Avatar/Avatar.js +1 -1
- package/dist/ui/Avatar/avatar.recipe.js +1 -1
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/Badge.js +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Badge/badge.recipe.js +1 -1
- package/dist/ui/Button/Button.js +2 -1
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/Checkbox.js +1 -1
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Checkbox/checkbox.recipe.js +1 -1
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/Clipboard.js +1 -1
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/clipboard.recipe.js +1 -1
- package/dist/ui/Collapsible/Collapsible.d.ts +32 -32
- package/dist/ui/Collapsible/Collapsible.js +1 -1
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +8 -8
- package/dist/ui/Collapsible/collapsible.recipe.js +1 -1
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/Combobox.js +1 -1
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/Combobox/combobox.recipe.js +1 -1
- package/dist/ui/DatePicker/DatePicker.d.ts +336 -336
- package/dist/ui/DatePicker/DatePicker.js +1 -1
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +14 -14
- package/dist/ui/DatePicker/datePicker.recipe.js +1 -1
- package/dist/ui/Dialog/Dialog.d.ts +154 -154
- package/dist/ui/Dialog/Dialog.js +1 -1
- package/dist/ui/Dialog/dialog.recipe.d.ts +14 -14
- package/dist/ui/Dialog/dialog.recipe.js +1 -1
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/Drawer.js +1 -1
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Drawer/drawer.recipe.js +1 -1
- package/dist/ui/Field/Field.d.ts +21 -21
- package/dist/ui/Field/Field.js +1 -1
- package/dist/ui/Field/field.recipe.d.ts +3 -3
- package/dist/ui/Field/field.recipe.js +1 -1
- package/dist/ui/IconButton/IconButton.js +2 -1
- package/dist/ui/NumberInput/NumberInput.js +1 -1
- package/dist/ui/NumberInput/numberInput.recipe.js +1 -1
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/PasswordInput.js +1 -1
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/PasswordInput/passwordInput.recipe.js +1 -1
- package/dist/ui/PinInput/PinInput.js +1 -1
- package/dist/ui/PinInput/pinInput.recipe.js +1 -1
- package/dist/ui/Popover/Popover.d.ts +121 -121
- package/dist/ui/Popover/Popover.js +1 -1
- package/dist/ui/Popover/popover.recipe.d.ts +11 -11
- package/dist/ui/Popover/popover.recipe.js +1 -1
- package/dist/ui/Presence.d.ts +1 -1
- package/dist/ui/Presence.js +1 -1
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/Progress.js +1 -1
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/Progress/progress.recipe.js +1 -1
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/SegmentGroup.js +1 -1
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/SegmentGroup/segmentGroup.recipe.js +1 -1
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/Select.js +1 -1
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Select/select.recipe.js +1 -1
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/Table.js +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/ui/Table/table.recipe.js +1 -1
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/Tabs.js +1 -1
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/dist/ui/Tabs/tabs.recipe.js +1 -1
- package/dist/utils/getQueryClient.js +2 -2
- package/dist/utils/onMobileDevice.d.ts +5 -0
- package/dist/utils/onMobileDevice.js +9 -0
- package/dist/utils/queryKeys.d.ts +4 -1
- package/package.json +29 -30
- package/dist/client/hooks/index.d.ts +0 -70
- package/dist/client/hooks/index.js +0 -70
- package/dist/client/services/index.d.ts +0 -4
- package/dist/client/services/index.js +0 -4
- package/dist/client/utils/index.d.ts +0 -3
- package/dist/client/utils/index.js +0 -3
- package/dist/components/JackpotCounter/JackpotCounter.client.d.ts +0 -2
- package/dist/components/JackpotCounter/JackpotCounter.client.js +0 -66
- package/dist/components/JackpotCounter/JackpotCounter.d.ts +0 -17
- package/dist/components/JackpotCounter/JackpotCounter.js +0 -21
- package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +0 -18
- package/dist/components/JackpotCounter/JackpotCounterItem.js +0 -109
- package/dist/components/JackpotCounter/JackpotCounterItem.module.css +0 -184
- package/dist/components/JackpotCounter/index.d.ts +0 -1
- package/dist/components/JackpotCounter/index.js +0 -1
- package/dist/components/Jackpots/JackpotDesktop.d.ts +0 -1
- package/dist/components/Jackpots/JackpotDesktop.js +0 -45
- package/dist/components/Jackpots/JackpotGameProviders.d.ts +0 -5
- package/dist/components/Jackpots/JackpotGameProviders.js +0 -41
- package/dist/components/Jackpots/JackpotMobile.d.ts +0 -1
- package/dist/components/Jackpots/JackpotMobile.js +0 -46
- package/dist/components/Jackpots/JackpotRules.d.ts +0 -5
- package/dist/components/Jackpots/JackpotRules.js +0 -11
- package/dist/components/Jackpots/Jackpots.client.d.ts +0 -2
- package/dist/components/Jackpots/Jackpots.client.js +0 -29
- package/dist/components/Jackpots/JackpotsContext.d.ts +0 -4
- package/dist/components/Jackpots/JackpotsContext.js +0 -3
- package/dist/components/Jackpots/useJackpotData.d.ts +0 -14
- package/dist/components/Jackpots/useJackpotData.js +0 -92
- package/dist/components/PortalProvider/WebVitals.d.ts +0 -1
- package/dist/components/PortalProvider/WebVitals.js +0 -8
- package/dist/components/TournamentCounter/TournamentCounter.client.d.ts +0 -2
- package/dist/components/TournamentCounter/TournamentCounter.client.js +0 -50
- package/dist/components/TournamentCounter/TournamentCounter.d.ts +0 -8
- package/dist/components/TournamentCounter/TournamentCounter.js +0 -21
- package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +0 -8
- package/dist/components/TournamentCounter/TournamentCounterItem.js +0 -106
- package/dist/components/TournamentCounter/index.d.ts +0 -1
- package/dist/components/TournamentCounter/index.js +0 -1
- package/dist/components/Tournaments/TournamentDesktop.d.ts +0 -1
- package/dist/components/Tournaments/TournamentDesktop.js +0 -57
- package/dist/components/Tournaments/TournamentGameProviders.d.ts +0 -5
- package/dist/components/Tournaments/TournamentGameProviders.js +0 -38
- package/dist/components/Tournaments/TournamentMobile.d.ts +0 -1
- package/dist/components/Tournaments/TournamentMobile.js +0 -55
- package/dist/components/Tournaments/TournamentRules.d.ts +0 -5
- package/dist/components/Tournaments/TournamentRules.js +0 -11
- package/dist/components/Tournaments/Tournaments.client.d.ts +0 -2
- package/dist/components/Tournaments/Tournaments.client.js +0 -20
- package/dist/components/Tournaments/TournamentsContext.d.ts +0 -4
- package/dist/components/Tournaments/TournamentsContext.js +0 -3
- package/dist/components/Tournaments/useTournamentData.d.ts +0 -10
- package/dist/components/Tournaments/useTournamentData.js +0 -71
- package/dist/components/index.d.ts +0 -31
- package/dist/components/index.js +0 -31
- package/dist/icons/index.d.ts +0 -66
- package/dist/icons/index.js +0 -66
- package/dist/server/services/index.d.ts +0 -4
- package/dist/server/services/index.js +0 -4
- package/dist/server/utils/index.d.ts +0 -34
- package/dist/server/utils/index.js +0 -34
- package/dist/services/ObjectId.d.ts +0 -10
- package/dist/services/ObjectId.js +0 -72
- package/dist/services/index.d.ts +0 -13
- package/dist/services/index.js +0 -13
- package/dist/ui/index.d.ts +0 -26
- package/dist/ui/index.js +0 -26
- package/dist/utils/index.d.ts +0 -18
- package/dist/utils/index.js +0 -18
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { GoogleAnalytics, GoogleTagManager } from '@next/third-parties/google';
|
|
3
3
|
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
|
|
4
|
-
import { prefetchAccountQuery
|
|
4
|
+
import { prefetchAccountQuery } from '../../server/utils/prefetchAccountQuery.js';
|
|
5
|
+
import { prefetchPlatformQuery } from '../../server/utils/prefetchPlatformQuery.js';
|
|
6
|
+
import { prefetchSessionQuery } from '../../server/utils/prefetchSessionQuery.js';
|
|
7
|
+
import { prefetchWalletQuery } from '../../server/utils/prefetchWalletQuery.js';
|
|
5
8
|
import { FacebookPixel, GoogleRecaptcha } from '../../third-parties/index.js';
|
|
6
|
-
import { getQueryClient } from '../../utils/
|
|
9
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
7
10
|
import { Providers } from './Providers.js';
|
|
8
11
|
import { Snackbar } from './Snackbar.js';
|
|
9
|
-
import { WebVitals } from './WebVitals.js';
|
|
10
12
|
export async function PortalProvider({ children, facebookPixelId, googleAnalyticsId, googleTagManagerId, googleRecaptchaSiteKey, }) {
|
|
11
13
|
const queryClient = getQueryClient();
|
|
12
|
-
await Promise.
|
|
14
|
+
await Promise.allSettled([
|
|
15
|
+
prefetchPlatformQuery(),
|
|
13
16
|
prefetchSessionQuery(),
|
|
14
17
|
prefetchAccountQuery(),
|
|
15
18
|
prefetchWalletQuery(),
|
|
16
19
|
]);
|
|
17
|
-
return (_jsxs(_Fragment, { children: [_jsx(Providers, { children: _jsx(HydrationBoundary, { state: dehydrate(queryClient), children: children }) }), _jsx(Snackbar, {}),
|
|
20
|
+
return (_jsxs(_Fragment, { children: [_jsx(Providers, { children: _jsx(HydrationBoundary, { state: dehydrate(queryClient), children: children }) }), _jsx(Snackbar, {}), facebookPixelId && _jsx(FacebookPixel, { fbId: facebookPixelId }), googleAnalyticsId && _jsx(GoogleAnalytics, { gaId: googleAnalyticsId }), googleTagManagerId && _jsx(GoogleTagManager, { gtmId: googleTagManagerId }), googleRecaptchaSiteKey && (_jsx(GoogleRecaptcha, { siteKey: googleRecaptchaSiteKey }))] }));
|
|
18
21
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { QueryClientProvider } from '@tanstack/react-query';
|
|
4
|
-
import { getQueryClient } from '../../utils/
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
5
|
export function Providers({ children }) {
|
|
6
6
|
const queryClient = getQueryClient();
|
|
7
7
|
return (_jsx(QueryClientProvider, { client: queryClient, children: children }));
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Toast, Toaster } from '@ark-ui/react';
|
|
3
|
+
import { Toast, Toaster } from '@ark-ui/react/toast';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
|
-
import { toaster } from '../../client/utils/
|
|
6
|
-
import { AlertCircleIcon
|
|
5
|
+
import { toaster } from '../../client/utils/toaster.js';
|
|
6
|
+
import { AlertCircleIcon } from '../../icons/AlertCircleIcon.js';
|
|
7
|
+
import { XIcon } from '../../icons/XIcon.js';
|
|
7
8
|
export function Snackbar() {
|
|
8
9
|
return (_jsx(Toaster, { toaster: toaster, children: (toast) => (_jsxs(Toast.Root, { className: twMerge('group', 'p-xl', 'border', 'border-border-primary', 'bg-bg-primary-alt', 'flex', 'items-start', 'gap-lg', 'w-[21.438rem]', 'lg:w-[1200px]', 'max-w-full', 'rounded-xl', 'shadow-xs', 'h-[var(--height)]', 'z-[var(--z-index)]', 'scale-[var(--scale)]', 'opacity-[var(--opacity)]', '[translate:var(--x)_var(--y)_0]', 'transition-all', 'duration-300'), children: [_jsxs("div", { className: "flex grow flex-col gap-xl lg:flex-row lg:gap-lg", children: [_jsx("div", { className: twMerge('flex', 'items-center', 'justify-center', 'size-9.5', 'border-2', 'rounded-full', toast.type === 'success' && 'border-text-success-primary/15', toast.type === 'warning' && 'border-text-warning-primary/15', toast.type === 'error' && 'border-text-error-primary/15'), children: _jsx("div", { className: twMerge('flex', 'items-center', 'justify-center', 'size-7', 'border-2', 'rounded-full', toast.type === 'success' && 'border-text-success-primary/35', toast.type === 'warning' && 'border-text-warning-primary/35', toast.type === 'error' && 'border-text-error-primary/35'), children: _jsx(AlertCircleIcon, { className: twMerge('size-5', toast.type === 'success' && 'text-text-success-primary', toast.type === 'warning' && 'text-text-warning-primary', toast.type === 'error' && 'text-text-error-primary') }) }) }), _jsxs("div", { className: "grow text-sm leading-none", children: [_jsx(Toast.Title, { className: "text-text-secondary-700 font-semibold", children: toast.title
|
|
9
10
|
? toast.title
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
export interface PromoProps {
|
|
2
|
+
id: string;
|
|
3
|
+
/** @default '/promos' */
|
|
4
|
+
viewAllPromosUrl?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
2
7
|
export declare function Promo__client(props: PromoProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -5,9 +5,13 @@ import { format } from 'date-fns';
|
|
|
5
5
|
import Image from 'next/image';
|
|
6
6
|
import Link from 'next/link';
|
|
7
7
|
import { useShallow } from 'zustand/shallow';
|
|
8
|
-
import { useAvailablePromosQuery
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { useAvailablePromosQuery } from '../../client/hooks/useAvailablePromosQuery.js';
|
|
9
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
10
|
+
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
11
|
+
import { usePromoQuery } from '../../client/hooks/usePromoQuery.js';
|
|
12
|
+
import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
|
|
13
|
+
import { Button } from '../../ui/Button/index.js';
|
|
14
|
+
import { Prose } from '../../ui/Prose.js';
|
|
11
15
|
export function Promo__client(props) {
|
|
12
16
|
const localeInfo = useLocaleInfo();
|
|
13
17
|
const availablePromosQuery = useAvailablePromosQuery();
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
id: string;
|
|
3
|
-
/** @default '/promos' */
|
|
4
|
-
viewAllPromosUrl?: string;
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
1
|
+
import { type PromoProps } from './Promo.client';
|
|
7
2
|
export declare function Promo(props: PromoProps): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
3
|
+
export type { PromoProps };
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { notFound } from 'next/navigation';
|
|
3
|
-
import { prefetchPromoQuery } from '../../server/utils/
|
|
4
|
-
import {
|
|
3
|
+
import { prefetchPromoQuery } from '../../server/utils/prefetchPromoQuery.js';
|
|
4
|
+
import { getPromo } from '../../services/wallet.js';
|
|
5
5
|
import { Promo__client } from './Promo.client.js';
|
|
6
6
|
export async function Promo(props) {
|
|
7
|
-
await
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const [result] = await Promise.allSettled([
|
|
8
|
+
getPromo(props.id),
|
|
9
|
+
prefetchPromoQuery(props.id),
|
|
10
|
+
]);
|
|
11
|
+
if (result.status === 'fulfilled' && result.value) {
|
|
12
|
+
return _jsx(Promo__client, { ...props });
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
10
15
|
return notFound();
|
|
11
|
-
|
|
16
|
+
}
|
|
12
17
|
}
|
|
@@ -2,8 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import Image from 'next/image';
|
|
3
3
|
import Link from 'next/link';
|
|
4
4
|
import { useShallow } from 'zustand/shallow';
|
|
5
|
-
import { useAvailablePromosQuery
|
|
6
|
-
import {
|
|
5
|
+
import { useAvailablePromosQuery } from '../../client/hooks/useAvailablePromosQuery.js';
|
|
6
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
7
|
+
import { Button } from '../../ui/Button/index.js';
|
|
7
8
|
export function Cashback({ data, viewDetailsUrl = '/promos/cashback', }) {
|
|
8
9
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
9
10
|
depositWithdrawal: ctx.depositWithdrawal,
|
|
@@ -2,8 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import Image from 'next/image';
|
|
3
3
|
import Link from 'next/link';
|
|
4
4
|
import { useShallow } from 'zustand/shallow';
|
|
5
|
-
import { useAvailablePromosQuery
|
|
6
|
-
import {
|
|
5
|
+
import { useAvailablePromosQuery } from '../../client/hooks/useAvailablePromosQuery.js';
|
|
6
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
7
|
+
import { Button } from '../../ui/Button/index.js';
|
|
7
8
|
export function Promo({ data, viewDetailsUrl = '/promos' }) {
|
|
8
9
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
9
10
|
depositWithdrawal: ctx.depositWithdrawal,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { prefetchCashbacksQuery
|
|
2
|
+
import { prefetchCashbacksQuery } from '../../server/utils/prefetchCashbacksQuery.js';
|
|
3
|
+
import { prefetchPromosQuery } from '../../server/utils/prefetchPromosQuery.js';
|
|
3
4
|
import { PromosCarousel } from './PromosCarousel.js';
|
|
4
5
|
import { PromosGrid } from './PromosGrid.js';
|
|
5
6
|
export async function Promos(props) {
|
|
6
|
-
await Promise.
|
|
7
|
+
await Promise.allSettled([prefetchPromosQuery(), prefetchCashbacksQuery()]);
|
|
7
8
|
if (props.layout === 'grid') {
|
|
8
9
|
return _jsx(PromosGrid, { ...props });
|
|
9
10
|
}
|
|
@@ -4,9 +4,13 @@ import useEmblaCarousel, {} from 'embla-carousel-react';
|
|
|
4
4
|
import Link from 'next/link';
|
|
5
5
|
import { useCallback, useEffect, useState } from 'react';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
|
-
import { useCashbacksQuery
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { useCashbacksQuery } from '../../client/hooks/useCashbacksQuery.js';
|
|
8
|
+
import { usePromosQuery } from '../../client/hooks/usePromosQuery.js';
|
|
9
|
+
import { ArrowLeftIcon } from '../../icons/ArrowLeftIcon.js';
|
|
10
|
+
import { ArrowRightIcon } from '../../icons/ArrowRightIcon.js';
|
|
11
|
+
import { ChevronRightIcon } from '../../icons/ChevronRightIcon.js';
|
|
12
|
+
import { Gift01Icon } from '../../icons/Gift01Icon.js';
|
|
13
|
+
import { Button } from '../../ui/Button/index.js';
|
|
10
14
|
import { Empty } from '../Empty.js';
|
|
11
15
|
import { Cashback } from './Cashback.js';
|
|
12
16
|
import { Promo } from './Promo.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useCashbacksQuery
|
|
3
|
+
import { useCashbacksQuery } from '../../client/hooks/useCashbacksQuery.js';
|
|
4
|
+
import { usePromosQuery } from '../../client/hooks/usePromosQuery.js';
|
|
4
5
|
import { Cashback } from './Cashback.js';
|
|
5
6
|
import { Promo } from './Promo.js';
|
|
6
7
|
export function PromosGrid(props) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useSessionQuery } from '../../client/hooks/
|
|
2
|
+
import { useSessionQuery } from '../../client/hooks/useSessionQuery.js';
|
|
3
3
|
export function Protected(props) {
|
|
4
4
|
const query = useSessionQuery();
|
|
5
5
|
return query.data?.status === 'authenticated'
|
|
@@ -3,11 +3,16 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { addDays, isEqual, startOfDay } from 'date-fns';
|
|
4
4
|
import { useState } from 'react';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
|
-
import { useCheckInDailyCheckInQuestMutation } from '../../../client/hooks/
|
|
7
|
-
import { toaster } from '../../../client/utils/
|
|
8
|
-
import { CalendarIcon
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
6
|
+
import { useCheckInDailyCheckInQuestMutation } from '../../../client/hooks/useCheckInDailyCheckInQuestMutation.js';
|
|
7
|
+
import { toaster } from '../../../client/utils/toaster.js';
|
|
8
|
+
import { CalendarIcon } from '../../../icons/CalendarIcon.js';
|
|
9
|
+
import { CheckIcon } from '../../../icons/CheckIcon.js';
|
|
10
|
+
import { ClockStopWatchIcon } from '../../../icons/ClockStopWatchIcon.js';
|
|
11
|
+
import { InfoCircleIcon } from '../../../icons/InfoCircleIcon.js';
|
|
12
|
+
import { Badge } from '../../../ui/Badge/index.js';
|
|
13
|
+
import { Button } from '../../../ui/Button/index.js';
|
|
14
|
+
import { getQueryClient } from '../../../utils/getQueryClient.js';
|
|
15
|
+
import { getAvailableQuestsQueryKey } from '../../../utils/queryKeys.js';
|
|
11
16
|
import CountdownTimer from '../CountdownTimer.js';
|
|
12
17
|
import { DailyCheckInQuestModal } from './DailyCheckInQuestModal.js';
|
|
13
18
|
export function DailyCheckInQuest({ quest }) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Portal } from '@ark-ui/react';
|
|
4
|
-
import { XIcon } from '../../../icons/
|
|
5
|
-
import { Button
|
|
4
|
+
import { XIcon } from '../../../icons/XIcon.js';
|
|
5
|
+
import { Button } from '../../../ui/Button/index.js';
|
|
6
|
+
import { Dialog } from '../../../ui/Dialog/index.js';
|
|
6
7
|
export function DailyCheckInQuestModal(props) {
|
|
7
8
|
return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: props.modalState.isOpen, onOpenChange: ({ open }) => props.modalState.setIsOpen(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("p", { className: "text-text-primary-900 text-lg font-semibold", children: "Daily Check-In Rules" }), _jsxs("ul", { className: "text-text-tertiary-600 group list-disc text-wrap pl-4 text-sm font-normal", children: [_jsx("li", { children: "Earn rewards just for checking in each day!" }), _jsx("li", { children: "Stay consistent to unlock special rewards on the 3rd, 5th, and 7th day." }), _jsx("li", { children: "Missing a day will reset your streak, starting again from Day 1." }), _jsx("li", { children: "Each check-in unlocks the next one on the following day." }), _jsx("li", { children: "Successfully check in for 7 consecutive days to complete the quest and reset the cycle." })] })] }), _jsx("div", { className: "pb-4 pt-6", children: _jsx(Button, { onClick: () => props.modalState.setIsOpen(false), children: "Ok" }) })] }) })] }) }));
|
|
8
9
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import Image from 'next/image';
|
|
4
|
-
import { useAvailableQuestsQuery } from '../../client/hooks/
|
|
5
|
-
import { SpinnerIcon } from '../../icons/
|
|
4
|
+
import { useAvailableQuestsQuery } from '../../client/hooks/useAvailableQuestsQuery.js';
|
|
5
|
+
import { SpinnerIcon } from '../../icons/SpinnerIcon.js';
|
|
6
6
|
import closeChest from '../../images/close-chest.png';
|
|
7
7
|
import { DailyCheckInQuest } from './DailyCheckInQuest/DailyCheckInQuest.js';
|
|
8
8
|
import { OnboardingQuest } from './OnboardingQuest/OnboardingQuest.js';
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
/** @default "Quests" */
|
|
3
|
-
heading?: string;
|
|
4
|
-
className?: string;
|
|
5
|
-
}
|
|
1
|
+
import { type QuestsProps } from './Quests.client';
|
|
6
2
|
export declare function Quests(props: QuestsProps): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
3
|
+
export type { QuestsProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { prefetchAvailableQuestsQuery } from '../../server/utils/
|
|
2
|
+
import { prefetchAvailableQuestsQuery } from '../../server/utils/prefetchAvailableQuestsQuery.js';
|
|
3
3
|
import { Quests__client } from './Quests.client.js';
|
|
4
4
|
export async function Quests(props) {
|
|
5
5
|
await prefetchAvailableQuestsQuery();
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
|
-
import { ClockStopWatchIcon
|
|
6
|
-
import {
|
|
5
|
+
import { ClockStopWatchIcon } from '../../../icons/ClockStopWatchIcon.js';
|
|
6
|
+
import { InfoCircleIcon } from '../../../icons/InfoCircleIcon.js';
|
|
7
|
+
import { Badge } from '../../../ui/Badge/index.js';
|
|
7
8
|
import CountdownTimer from '../CountdownTimer.js';
|
|
8
9
|
import { WageringQuestModal } from './WageringQuestModal.js';
|
|
9
10
|
export function WageringQuest({ quest }) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Portal } from '@ark-ui/react';
|
|
4
|
-
import { XIcon } from '../../../icons/
|
|
5
|
-
import { Button
|
|
4
|
+
import { XIcon } from '../../../icons/XIcon.js';
|
|
5
|
+
import { Button } from '../../../ui/Button/index.js';
|
|
6
|
+
import { Dialog } from '../../../ui/Dialog/index.js';
|
|
6
7
|
export function WageringQuestModal(props) {
|
|
7
8
|
return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: props.modalState.isOpen, onOpenChange: ({ open }) => props.modalState.setIsOpen(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("p", { className: "text-text-primary-900 text-lg font-semibold", children: props.questName }), _jsxs("ul", { 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: () => props.modalState.setIsOpen(false), children: "Ok" }) })] }) })] }) }));
|
|
8
9
|
}
|
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
logo: ImageProps['src'];
|
|
5
|
-
gameTypes: GameType[];
|
|
6
|
-
gameProviders: GameProvider[];
|
|
7
|
-
/**
|
|
8
|
-
* @default '/providers/<slug>'
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* '/bingo/:slug' // '/bingo/jili'
|
|
12
|
-
* '/bingo/:id' // '/bingo/JILI'
|
|
13
|
-
* // or using a function
|
|
14
|
-
* ({slug}) => `/bingo/${slug}`
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
viewGamesUrl?: string | ((gameProvider: GameProviderData) => string);
|
|
18
|
-
gameProviderImages?: Partial<Record<GameProvider, ImageProps['src']>>;
|
|
19
|
-
}
|
|
20
|
-
export declare function Search(props: SearchProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
export {};
|
|
1
|
+
import type { SearchProps } from './Search.lazy';
|
|
2
|
+
export declare function Search(props: SearchProps): import("react/jsx-runtime").JSX.Element | undefined;
|
|
3
|
+
export type { SearchProps };
|
|
@@ -1,68 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx
|
|
3
|
-
import
|
|
4
|
-
import Image, {} from 'next/image';
|
|
5
|
-
import Link from 'next/link';
|
|
6
|
-
import { useRef, useState } from 'react';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import dynamic from 'next/dynamic';
|
|
7
4
|
import { useShallow } from 'zustand/shallow';
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import { GameLaunchTrigger } from '../GameLaunch/index.js';
|
|
5
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
6
|
+
const Component = dynamic(() => import('./Search.lazy.js').then((m) => m.Search), {
|
|
7
|
+
ssr: false,
|
|
8
|
+
loading: () => null,
|
|
9
|
+
});
|
|
14
10
|
export function Search(props) {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const inputRef = useRef(null);
|
|
19
|
-
const [search, setSearch] = useState('');
|
|
20
|
-
const gamesQuery = useGamesQuery({
|
|
21
|
-
first: 18,
|
|
22
|
-
search,
|
|
23
|
-
filter: {
|
|
24
|
-
type: {
|
|
25
|
-
in: props.gameTypes,
|
|
26
|
-
},
|
|
27
|
-
provider: {
|
|
28
|
-
in: props.gameProviders,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
}, {
|
|
32
|
-
enabled: search.length >= 3,
|
|
33
|
-
});
|
|
34
|
-
const games = gamesQuery.data?.pages
|
|
35
|
-
.map((page) => page.edges.map((edge) => edge.node))
|
|
36
|
-
.flat() ?? [];
|
|
37
|
-
const gameProviders = props.gameProviders
|
|
38
|
-
.map((provider) => GAME_PROVIDER_DATA[provider])
|
|
39
|
-
.filter((provider) => provider.name
|
|
40
|
-
.toLowerCase()
|
|
41
|
-
.replace(/\s+/g, '')
|
|
42
|
-
.includes(search.toLowerCase().replace(/\s+/g, '')));
|
|
43
|
-
const empty = games.length <= 0 && gameProviders.length <= 0;
|
|
44
|
-
const viewGamesUrl = (data) => {
|
|
45
|
-
return props.viewGamesUrl
|
|
46
|
-
? callIfFn(props.viewGamesUrl, data)
|
|
47
|
-
.replace(':id', data.id)
|
|
48
|
-
.replace(':slug', data.slug)
|
|
49
|
-
: `/providers/${data.slug}`;
|
|
50
|
-
};
|
|
51
|
-
return (_jsx(Dialog.Root, { open: globalStore.search.open, onOpenChange: (details) => {
|
|
52
|
-
globalStore.search.setOpen(details.open);
|
|
53
|
-
setSearch('');
|
|
54
|
-
}, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: "bg-bg-primary lg:min-h-auto mx-auto min-h-full w-full pt-xl lg:mt-[132px] lg:max-w-[1136px] lg:bg-unset lg:pt-0", children: [_jsx(Dialog.Context, { children: (api) => (_jsxs("div", { className: "flex items-center justify-between px-4 lg:hidden", children: [_jsx(Image, { src: props.logo, alt: "", width: 200, height: 40, className: "h-8 w-auto" }), _jsx(IconButton, { size: "sm", colorScheme: "gray", onClick: () => api.setOpen(false), children: _jsx(XIcon, { className: "text-text-quinary size-6" }) })] })) }), _jsx("div", { className: "flex justify-end", children: _jsx(Dialog.Context, { children: (api) => (_jsx("button", { type: "button", onClick: () => api.setOpen(false), className: "hidden size-9 items-center justify-center rounded-md bg-white/20 lg:flex", children: _jsx(XIcon, { className: "size-5 text-white" }) })) }) }), _jsx("div", { className: "mt-2xl px-4 lg:mt-xl lg:px-0", children: _jsxs("div", { className: "relative", children: [_jsx(SearchLgIcon, { className: "text-text-quinary pointer-events-none absolute left-3.5 top-1/2 size-5 -translate-y-1/2" }), _jsx(Field.Input, { ref: inputRef, type: "search", value: search, onChange: (e) => {
|
|
55
|
-
setSearch(e.target.value);
|
|
56
|
-
}, 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: () => {
|
|
57
|
-
setSearch('');
|
|
58
|
-
inputRef.current?.focus();
|
|
59
|
-
}, 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: "bg-gray-800 flex h-14 w-full items-center rounded-md", onClick: () => {
|
|
60
|
-
globalStore.search.setOpen(false);
|
|
61
|
-
}, children: _jsx(Image, { src: props.gameProviderImages?.[provider.id] ??
|
|
62
|
-
provider.logo, alt: "", width: 100, height: 50, className: "mx-auto h-auto w-full" }) }, 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: "block w-full shadow-sm", onClick: () => {
|
|
63
|
-
globalStore.search.setOpen(false);
|
|
64
|
-
}, children: [_jsx(Image, { src: game.image, alt: "", width: 200, height: 200, priority: true, className: "aspect-square w-full rounded-t-md object-cover" }), _jsx("span", { className: "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", 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" }) })] }))] })) })] }) })] }) }));
|
|
65
|
-
}
|
|
66
|
-
function Alert({ message }) {
|
|
67
|
-
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 })] }));
|
|
11
|
+
const touched = useGlobalStore(useShallow((ctx) => ctx.search['~touched']));
|
|
12
|
+
if (touched)
|
|
13
|
+
return _jsx(Component, { ...props });
|
|
68
14
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ImageProps } from 'next/image';
|
|
2
|
+
import type { GameProvider, GameProviderData, GameType } from '../../types';
|
|
3
|
+
export interface SearchProps {
|
|
4
|
+
logo: ImageProps['src'];
|
|
5
|
+
gameTypes: GameType[];
|
|
6
|
+
gameProviders: GameProvider[];
|
|
7
|
+
/**
|
|
8
|
+
* @default '/providers/<slug>'
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* '/bingo/:slug' // '/bingo/jili'
|
|
12
|
+
* '/bingo/:id' // '/bingo/JILI'
|
|
13
|
+
* // or using a function
|
|
14
|
+
* ({slug}) => `/bingo/${slug}`
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
viewGamesUrl?: string | ((gameProvider: GameProviderData) => string);
|
|
18
|
+
gameProviderImages?: Partial<Record<GameProvider, ImageProps['src']>>;
|
|
19
|
+
}
|
|
20
|
+
export declare function Search(props: SearchProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Portal } from '@ark-ui/react';
|
|
4
|
+
import Image, {} from 'next/image';
|
|
5
|
+
import Link from 'next/link';
|
|
6
|
+
import { useRef, useState } from 'react';
|
|
7
|
+
import { useShallow } from 'zustand/shallow';
|
|
8
|
+
import { useGamesQuery } from '../../client/hooks/useGamesQuery.js';
|
|
9
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
10
|
+
import { GAME_PROVIDER_DATA } from '../../constants/index.js';
|
|
11
|
+
import { SearchLgIcon } from '../../icons/SearchLgIcon.js';
|
|
12
|
+
import { XIcon } from '../../icons/XIcon.js';
|
|
13
|
+
import { Button } from '../../ui/Button/index.js';
|
|
14
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
15
|
+
import { Field } from '../../ui/Field/index.js';
|
|
16
|
+
import { IconButton } from '../../ui/IconButton/index.js';
|
|
17
|
+
import { Presence } from '../../ui/Presence.js';
|
|
18
|
+
import { callIfFn } from '../../utils/callIfFn.js';
|
|
19
|
+
import { getGameImageUrl } from '../../utils/getGameImageUrl.js';
|
|
20
|
+
import { GameLaunchTrigger } from '../GameLaunch/index.js';
|
|
21
|
+
export function Search(props) {
|
|
22
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
23
|
+
search: ctx.search,
|
|
24
|
+
})));
|
|
25
|
+
const inputRef = useRef(null);
|
|
26
|
+
const [search, setSearch] = useState('');
|
|
27
|
+
const gamesQuery = useGamesQuery({
|
|
28
|
+
first: 18,
|
|
29
|
+
search,
|
|
30
|
+
filter: {
|
|
31
|
+
type: {
|
|
32
|
+
in: props.gameTypes,
|
|
33
|
+
},
|
|
34
|
+
provider: {
|
|
35
|
+
in: props.gameProviders,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
}, {
|
|
39
|
+
enabled: search.length >= 3,
|
|
40
|
+
});
|
|
41
|
+
const games = gamesQuery.data?.pages
|
|
42
|
+
.map((page) => page.edges.map((edge) => edge.node))
|
|
43
|
+
.flat() ?? [];
|
|
44
|
+
const gameProviders = props.gameProviders
|
|
45
|
+
.map((provider) => GAME_PROVIDER_DATA[provider])
|
|
46
|
+
.filter((provider) => provider.name
|
|
47
|
+
.toLowerCase()
|
|
48
|
+
.replace(/\s+/g, '')
|
|
49
|
+
.includes(search.toLowerCase().replace(/\s+/g, '')));
|
|
50
|
+
const empty = games.length <= 0 && gameProviders.length <= 0;
|
|
51
|
+
const viewGamesUrl = (data) => {
|
|
52
|
+
return props.viewGamesUrl
|
|
53
|
+
? callIfFn(props.viewGamesUrl, data)
|
|
54
|
+
.replace(':id', data.id)
|
|
55
|
+
.replace(':slug', data.slug)
|
|
56
|
+
: `/providers/${data.slug}`;
|
|
57
|
+
};
|
|
58
|
+
return (_jsx(Dialog.Root, { open: globalStore.search.open, onOpenChange: (details) => {
|
|
59
|
+
globalStore.search.setOpen(details.open);
|
|
60
|
+
setSearch('');
|
|
61
|
+
}, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: "bg-bg-primary lg:min-h-auto mx-auto min-h-full w-full pt-xl lg:mt-[132px] lg:max-w-[1136px] lg:bg-unset lg:pt-0", children: [_jsx(Dialog.Context, { children: (api) => (_jsxs("div", { className: "flex items-center justify-between px-4 lg:hidden", children: [_jsx(Image, { src: props.logo, alt: "", width: 200, height: 40, className: "h-8 w-auto" }), _jsx(IconButton, { size: "sm", colorScheme: "gray", onClick: () => api.setOpen(false), children: _jsx(XIcon, { className: "text-text-quinary size-6" }) })] })) }), _jsx("div", { className: "flex justify-end", children: _jsx(Dialog.Context, { children: (api) => (_jsx("button", { type: "button", onClick: () => api.setOpen(false), className: "hidden size-9 items-center justify-center rounded-md bg-white/20 lg:flex", children: _jsx(XIcon, { className: "size-5 text-white" }) })) }) }), _jsx("div", { className: "mt-2xl px-4 lg:mt-xl lg:px-0", children: _jsxs("div", { className: "relative", children: [_jsx(SearchLgIcon, { className: "text-text-quinary pointer-events-none absolute left-3.5 top-1/2 size-5 -translate-y-1/2" }), _jsx(Field.Input, { ref: inputRef, type: "search", value: search, onChange: (e) => {
|
|
62
|
+
setSearch(e.target.value);
|
|
63
|
+
}, 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
|
+
setSearch('');
|
|
65
|
+
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: "bg-gray-800 flex h-14 w-full items-center rounded-md", onClick: () => {
|
|
67
|
+
globalStore.search.setOpen(false);
|
|
68
|
+
}, children: _jsx(Image, { src: props.gameProviderImages?.[provider.id] ??
|
|
69
|
+
provider.logo, alt: "", width: 100, height: 50, className: "mx-auto h-auto w-full" }) }, 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: "block w-full shadow-sm", onClick: () => {
|
|
70
|
+
globalStore.search.setOpen(false);
|
|
71
|
+
}, children: [_jsx(Image, { src: getGameImageUrl({
|
|
72
|
+
reference: game.reference,
|
|
73
|
+
provider: game.provider,
|
|
74
|
+
}), alt: "", width: 200, height: 200, priority: true, className: "aspect-square w-full rounded-t-md object-cover" }), _jsx("span", { className: "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", 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
|
+
}
|
|
76
|
+
function Alert({ message }) {
|
|
77
|
+
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 })] }));
|
|
78
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { ark } from '@ark-ui/react';
|
|
4
4
|
import { useShallow } from 'zustand/shallow';
|
|
5
|
-
import { useGlobalStore } from '../../client/hooks/
|
|
5
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
6
6
|
export function SearchTrigger(props) {
|
|
7
7
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
8
8
|
search: ctx.search,
|
|
@@ -5,15 +5,26 @@ import { useRef } from 'react';
|
|
|
5
5
|
import { Controller, useForm } from 'react-hook-form';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import { useShallow } from 'zustand/shallow';
|
|
8
|
-
import { useCooldown
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { useCooldown } from '../../client/hooks/useCooldown.js';
|
|
9
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
10
|
+
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
11
|
+
import { useMobileNumberParser } from '../../client/hooks/useMobileNumberParser.js';
|
|
12
|
+
import { useSendVerificationCodeMutation } from '../../client/hooks/useSendVerificationCodeMutation.js';
|
|
13
|
+
import { useSignInMutation } from '../../client/hooks/useSignInMutation.js';
|
|
14
|
+
import { toaster } from '../../client/utils/toaster.js';
|
|
15
|
+
import { ArrowLeftIcon } from '../../icons/ArrowLeftIcon.js';
|
|
16
|
+
import { CheckIcon } from '../../icons/CheckIcon.js';
|
|
17
|
+
import { FacebookIcon } from '../../icons/FacebookIcon.js';
|
|
18
|
+
import { GoogleIcon } from '../../icons/GoogleIcon.js';
|
|
19
|
+
import { Button } from '../../ui/Button/index.js';
|
|
20
|
+
import { Checkbox } from '../../ui/Checkbox/index.js';
|
|
21
|
+
import { Field } from '../../ui/Field/index.js';
|
|
22
|
+
import { PinInput } from '../../ui/PinInput/index.js';
|
|
12
23
|
import { useSignInContext } from './SignInContext.js';
|
|
13
24
|
export function MobileNumberSignIn() {
|
|
14
25
|
const context = useSignInContext();
|
|
15
26
|
const dialog = useDialogContext();
|
|
16
|
-
const signUpStore = useGlobalStore(useShallow((
|
|
27
|
+
const signUpStore = useGlobalStore(useShallow((ctx) => ctx.signUp));
|
|
17
28
|
const signInMutation = useSignInMutation();
|
|
18
29
|
const sendVerificationCodeMutation = useSendVerificationCodeMutation();
|
|
19
30
|
const localeInfo = useLocaleInfo();
|