@opexa/portal-components 0.0.99 → 0.0.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/hooks/index.d.ts +0 -5
- package/dist/client/hooks/index.js +0 -5
- 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/CashbackBonus/CashbackBonus.client.d.ts +2 -0
- package/dist/components/CashbackBonus/CashbackBonus.client.js +9 -0
- package/dist/components/CashbackBonus/CashbackBonus.d.ts +10 -0
- package/dist/components/CashbackBonus/CashbackBonus.js +5 -0
- package/dist/components/CashbackBonus/index.d.ts +1 -0
- package/dist/components/CashbackBonus/index.js +1 -0
- 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/GameContext.d.ts +2 -0
- package/dist/components/Games/GameContext.js +2 -0
- 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/JackpotCounter/JackpotCounterItem.d.ts +1 -1
- package/dist/components/JackpotCounter/JackpotCounterItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotItemDesktop.d.ts +9 -0
- package/dist/components/Jackpots/JackpotItemDesktop.js +43 -0
- package/dist/components/Jackpots/JackpotItemMobile.d.ts +9 -0
- package/dist/components/Jackpots/JackpotItemMobile.js +44 -0
- 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 +14 -9
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsContext.d.ts +1 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsList.d.ts +3 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsList.js +9 -9
- package/dist/components/Jackpots/JackpotsList/JackpotsListContext.js +1 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.js +14 -9
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemGameProviders.js +11 -4
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.js +15 -7
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemRules.js +2 -2
- package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.d.ts +1 -5
- package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.js +3 -25
- package/dist/components/Jackpots/useJackpotData.d.ts +2 -2
- package/dist/components/Jackpots/useJackpotData.js +1 -0
- package/dist/components/Jackpots/useJackpotItemData.d.ts +20 -0
- package/dist/components/Jackpots/useJackpotItemData.js +87 -0
- 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/MessageItem.d.ts +4 -0
- package/dist/components/Messages/MessageItem.js +34 -0
- 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/Promo/PromoContent.d.ts +2 -0
- package/dist/components/Promo/PromoContent.js +9 -0
- package/dist/components/Promos/Cashback.js +3 -2
- package/dist/components/Promos/Promo.js +3 -2
- package/dist/components/Promos/PromoCarousel.d.ts +2 -0
- package/dist/components/Promos/PromoCarousel.js +41 -0
- package/dist/components/Promos/PromoGrid.d.ts +2 -0
- package/dist/components/Promos/PromoGrid.js +12 -0
- package/dist/components/Promos/PromoItem.d.ts +7 -0
- package/dist/components/Promos/PromoItem.js +10 -0
- 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/TournamentCounter/TournamentCounterItem.d.ts +1 -1
- package/dist/components/Tournaments/TournamentItemDesktop.d.ts +7 -0
- package/dist/components/Tournaments/TournamentItemDesktop.js +56 -0
- package/dist/components/Tournaments/TournamentItemMobile.d.ts +7 -0
- package/dist/components/Tournaments/TournamentItemMobile.js +54 -0
- 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/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
- package/dist/components/Tournaments/TournamentsContext.d.ts +1 -1
- package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
- 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/Tournaments/useTournamentData.js +1 -0
- package/dist/components/Tournaments/useTournamentItemData.d.ts +16 -0
- package/dist/components/Tournaments/useTournamentItemData.js +64 -0
- 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/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/constants/endpoints.js +2 -2
- package/dist/handlers.js +1 -1
- package/dist/icons/index.d.ts +0 -1
- package/dist/icons/index.js +0 -1
- package/dist/images/hacksaw-gaming.png +0 -0
- package/dist/middleware.js +1 -1
- package/dist/next.config.js +4 -0
- 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/index.d.ts +0 -5
- package/dist/server/utils/index.js +0 -5
- 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/queries.js +2351 -2351
- package/dist/styles/theme.css +697 -697
- 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/index.d.ts +0 -1
- package/dist/utils/index.js +0 -1
- 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 +162 -163
- 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/services/{account.service.d.ts → account.d.ts} +0 -0
- /package/dist/services/{account.service.js → account.js} +0 -0
- /package/dist/services/{auth.service.d.ts → auth.d.ts} +0 -0
- /package/dist/services/{auth.service.js → auth.js} +0 -0
- /package/dist/services/{cmsPortal.service.d.ts → cmsPortal.d.ts} +0 -0
- /package/dist/services/{cmsPortal.service.js → cmsPortal.js} +0 -0
- /package/dist/services/{file.service.d.ts → file.d.ts} +0 -0
- /package/dist/services/{file.service.js → file.js} +0 -0
- /package/dist/services/{game.service.d.ts → game.d.ts} +0 -0
- /package/dist/services/{game.service.js → game.js} +0 -0
- /package/dist/services/{portal.service.d.ts → portal.d.ts} +0 -0
- /package/dist/services/{portal.service.js → portal.js} +0 -0
- /package/dist/services/{report.service.d.ts → report.d.ts} +0 -0
- /package/dist/services/{report.service.js → report.js} +0 -0
- /package/dist/services/{trigger.service.d.ts → trigger.d.ts} +0 -0
- /package/dist/services/{trigger.service.js → trigger.js} +0 -0
- /package/dist/services/{wallet.service.d.ts → wallet.d.ts} +0 -0
- /package/dist/services/{wallet.service.js → wallet.js} +0 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { createListCollection, parseDate, Portal } from '@ark-ui/react';
|
|
4
|
+
import { tz, TZDateMini } from '@date-fns/tz';
|
|
5
|
+
import { endOfDay, format, startOfDay } from 'date-fns';
|
|
6
|
+
import { useReducer, useState } from 'react';
|
|
7
|
+
import { twMerge } from 'tailwind-merge';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import { useBetRecordsQuery } from '../../client/hooks/useBetRecordsQuery.js';
|
|
10
|
+
import { useInfiniteQueryHelper } from '../../client/hooks/useInfiniteQueryHelper.js';
|
|
11
|
+
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
12
|
+
import { GAME_PROVIDER_DATA, GAME_TYPE_DATA, GAME_TYPES, } from '../../constants/index.js';
|
|
13
|
+
import { CheckIcon } from '../../icons/CheckIcon.js';
|
|
14
|
+
import { ChevronDownIcon } from '../../icons/ChevronDownIcon.js';
|
|
15
|
+
import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
|
|
16
|
+
import { ChevronRightIcon } from '../../icons/ChevronRightIcon.js';
|
|
17
|
+
import { File02Icon } from '../../icons/File02Icon.js';
|
|
18
|
+
import { SpinnerIcon } from '../../icons/SpinnerIcon.js';
|
|
19
|
+
import { Badge } from '../../ui/Badge/index.js';
|
|
20
|
+
import { DatePicker } from '../../ui/DatePicker/index.js';
|
|
21
|
+
import { IconButton } from '../../ui/IconButton/index.js';
|
|
22
|
+
import { SegmentGroup } from '../../ui/SegmentGroup/index.js';
|
|
23
|
+
import { Select } from '../../ui/Select/index.js';
|
|
24
|
+
import { Table } from '../../ui/Table/index.js';
|
|
25
|
+
import { capitalize } from '../../utils/capitalize.js';
|
|
26
|
+
import { formatNumber } from '../../utils/formatNumber.js';
|
|
27
|
+
import { Empty } from '../Empty.js';
|
|
28
|
+
export function BetRecords__client(props) {
|
|
29
|
+
const [tab, setTab] = useState('all');
|
|
30
|
+
const gameTypes = props.gameTypes.map((type) => GAME_TYPE_DATA[type]);
|
|
31
|
+
const gameProviders = props.gameProviders.map((provider) => GAME_PROVIDER_DATA[provider]);
|
|
32
|
+
const [state, setState] = useReducer((prev, next) => ({
|
|
33
|
+
...prev,
|
|
34
|
+
...next,
|
|
35
|
+
}), {
|
|
36
|
+
page: 1,
|
|
37
|
+
pageSize: 10,
|
|
38
|
+
type: null,
|
|
39
|
+
});
|
|
40
|
+
const localeInfo = useLocaleInfo();
|
|
41
|
+
const providerCollection = createListCollection({
|
|
42
|
+
items: gameProviders,
|
|
43
|
+
itemToValue: (item) => item.id,
|
|
44
|
+
itemToString: (item) => item.name,
|
|
45
|
+
});
|
|
46
|
+
const { page, hasNextPage, hasPrevPage, next, prev, rows, totalPages, loading, firstPage, } = useInfiniteQueryHelper(useBetRecordsQuery, {
|
|
47
|
+
filter: {
|
|
48
|
+
...(state.type && {
|
|
49
|
+
game__type: {
|
|
50
|
+
equal: state.type,
|
|
51
|
+
},
|
|
52
|
+
}),
|
|
53
|
+
...(state.provider && {
|
|
54
|
+
game__provider: {
|
|
55
|
+
equal: state.provider,
|
|
56
|
+
},
|
|
57
|
+
}),
|
|
58
|
+
...(state.status && {
|
|
59
|
+
status: {
|
|
60
|
+
equal: state.status,
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
63
|
+
...(state.timestamp && {
|
|
64
|
+
dateTimeCreated: {
|
|
65
|
+
...(state.timestamp.start && {
|
|
66
|
+
greaterThanOrEqual: new TZDateMini(startOfDay(state.timestamp.start), localeInfo.timezone).toISOString(),
|
|
67
|
+
}),
|
|
68
|
+
...(state.timestamp.end && {
|
|
69
|
+
lesserThanOrEqual: new TZDateMini(endOfDay(state.timestamp.end), localeInfo.timezone).toISOString(),
|
|
70
|
+
}),
|
|
71
|
+
},
|
|
72
|
+
}),
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
return (_jsxs("div", { className: props.className, children: [_jsx("h2", { className: "text-sm font-semibold leading-tight lg:text-lg", children: "Bet Records" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm leading-tight", children: "Review your betting history" }), _jsx("div", { className: "mt-lg lg:mt-2xl", children: _jsxs(SegmentGroup.Root, { value: state.type ?? 'all', onValueChange: (details) => {
|
|
76
|
+
firstPage();
|
|
77
|
+
setState({
|
|
78
|
+
type: z.enum(GAME_TYPES).safeParse(details.value).data ?? null,
|
|
79
|
+
});
|
|
80
|
+
}, className: "w-full overflow-x-auto lg:w-fit", children: [_jsxs(SegmentGroup.Item, { value: "all", children: [_jsx(SegmentGroup.ItemText, { children: "All" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), gameTypes.map((type) => (_jsxs(SegmentGroup.Item, { value: type.id, children: [_jsx(SegmentGroup.ItemText, { children: type.name }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }, type.id))), _jsx(SegmentGroup.Indicator, {})] }) }), _jsx("div", { className: "border-border-secondary mt-2xl hidden border-t lg:block" }), _jsx("h3", { className: "text-text-secondary-700 mt-3xl text-sm font-semibold", children: "Table" }), _jsxs("div", { className: "mt-xl flex flex-col gap-lg lg:flex-row lg:items-center", children: [_jsxs(DatePicker.Root, { lazyMount: true, unmountOnExit: true, value: [state.timestamp?.start, state.timestamp?.end]
|
|
81
|
+
.filter(Boolean)
|
|
82
|
+
.map((d) => parseDate(d)), onValueChange: (details) => {
|
|
83
|
+
firstPage();
|
|
84
|
+
setState({
|
|
85
|
+
timestamp: {
|
|
86
|
+
start: details.value.at(0)?.toDate(DEVICE_TIMEZONE),
|
|
87
|
+
end: details.value.at(1)?.toDate(DEVICE_TIMEZONE),
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
}, onOpenChange: (details) => {
|
|
91
|
+
if (details.open)
|
|
92
|
+
return;
|
|
93
|
+
if (state.timestamp)
|
|
94
|
+
return;
|
|
95
|
+
setTab('all');
|
|
96
|
+
}, selectionMode: "range", closeOnSelect: false, positioning: {
|
|
97
|
+
gutter: 20,
|
|
98
|
+
placement: 'bottom',
|
|
99
|
+
}, children: [_jsxs(SegmentGroup.Root, { value: tab, onValueChange: (details) => {
|
|
100
|
+
const value = TabDefinition.parse(details.value);
|
|
101
|
+
if (value === 'today') {
|
|
102
|
+
const now = new Date();
|
|
103
|
+
setState({
|
|
104
|
+
timestamp: {
|
|
105
|
+
start: startOfDay(now),
|
|
106
|
+
end: endOfDay(now),
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
setState({
|
|
112
|
+
timestamp: null,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
firstPage();
|
|
116
|
+
setTab(value);
|
|
117
|
+
}, className: "w-full lg:w-fit", children: [_jsxs(SegmentGroup.Item, { value: "all", className: "w-full lg:w-auto", children: [_jsx(SegmentGroup.ItemText, { children: "All" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsxs(SegmentGroup.Item, { value: "today", className: "w-full lg:w-auto", children: [_jsx(SegmentGroup.ItemText, { children: "Today" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsx(DatePicker.Context, { children: (api) => (_jsx(SegmentGroup.Item, { value: "custom", onClick: () => api.setOpen(true), className: "w-full lg:w-auto", children: _jsxs(DatePicker.Control, { children: [_jsx(SegmentGroup.ItemText, { children: "Custom" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }) })) }), _jsx(SegmentGroup.Indicator, {})] }), _jsx(Portal, { children: _jsx(DatePicker.Positioner, { children: _jsx(DatePicker.Content, { children: _jsx(DatePicker.View, { view: "day", children: _jsx(DatePicker.Context, { children: (api) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsxs(DatePicker.Table, { children: [_jsx(DatePicker.TableHead, { children: _jsx(DatePicker.TableRow, { children: api.weekDays.map((weekDay, id) => (_jsx(DatePicker.TableHeader, { children: weekDay.short.substring(0, 2) }, id))) }) }), _jsx(DatePicker.TableBody, { children: api.weeks.map((week, id) => (_jsx(DatePicker.TableRow, { children: week.map((day, id) => (_jsx(DatePicker.TableCell, { value: day, children: _jsx(DatePicker.TableCellTrigger, { children: day.day }) }, id))) }, id))) })] })] })) }) }) }) }) })] }), _jsx("div", { className: "hidden grow lg:block" }), _jsxs(Select.Root, { collection: providerCollection, value: state.provider ? [state.provider] : [], onValueChange: (details) => {
|
|
118
|
+
const value = z
|
|
119
|
+
.enum((props.gameProviders ?? []))
|
|
120
|
+
.safeParse(details.value.at(0)).data;
|
|
121
|
+
firstPage();
|
|
122
|
+
setState({
|
|
123
|
+
provider: value ?? null,
|
|
124
|
+
});
|
|
125
|
+
}, lazyMount: true, deselectable: true, positioning: {
|
|
126
|
+
sameWidth: true,
|
|
127
|
+
}, children: [_jsxs(Select.Trigger, { className: "w-full lg:w-[14rem]", children: [_jsx(Select.ValueText, { placeholder: "Game Vendor" }), _jsx(Select.Context, { children: (api) => (_jsx(_Fragment, { children: api.value.length ? (_jsx(Select.ClearTrigger, { asChild: true, children: _jsx("span", { onClick: (e) => {
|
|
128
|
+
e.stopPropagation();
|
|
129
|
+
}, children: "Clear" }) })) : (_jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })) })) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: providerCollection.items.map((provider) => (_jsxs(Select.Item, { item: provider, children: [_jsx(Select.ItemText, { children: provider.name }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, provider.id))) }) }) }) })] }), _jsxs(Select.Root, { collection: statusCollection, value: state.status ? [state.status] : [], onValueChange: (details) => {
|
|
130
|
+
const value = z
|
|
131
|
+
.enum(BET_RECORD_STATUSES)
|
|
132
|
+
.safeParse(details.value.at(0)).data;
|
|
133
|
+
firstPage();
|
|
134
|
+
setState({
|
|
135
|
+
status: value ?? null,
|
|
136
|
+
});
|
|
137
|
+
}, lazyMount: true, deselectable: true, positioning: {
|
|
138
|
+
sameWidth: true,
|
|
139
|
+
}, children: [_jsxs(Select.Trigger, { className: "w-full lg:w-[14rem]", children: [_jsx(Select.ValueText, { placeholder: "Status" }), _jsx(Select.Context, { children: (api) => (_jsx(_Fragment, { children: api.value.length ? (_jsx(Select.ClearTrigger, { asChild: true, children: _jsx("span", { onClick: (e) => {
|
|
140
|
+
e.stopPropagation();
|
|
141
|
+
}, children: "Clear" }) })) : (_jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })) })) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: statusCollection.items.map((status) => (_jsxs(Select.Item, { item: status, children: [_jsx(Select.ItemText, { children: capitalize(status, {
|
|
142
|
+
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
143
|
+
}) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, status))) }) }) }) })] })] }), rows.length <= 0 && (_jsx(Empty, { icon: loading ? SpinnerIcon : File02Icon, title: loading ? 'Just a moment' : 'No data', message: loading
|
|
144
|
+
? 'Fetching latest bet records...'
|
|
145
|
+
: 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-xl', 'border-y', 'border-border-secondary', 'bleed', 'lg:not-bleed', 'lg:mt-3xl', 'lg:w-full', 'lg:rounded-xl', 'lg:border-x'), children: [_jsx("div", { className: "border-border-secondary scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent scrollbar:h-2 scrollbar-thumb:rounded-full overflow-hidden overflow-x-auto rounded-none border-b lg:rounded-t-xl", children: _jsxs(Table.Root, { className: "border-0", children: [_jsx(Table.Header, { children: _jsxs(Table.Row, { children: [_jsx(Table.Heading, { children: "Bet Time" }), _jsx(Table.Heading, { children: "Settlement Time" }), _jsx(Table.Heading, { children: "Bet Content" }), _jsx(Table.Heading, { children: "Odds" }), _jsx(Table.Heading, { children: "Bet Amount" }), _jsx(Table.Heading, { children: "Valid Bet" }), _jsx(Table.Heading, { children: "Settled Amount" }), _jsx(Table.Heading, { children: "Jackpot Contribution" }), _jsx(Table.Heading, { children: "Jackpot Payout" }), _jsx(Table.Heading, { children: "Bet Status" }), _jsx(Table.Heading, { children: "Game Name" }), _jsx(Table.Heading, { children: "Vendor Round ID" })] }) }), _jsx(Table.Body, { children: rows.map((data) => (_jsxs(Table.Row, { children: [_jsxs(Table.Cell, { className: "!py-1", children: [_jsx("div", { className: "leading-tight", children: format(data.dateTimeCreated, 'MM/dd/yyyy', {
|
|
146
|
+
in: tz(localeInfo.timezone),
|
|
147
|
+
}) }), _jsx("div", { className: "text-text-tertiary-600 leading-tight", children: format(data.dateTimeCreated, 'hh:mm a', {
|
|
148
|
+
in: tz(localeInfo.timezone),
|
|
149
|
+
}) })] }), _jsx(Table.Cell, { className: "!py-1", children: !!data.dateTimeSettled && (_jsxs(_Fragment, { children: [_jsx("div", { className: "leading-tight", children: format(data.dateTimeSettled, 'MM/dd/yyyy', {
|
|
150
|
+
in: tz(localeInfo.timezone),
|
|
151
|
+
}) }), _jsx("div", { className: "text-text-tertiary-600 leading-tight", children: format(data.dateTimeSettled, 'hh:mm a', {
|
|
152
|
+
in: tz(localeInfo.timezone),
|
|
153
|
+
}) })] })) }), _jsx(Table.Cell, { className: "!py-1", children: data?.betContent || '/' }), _jsx(Table.Cell, { className: "!py-1", children: data.metadata?.odds || '/' }), _jsx(Table.Cell, { className: "!py-1", children: formatNumber(data.bet, {
|
|
154
|
+
currency: localeInfo.currency.code,
|
|
155
|
+
minDecimalPlaces: 2,
|
|
156
|
+
}) }), _jsx(Table.Cell, { className: "!py-1", children: formatNumber(data.validBet, {
|
|
157
|
+
currency: localeInfo.currency.code,
|
|
158
|
+
minDecimalPlaces: 2,
|
|
159
|
+
}) }), _jsx(Table.Cell, { className: "!py-1", children: formatNumber(data.payout, {
|
|
160
|
+
currency: localeInfo.currency.code,
|
|
161
|
+
minDecimalPlaces: 2,
|
|
162
|
+
}) }), _jsx(Table.Cell, { className: "!py-1", children: formatNumber(data.jackpotContribution, {
|
|
163
|
+
currency: localeInfo.currency.code,
|
|
164
|
+
minDecimalPlaces: 2,
|
|
165
|
+
}) }), _jsx(Table.Cell, { className: "!py-1", children: formatNumber(data.jackpotPayout, {
|
|
166
|
+
currency: localeInfo.currency.code,
|
|
167
|
+
minDecimalPlaces: 2,
|
|
168
|
+
}) }), _jsx(Table.Cell, { className: "!py-1", children: _jsx(Badge.Root, { colorScheme: data.status === 'SETTLED'
|
|
169
|
+
? 'success'
|
|
170
|
+
: data.status === 'STARTED'
|
|
171
|
+
? 'blue'
|
|
172
|
+
: 'danger', children: _jsx(Badge.Label, { children: capitalize(data.status, {
|
|
173
|
+
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
174
|
+
}) }) }) }), _jsx(Table.Cell, { className: "!py-1", children: data.game.name }), _jsx(Table.Cell, { className: "!py-1", children: data.vendorRoundId })] }, data.id))) })] }) }), _jsxs("div", { className: "flex items-center justify-between gap-lg px-4 py-3", children: [_jsx(IconButton, { size: "xs", variant: "outline", colorScheme: "gray", disabled: !hasPrevPage || loading, onClick: () => prev(), children: _jsx(ChevronLeftIcon, { className: "size-5" }) }), _jsxs("p", { className: "text-text-secondary-700 text-sm font-medium", children: ["Page ", page, " of ", totalPages] }), _jsx(IconButton, { size: "xs", variant: "outline", colorScheme: "gray", disabled: !hasNextPage || loading, onClick: () => next(), children: _jsx(ChevronRightIcon, { className: "size-5" }) })] })] }))] }));
|
|
175
|
+
}
|
|
176
|
+
const BET_RECORD_STATUSES = [
|
|
177
|
+
'CANCELLED',
|
|
178
|
+
'SETTLED',
|
|
179
|
+
'STARTED',
|
|
180
|
+
];
|
|
181
|
+
const statusCollection = createListCollection({
|
|
182
|
+
items: BET_RECORD_STATUSES,
|
|
183
|
+
itemToValue: (item) => item,
|
|
184
|
+
itemToString: (item) => capitalize(item, {
|
|
185
|
+
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
186
|
+
}),
|
|
187
|
+
});
|
|
188
|
+
const TabDefinition = z.enum(['all', 'today', 'custom']);
|
|
189
|
+
const DEVICE_TIMEZONE = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
gameProviders: GameProvider[];
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare function BetRecords(props: BetRecordsProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { type BetRecordsProps } from './BetRecords.client';
|
|
2
|
+
export declare function BetRecords(props: BetRecordsProps): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
3
|
+
export type { BetRecordsProps };
|
|
@@ -1,176 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { z } from 'zod';
|
|
9
|
-
import { useBetRecordsQuery, useInfiniteQueryHelper, useLocaleInfo, } from '../../client/hooks/index.js';
|
|
10
|
-
import { GAME_PROVIDER_DATA, GAME_TYPE_DATA, GAME_TYPES, } from '../../constants/index.js';
|
|
11
|
-
import { CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, File02Icon, SpinnerIcon, } from '../../icons/index.js';
|
|
12
|
-
import { Badge, DatePicker, IconButton, SegmentGroup, Select, Table, } from '../../ui/index.js';
|
|
13
|
-
import { capitalize, formatNumber } from '../../utils/index.js';
|
|
14
|
-
import { Empty } from '../Empty.js';
|
|
15
|
-
export function BetRecords(props) {
|
|
16
|
-
const [tab, setTab] = useState('all');
|
|
17
|
-
const gameTypes = props.gameTypes.map((type) => GAME_TYPE_DATA[type]);
|
|
18
|
-
const gameProviders = props.gameProviders.map((provider) => GAME_PROVIDER_DATA[provider]);
|
|
19
|
-
const [state, setState] = useReducer((prev, next) => ({
|
|
20
|
-
...prev,
|
|
21
|
-
...next,
|
|
22
|
-
}), {
|
|
23
|
-
page: 1,
|
|
24
|
-
pageSize: 10,
|
|
25
|
-
type: null,
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { prefetchBetRecordsQuery } from '../../server/utils/prefetchBetRecordsQuery.js';
|
|
3
|
+
import { BetRecords__client } from './BetRecords.client.js';
|
|
4
|
+
export async function BetRecords(props) {
|
|
5
|
+
await prefetchBetRecordsQuery({
|
|
6
|
+
first: 10,
|
|
7
|
+
filter: {},
|
|
26
8
|
});
|
|
27
|
-
|
|
28
|
-
const providerCollection = createListCollection({
|
|
29
|
-
items: gameProviders,
|
|
30
|
-
itemToValue: (item) => item.id,
|
|
31
|
-
itemToString: (item) => item.name,
|
|
32
|
-
});
|
|
33
|
-
const { page, hasNextPage, hasPrevPage, next, prev, rows, totalPages, loading, firstPage, } = useInfiniteQueryHelper(useBetRecordsQuery, {
|
|
34
|
-
filter: {
|
|
35
|
-
...(state.type && {
|
|
36
|
-
game__type: {
|
|
37
|
-
equal: state.type,
|
|
38
|
-
},
|
|
39
|
-
}),
|
|
40
|
-
...(state.provider && {
|
|
41
|
-
game__provider: {
|
|
42
|
-
equal: state.provider,
|
|
43
|
-
},
|
|
44
|
-
}),
|
|
45
|
-
...(state.status && {
|
|
46
|
-
status: {
|
|
47
|
-
equal: state.status,
|
|
48
|
-
},
|
|
49
|
-
}),
|
|
50
|
-
...(state.timestamp && {
|
|
51
|
-
dateTimeCreated: {
|
|
52
|
-
...(state.timestamp.start && {
|
|
53
|
-
greaterThanOrEqual: new TZDateMini(startOfDay(state.timestamp.start), localeInfo.timezone).toISOString(),
|
|
54
|
-
}),
|
|
55
|
-
...(state.timestamp.end && {
|
|
56
|
-
lesserThanOrEqual: new TZDateMini(endOfDay(state.timestamp.end), localeInfo.timezone).toISOString(),
|
|
57
|
-
}),
|
|
58
|
-
},
|
|
59
|
-
}),
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
return (_jsxs("div", { className: props.className, children: [_jsx("h2", { className: "text-sm font-semibold leading-tight lg:text-lg", children: "Bet Records" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm leading-tight", children: "Review your betting history" }), _jsx("div", { className: "mt-lg lg:mt-2xl", children: _jsxs(SegmentGroup.Root, { value: state.type ?? 'all', onValueChange: (details) => {
|
|
63
|
-
firstPage();
|
|
64
|
-
setState({
|
|
65
|
-
type: z.enum(GAME_TYPES).safeParse(details.value).data ?? null,
|
|
66
|
-
});
|
|
67
|
-
}, className: "w-full overflow-x-auto lg:w-fit", children: [_jsxs(SegmentGroup.Item, { value: "all", children: [_jsx(SegmentGroup.ItemText, { children: "All" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), gameTypes.map((type) => (_jsxs(SegmentGroup.Item, { value: type.id, children: [_jsx(SegmentGroup.ItemText, { children: type.name }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }, type.id))), _jsx(SegmentGroup.Indicator, {})] }) }), _jsx("div", { className: "border-border-secondary mt-2xl hidden border-t lg:block" }), _jsx("h3", { className: "text-text-secondary-700 mt-3xl text-sm font-semibold", children: "Table" }), _jsxs("div", { className: "mt-xl flex flex-col gap-lg lg:flex-row lg:items-center", children: [_jsxs(DatePicker.Root, { lazyMount: true, unmountOnExit: true, value: [state.timestamp?.start, state.timestamp?.end]
|
|
68
|
-
.filter(Boolean)
|
|
69
|
-
.map((d) => parseDate(d)), onValueChange: (details) => {
|
|
70
|
-
firstPage();
|
|
71
|
-
setState({
|
|
72
|
-
timestamp: {
|
|
73
|
-
start: details.value.at(0)?.toDate(DEVICE_TIMEZONE),
|
|
74
|
-
end: details.value.at(1)?.toDate(DEVICE_TIMEZONE),
|
|
75
|
-
},
|
|
76
|
-
});
|
|
77
|
-
}, onOpenChange: (details) => {
|
|
78
|
-
if (details.open)
|
|
79
|
-
return;
|
|
80
|
-
if (state.timestamp)
|
|
81
|
-
return;
|
|
82
|
-
setTab('all');
|
|
83
|
-
}, selectionMode: "range", closeOnSelect: false, positioning: {
|
|
84
|
-
gutter: 20,
|
|
85
|
-
placement: 'bottom',
|
|
86
|
-
}, children: [_jsxs(SegmentGroup.Root, { value: tab, onValueChange: (details) => {
|
|
87
|
-
const value = TabDefinition.parse(details.value);
|
|
88
|
-
if (value === 'today') {
|
|
89
|
-
const now = new Date();
|
|
90
|
-
setState({
|
|
91
|
-
timestamp: {
|
|
92
|
-
start: startOfDay(now),
|
|
93
|
-
end: endOfDay(now),
|
|
94
|
-
},
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
setState({
|
|
99
|
-
timestamp: null,
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
firstPage();
|
|
103
|
-
setTab(value);
|
|
104
|
-
}, className: "w-full lg:w-fit", children: [_jsxs(SegmentGroup.Item, { value: "all", className: "w-full lg:w-auto", children: [_jsx(SegmentGroup.ItemText, { children: "All" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsxs(SegmentGroup.Item, { value: "today", className: "w-full lg:w-auto", children: [_jsx(SegmentGroup.ItemText, { children: "Today" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsx(DatePicker.Context, { children: (api) => (_jsx(SegmentGroup.Item, { value: "custom", onClick: () => api.setOpen(true), className: "w-full lg:w-auto", children: _jsxs(DatePicker.Control, { children: [_jsx(SegmentGroup.ItemText, { children: "Custom" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }) })) }), _jsx(SegmentGroup.Indicator, {})] }), _jsx(Portal, { children: _jsx(DatePicker.Positioner, { children: _jsx(DatePicker.Content, { children: _jsx(DatePicker.View, { view: "day", children: _jsx(DatePicker.Context, { children: (api) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsxs(DatePicker.Table, { children: [_jsx(DatePicker.TableHead, { children: _jsx(DatePicker.TableRow, { children: api.weekDays.map((weekDay, id) => (_jsx(DatePicker.TableHeader, { children: weekDay.short.substring(0, 2) }, id))) }) }), _jsx(DatePicker.TableBody, { children: api.weeks.map((week, id) => (_jsx(DatePicker.TableRow, { children: week.map((day, id) => (_jsx(DatePicker.TableCell, { value: day, children: _jsx(DatePicker.TableCellTrigger, { children: day.day }) }, id))) }, id))) })] })] })) }) }) }) }) })] }), _jsx("div", { className: "hidden grow lg:block" }), _jsxs(Select.Root, { collection: providerCollection, value: state.provider ? [state.provider] : [], onValueChange: (details) => {
|
|
105
|
-
const value = z
|
|
106
|
-
.enum((props.gameProviders ?? []))
|
|
107
|
-
.safeParse(details.value.at(0)).data;
|
|
108
|
-
firstPage();
|
|
109
|
-
setState({
|
|
110
|
-
provider: value ?? null,
|
|
111
|
-
});
|
|
112
|
-
}, lazyMount: true, deselectable: true, positioning: {
|
|
113
|
-
sameWidth: true,
|
|
114
|
-
}, children: [_jsxs(Select.Trigger, { className: "w-full lg:w-[14rem]", children: [_jsx(Select.ValueText, { placeholder: "Game Vendor" }), _jsx(Select.Context, { children: (api) => (_jsx(_Fragment, { children: api.value.length ? (_jsx(Select.ClearTrigger, { asChild: true, children: _jsx("span", { onClick: (e) => {
|
|
115
|
-
e.stopPropagation();
|
|
116
|
-
}, children: "Clear" }) })) : (_jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })) })) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: providerCollection.items.map((provider) => (_jsxs(Select.Item, { item: provider, children: [_jsx(Select.ItemText, { children: provider.name }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, provider.id))) }) }) }) })] }), _jsxs(Select.Root, { collection: statusCollection, value: state.status ? [state.status] : [], onValueChange: (details) => {
|
|
117
|
-
const value = z
|
|
118
|
-
.enum(BET_RECORD_STATUSES)
|
|
119
|
-
.safeParse(details.value.at(0)).data;
|
|
120
|
-
firstPage();
|
|
121
|
-
setState({
|
|
122
|
-
status: value ?? null,
|
|
123
|
-
});
|
|
124
|
-
}, lazyMount: true, deselectable: true, positioning: {
|
|
125
|
-
sameWidth: true,
|
|
126
|
-
}, children: [_jsxs(Select.Trigger, { className: "w-full lg:w-[14rem]", children: [_jsx(Select.ValueText, { placeholder: "Status" }), _jsx(Select.Context, { children: (api) => (_jsx(_Fragment, { children: api.value.length ? (_jsx(Select.ClearTrigger, { asChild: true, children: _jsx("span", { onClick: (e) => {
|
|
127
|
-
e.stopPropagation();
|
|
128
|
-
}, children: "Clear" }) })) : (_jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })) })) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: statusCollection.items.map((status) => (_jsxs(Select.Item, { item: status, children: [_jsx(Select.ItemText, { children: capitalize(status, {
|
|
129
|
-
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
130
|
-
}) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, status))) }) }) }) })] })] }), rows.length <= 0 && (_jsx(Empty, { icon: loading ? SpinnerIcon : File02Icon, title: loading ? 'Just a moment' : 'No data', message: loading
|
|
131
|
-
? 'Fetching latest bet records...'
|
|
132
|
-
: 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-xl', 'border-y', 'border-border-secondary', 'bleed', 'lg:not-bleed', 'lg:mt-3xl', 'lg:w-full', 'lg:rounded-xl', 'lg:border-x'), children: [_jsx("div", { className: "border-border-secondary scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent scrollbar:h-2 scrollbar-thumb:rounded-full overflow-hidden overflow-x-auto rounded-none border-b lg:rounded-t-xl", children: _jsxs(Table.Root, { className: "border-0", children: [_jsx(Table.Header, { children: _jsxs(Table.Row, { children: [_jsx(Table.Heading, { children: "Bet Time" }), _jsx(Table.Heading, { children: "Settlement Time" }), _jsx(Table.Heading, { children: "Bet Content" }), _jsx(Table.Heading, { children: "Odds" }), _jsx(Table.Heading, { children: "Bet Amount" }), _jsx(Table.Heading, { children: "Valid Bet" }), _jsx(Table.Heading, { children: "Settled Amount" }), _jsx(Table.Heading, { children: "Jackpot Contribution" }), _jsx(Table.Heading, { children: "Jackpot Payout" }), _jsx(Table.Heading, { children: "Bet Status" }), _jsx(Table.Heading, { children: "Game Name" }), _jsx(Table.Heading, { children: "Vendor Round ID" })] }) }), _jsx(Table.Body, { children: rows.map((data) => (_jsxs(Table.Row, { children: [_jsxs(Table.Cell, { className: "!py-1", children: [_jsx("div", { className: "leading-tight", children: format(data.dateTimeCreated, 'MM/dd/yyyy', {
|
|
133
|
-
in: tz(localeInfo.timezone),
|
|
134
|
-
}) }), _jsx("div", { className: "text-text-tertiary-600 leading-tight", children: format(data.dateTimeCreated, 'hh:mm a', {
|
|
135
|
-
in: tz(localeInfo.timezone),
|
|
136
|
-
}) })] }), _jsx(Table.Cell, { className: "!py-1", children: !!data.dateTimeSettled && (_jsxs(_Fragment, { children: [_jsx("div", { className: "leading-tight", children: format(data.dateTimeSettled, 'MM/dd/yyyy', {
|
|
137
|
-
in: tz(localeInfo.timezone),
|
|
138
|
-
}) }), _jsx("div", { className: "text-text-tertiary-600 leading-tight", children: format(data.dateTimeSettled, 'hh:mm a', {
|
|
139
|
-
in: tz(localeInfo.timezone),
|
|
140
|
-
}) })] })) }), _jsx(Table.Cell, { className: "!py-1", children: data?.betContent || '/' }), _jsx(Table.Cell, { className: "!py-1", children: data.metadata?.odds || '/' }), _jsx(Table.Cell, { className: "!py-1", children: formatNumber(data.bet, {
|
|
141
|
-
currency: localeInfo.currency.code,
|
|
142
|
-
minDecimalPlaces: 2,
|
|
143
|
-
}) }), _jsx(Table.Cell, { className: "!py-1", children: formatNumber(data.validBet, {
|
|
144
|
-
currency: localeInfo.currency.code,
|
|
145
|
-
minDecimalPlaces: 2,
|
|
146
|
-
}) }), _jsx(Table.Cell, { className: "!py-1", children: formatNumber(data.payout, {
|
|
147
|
-
currency: localeInfo.currency.code,
|
|
148
|
-
minDecimalPlaces: 2,
|
|
149
|
-
}) }), _jsx(Table.Cell, { className: "!py-1", children: formatNumber(data.jackpotContribution, {
|
|
150
|
-
currency: localeInfo.currency.code,
|
|
151
|
-
minDecimalPlaces: 2,
|
|
152
|
-
}) }), _jsx(Table.Cell, { className: "!py-1", children: formatNumber(data.jackpotPayout, {
|
|
153
|
-
currency: localeInfo.currency.code,
|
|
154
|
-
minDecimalPlaces: 2,
|
|
155
|
-
}) }), _jsx(Table.Cell, { className: "!py-1", children: _jsx(Badge.Root, { colorScheme: data.status === 'SETTLED'
|
|
156
|
-
? 'success'
|
|
157
|
-
: data.status === 'STARTED'
|
|
158
|
-
? 'blue'
|
|
159
|
-
: 'danger', children: _jsx(Badge.Label, { children: capitalize(data.status, {
|
|
160
|
-
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
161
|
-
}) }) }) }), _jsx(Table.Cell, { className: "!py-1", children: data.game.name }), _jsx(Table.Cell, { className: "!py-1", children: data.vendorRoundId })] }, data.id))) })] }) }), _jsxs("div", { className: "flex items-center justify-between gap-lg px-4 py-3", children: [_jsx(IconButton, { size: "xs", variant: "outline", colorScheme: "gray", disabled: !hasPrevPage || loading, onClick: () => prev(), children: _jsx(ChevronLeftIcon, { className: "size-5" }) }), _jsxs("p", { className: "text-text-secondary-700 text-sm font-medium", children: ["Page ", page, " of ", totalPages] }), _jsx(IconButton, { size: "xs", variant: "outline", colorScheme: "gray", disabled: !hasNextPage || loading, onClick: () => next(), children: _jsx(ChevronRightIcon, { className: "size-5" }) })] })] }))] }));
|
|
9
|
+
return _jsx(BetRecords__client, { ...props });
|
|
162
10
|
}
|
|
163
|
-
const BET_RECORD_STATUSES = [
|
|
164
|
-
'CANCELLED',
|
|
165
|
-
'SETTLED',
|
|
166
|
-
'STARTED',
|
|
167
|
-
];
|
|
168
|
-
const statusCollection = createListCollection({
|
|
169
|
-
items: BET_RECORD_STATUSES,
|
|
170
|
-
itemToValue: (item) => item,
|
|
171
|
-
itemToString: (item) => capitalize(item, {
|
|
172
|
-
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
173
|
-
}),
|
|
174
|
-
});
|
|
175
|
-
const TabDefinition = z.enum(['all', 'today', 'custom']);
|
|
176
|
-
const DEVICE_TIMEZONE = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
export interface BonusProps {
|
|
2
|
+
id: string;
|
|
3
|
+
className?: string;
|
|
4
|
+
/**
|
|
5
|
+
* @description URL for the bonuses details page
|
|
6
|
+
* @default "/rewards"
|
|
7
|
+
*/
|
|
8
|
+
viewAllUrl?: string;
|
|
9
|
+
}
|
|
2
10
|
export declare function Bonus__client(props: BonusProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -3,11 +3,20 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { clamp } from 'lodash-es';
|
|
4
4
|
import Image from 'next/image';
|
|
5
5
|
import Link from 'next/link';
|
|
6
|
-
import { useBonusQuery
|
|
7
|
-
import {
|
|
6
|
+
import { useBonusQuery } from '../../client/hooks/useBonusQuery.js';
|
|
7
|
+
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
8
|
+
import { useRemainingTime } from '../../client/hooks/useRemainingTime.js';
|
|
9
|
+
import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
|
|
10
|
+
import { ChevronRightIcon } from '../../icons/ChevronRightIcon.js';
|
|
11
|
+
import { StopWatchIcon } from '../../icons/StopWatchIcon.js';
|
|
8
12
|
import piggyBank from '../../images/piggy-bank.png';
|
|
9
|
-
import { Badge
|
|
10
|
-
import {
|
|
13
|
+
import { Badge } from '../../ui/Badge/index.js';
|
|
14
|
+
import { Collapsible } from '../../ui/Collapsible/index.js';
|
|
15
|
+
import { Progress } from '../../ui/Progress/index.js';
|
|
16
|
+
import { Prose } from '../../ui/Prose.js';
|
|
17
|
+
import { capitalize } from '../../utils/capitalize.js';
|
|
18
|
+
import { formatNumber } from '../../utils/formatNumber.js';
|
|
19
|
+
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
11
20
|
export function Bonus__client(props) {
|
|
12
21
|
const bonusQuery = useBonusQuery(props.id);
|
|
13
22
|
const bonus = bonusQuery.data;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
id: string;
|
|
3
|
-
className?: string;
|
|
4
|
-
/**
|
|
5
|
-
* @description URL for the bonuses details page
|
|
6
|
-
* @default "/rewards"
|
|
7
|
-
*/
|
|
8
|
-
viewAllUrl?: string;
|
|
9
|
-
}
|
|
1
|
+
import { type BonusProps } from './Bonus.client';
|
|
10
2
|
export declare function Bonus(props: BonusProps): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
3
|
+
export type { BonusProps };
|
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { notFound } from 'next/navigation';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { getSession } from '../../server/services/getSession.js';
|
|
4
|
+
import { prefetchBonusQuery } from '../../server/utils/prefetchBonusQuery.js';
|
|
5
|
+
import { getBonus } from '../../services/wallet.js';
|
|
5
6
|
import { Bonus__client } from './Bonus.client.js';
|
|
7
|
+
async function fetchBonus(id) {
|
|
8
|
+
const session = await getSession();
|
|
9
|
+
if (session.status === 'unauthenticated')
|
|
10
|
+
return null;
|
|
11
|
+
return await getBonus(id, {
|
|
12
|
+
headers: {
|
|
13
|
+
Authorization: `Bearer ${session.token}`,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
}
|
|
6
17
|
export async function Bonus(props) {
|
|
7
|
-
await
|
|
8
|
-
|
|
9
|
-
|
|
18
|
+
const [result] = await Promise.allSettled([
|
|
19
|
+
fetchBonus(props.id),
|
|
20
|
+
prefetchBonusQuery(props.id),
|
|
21
|
+
]);
|
|
22
|
+
if (result.status === 'fulfilled' && result.value) {
|
|
23
|
+
return _jsx(Bonus__client, { ...props });
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
10
26
|
return notFound();
|
|
11
|
-
|
|
27
|
+
}
|
|
12
28
|
}
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
export interface BonusesProps {
|
|
2
|
+
heading?: string;
|
|
3
|
+
className?: string;
|
|
4
|
+
/**
|
|
5
|
+
* @description base URL for the bonus details page
|
|
6
|
+
* @default "/rewards"
|
|
7
|
+
*/
|
|
8
|
+
viewBonusDetailsUrl?: string;
|
|
9
|
+
}
|
|
2
10
|
export declare function Bonuses__client(props: BonusesProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,12 +6,22 @@ import Image from 'next/image';
|
|
|
6
6
|
import Link from 'next/link';
|
|
7
7
|
import { useState } from 'react';
|
|
8
8
|
import { z } from 'zod';
|
|
9
|
-
import { useBonusesQuery
|
|
10
|
-
import {
|
|
9
|
+
import { useBonusesQuery } from '../../client/hooks/useBonusesQuery.js';
|
|
10
|
+
import { useCashbackBonusesQuery } from '../../client/hooks/useCashbackBonusesQuery.js';
|
|
11
|
+
import { useClaimCashbackBonusMutation } from '../../client/hooks/useClaimCashbackBonusMutation.js';
|
|
12
|
+
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
13
|
+
import { useRemainingTime } from '../../client/hooks/useRemainingTime.js';
|
|
14
|
+
import { Gift01Icon } from '../../icons/Gift01Icon.js';
|
|
15
|
+
import { StopWatchIcon } from '../../icons/StopWatchIcon.js';
|
|
11
16
|
import moneyOnHand from '../../images/money-on-hand.png';
|
|
12
17
|
import piggyBank from '../../images/piggy-bank.png';
|
|
13
|
-
import { Badge
|
|
14
|
-
import {
|
|
18
|
+
import { Badge } from '../../ui/Badge/index.js';
|
|
19
|
+
import { Button } from '../../ui/Button/index.js';
|
|
20
|
+
import { Progress } from '../../ui/Progress/index.js';
|
|
21
|
+
import { SegmentGroup } from '../../ui/SegmentGroup/index.js';
|
|
22
|
+
import { capitalize } from '../../utils/capitalize.js';
|
|
23
|
+
import { formatNumber } from '../../utils/formatNumber.js';
|
|
24
|
+
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
15
25
|
import { Empty } from '../Empty.js';
|
|
16
26
|
const TABS = ['ALL', 'ACTIVE', 'CASHBACKS'];
|
|
17
27
|
export function Bonuses__client(props) {
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
heading?: string;
|
|
3
|
-
className?: string;
|
|
4
|
-
/**
|
|
5
|
-
* @description base URL for the bonus details page
|
|
6
|
-
* @default "/rewards"
|
|
7
|
-
*/
|
|
8
|
-
viewBonusDetailsUrl?: string;
|
|
9
|
-
}
|
|
1
|
+
import { type BonusesProps } from './Bonuses.client';
|
|
10
2
|
export declare function Bonuses(props: BonusesProps): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
3
|
+
export type { BonusesProps };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { prefetchBonusesQuery
|
|
2
|
+
import { prefetchBonusesQuery } from '../../server/utils/prefetchBonusesQuery.js';
|
|
3
|
+
import { prefetchCashbacksQuery } from '../../server/utils/prefetchCashbacksQuery.js';
|
|
3
4
|
import { Bonuses__client } from './Bonuses.client.js';
|
|
4
5
|
export async function Bonuses(props) {
|
|
5
|
-
await Promise.
|
|
6
|
+
await Promise.allSettled([prefetchBonusesQuery(), prefetchCashbacksQuery()]);
|
|
6
7
|
return _jsx(Bonuses__client, { ...props });
|
|
7
8
|
}
|
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import Link from 'next/link';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useBonusesCountQuery } from '../../client/hooks/useBonusesCountQuery.js';
|
|
6
|
+
import { useCashbackBonusesCountQuery } from '../../client/hooks/useCashbackBonusesCountQuery.js';
|
|
7
|
+
import { Gift01Icon } from '../../icons/Gift01Icon.js';
|
|
7
8
|
import { iconButtonRecipe } from '../../ui/IconButton/iconButton.recipe.js';
|
|
8
9
|
export function BonusesTrigger({ children, className, ...props }) {
|
|
9
|
-
const
|
|
10
|
+
const bonusesCountQuery = useBonusesCountQuery({
|
|
10
11
|
refetchInterval: 10000,
|
|
11
12
|
});
|
|
12
|
-
const
|
|
13
|
+
const cashbackBonusesCountQuery = useCashbackBonusesCountQuery({
|
|
13
14
|
refetchInterval: 10000,
|
|
14
15
|
});
|
|
15
|
-
const bonusesCount =
|
|
16
|
-
const cashbackBonusesCount =
|
|
16
|
+
const bonusesCount = bonusesCountQuery.data ?? 0;
|
|
17
|
+
const cashbackBonusesCount = cashbackBonusesCountQuery.data ?? 0;
|
|
17
18
|
const totalCount = bonusesCount + cashbackBonusesCount;
|
|
18
19
|
return (_jsx(Link, { "aria-label": "View Rewards", "data-count": totalCount, ...props, href: props.href ?? '/rewards', className: iconButtonRecipe({
|
|
19
20
|
size: 'sm',
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
export interface CashbackProps {
|
|
2
|
+
id: string;
|
|
3
|
+
/** @default '/promos' */
|
|
4
|
+
viewAllPromosUrl?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
2
7
|
export declare function Cashback__client(props: CashbackProps): 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 { useCashbackQuery } from '../../client/hooks/useCashbackQuery.js';
|
|
10
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
11
|
+
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.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 Cashback__client(props) {
|
|
12
16
|
const availablePromosQuery = useAvailablePromosQuery();
|
|
13
17
|
const cashbackQuery = useCashbackQuery(props.id);
|