@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
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useMemo } from 'react';
|
|
3
3
|
import { twMerge } from 'tailwind-merge';
|
|
4
|
-
import { useLocaleInfo } from '../../../client/hooks/index.js';
|
|
5
4
|
import { useJackpotPayoutsQuery } from '../../../client/hooks/useJackpotPayoutsQuery.js';
|
|
5
|
+
import { useLocaleInfo } from '../../../client/hooks/useLocaleInfo.js';
|
|
6
6
|
import { GAME_PROVIDER_DATA } from '../../../constants/index.js';
|
|
7
|
-
import { ChevronLeftIcon
|
|
7
|
+
import { ChevronLeftIcon } from '../../../icons/ChevronLeftIcon.js';
|
|
8
|
+
import { ChevronRightIcon } from '../../../icons/ChevronRightIcon.js';
|
|
8
9
|
import { useJackpotsListItemContext, useJackpotsListPropsContext, } from './JackpotsListContext.js';
|
|
9
10
|
import styles from './JackpotsListItem.module.css';
|
|
10
11
|
export function useJackpotsListItemData() {
|
|
@@ -56,28 +57,6 @@ export function useJackpotsListItemData() {
|
|
|
56
57
|
? 'The jackpot is heating up! Keep playing to stay in the action and watch it grow!'
|
|
57
58
|
: '🔥 It’s about to pop! Stay in the game for your shot at the prize!';
|
|
58
59
|
};
|
|
59
|
-
const starTierStyles = [
|
|
60
|
-
{
|
|
61
|
-
starColor: 'text-yellow-400',
|
|
62
|
-
numberColor: 'text-bg-primary',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
starColor: 'text-utility-gray-700',
|
|
66
|
-
numberColor: 'text-bg-primary',
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
starColor: 'text-yellow-700',
|
|
70
|
-
numberColor: 'text-bg-primary',
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
starColor: 'text-bg-quaternary',
|
|
74
|
-
numberColor: 'text-text-primary-900',
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
starColor: 'text-bg-quaternary',
|
|
78
|
-
numberColor: 'text-text-primary-900',
|
|
79
|
-
},
|
|
80
|
-
];
|
|
81
60
|
return {
|
|
82
61
|
jackpotPayouts,
|
|
83
62
|
topJackpotPayout,
|
|
@@ -87,6 +66,5 @@ export function useJackpotsListItemData() {
|
|
|
87
66
|
jackpotAmount,
|
|
88
67
|
arrowImages,
|
|
89
68
|
getAccumulatingJackpotDescription,
|
|
90
|
-
starTierStyles,
|
|
91
69
|
};
|
|
92
70
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare function useJackpotData(): {
|
|
2
|
-
jackpotPayouts: import("
|
|
3
|
-
topJackpotPayout: import("
|
|
2
|
+
jackpotPayouts: import("@opexa/portal-sdk-core").JackpotPayout[];
|
|
3
|
+
topJackpotPayout: import("@opexa/portal-sdk-core").JackpotPayout;
|
|
4
4
|
filteredGameProviders: import("../../types").GameProviderData[];
|
|
5
5
|
localeInfo: import("../../utils").LocaleInfo;
|
|
6
6
|
isPayingOut: boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Jackpot } from '@opexa/portal-sdk-core';
|
|
2
|
+
import type { GameProviderData } from '../../types';
|
|
3
|
+
export interface JackpotItemProps {
|
|
4
|
+
jackpot: Jackpot;
|
|
5
|
+
gameProviders: GameProviderData[];
|
|
6
|
+
}
|
|
7
|
+
export declare function useJackpotItemData({ jackpot, gameProviders, }: JackpotItemProps): {
|
|
8
|
+
jackpotPayouts: import("@opexa/portal-sdk-core").JackpotPayout[];
|
|
9
|
+
topJackpotPayout: import("@opexa/portal-sdk-core").JackpotPayout;
|
|
10
|
+
filteredGameProviders: GameProviderData[];
|
|
11
|
+
localeInfo: import("../../utils").LocaleInfo;
|
|
12
|
+
isPayingOut: boolean;
|
|
13
|
+
jackpotAmount: string;
|
|
14
|
+
arrowImages: import("react/jsx-runtime").JSX.Element[];
|
|
15
|
+
getAccumulatingJackpotDescription: (part: number, total: number) => string;
|
|
16
|
+
starTierStyles: {
|
|
17
|
+
starColor: string;
|
|
18
|
+
numberColor: string;
|
|
19
|
+
}[];
|
|
20
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo } from 'react';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { useLocaleInfo } from '../../client/hooks/index.js';
|
|
5
|
+
import { useJackpotPayoutsQuery } from '../../client/hooks/useJackpotPayoutsQuery.js';
|
|
6
|
+
import { ChevronLeftIcon, ChevronRightIcon } from '../../icons/index.js';
|
|
7
|
+
import styles from '../JackpotCounter/JackpotCounterItem.module.css';
|
|
8
|
+
export function useJackpotItemData({ jackpot, gameProviders, }) {
|
|
9
|
+
const jackpotPayoutsQuery = useJackpotPayoutsQuery({
|
|
10
|
+
first: 30,
|
|
11
|
+
filter: {
|
|
12
|
+
jackpot: {
|
|
13
|
+
equal: jackpot.id,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
sort: {
|
|
17
|
+
cursor: 'AMOUNT',
|
|
18
|
+
order: 'DESC',
|
|
19
|
+
},
|
|
20
|
+
}, {
|
|
21
|
+
enabled: typeof window !== 'undefined',
|
|
22
|
+
});
|
|
23
|
+
const jackpotPayouts = jackpotPayoutsQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
|
|
24
|
+
const topJackpotPayout = jackpotPayouts[0] ?? [];
|
|
25
|
+
const enabledJackpotGameProviders = useMemo(() => {
|
|
26
|
+
const gameProvider = Object.entries(jackpot?.jackpotTurnoverContributionPercentagePerGameProvider ?? {})
|
|
27
|
+
.filter(([, value]) => Number(value) > 0)
|
|
28
|
+
.map(([key]) => key);
|
|
29
|
+
return gameProvider;
|
|
30
|
+
}, [jackpot]);
|
|
31
|
+
const filteredGameProviders = gameProviders.filter((provider) => enabledJackpotGameProviders.includes(provider.id));
|
|
32
|
+
const localeInfo = useLocaleInfo();
|
|
33
|
+
const isPayingOut = jackpot.drawing;
|
|
34
|
+
const jackpotAmount = isPayingOut
|
|
35
|
+
? jackpot.maximumJackpotPoolLimit
|
|
36
|
+
: jackpot.pool;
|
|
37
|
+
const Arrow = useCallback(({ index }) => {
|
|
38
|
+
const Icon = isPayingOut ? ChevronLeftIcon : ChevronRightIcon;
|
|
39
|
+
return (_jsx(Icon, { className: twMerge('scale-400 lg:scale-250 text-brand-300 min-w-2.5 lg:min-w-4', isPayingOut
|
|
40
|
+
? styles['animate-wave-color-error']
|
|
41
|
+
: styles['animate-wave-color-success']), style: {
|
|
42
|
+
animationDelay: isPayingOut
|
|
43
|
+
? `${(40 - index - 1) * 0.1}s`
|
|
44
|
+
: `${index * 0.1}s`,
|
|
45
|
+
} }));
|
|
46
|
+
}, [isPayingOut]);
|
|
47
|
+
const arrowImages = useMemo(() => Array.from({ length: 40 }, (_, i) => (_jsx(Arrow, { isFirst: i === 0, index: i }, i))), [Arrow]);
|
|
48
|
+
const getAccumulatingJackpotDescription = (part, total) => {
|
|
49
|
+
const percentage = total === 0 ? 0 : (part / total) * 100;
|
|
50
|
+
return percentage <= 90
|
|
51
|
+
? 'The jackpot is heating up! Keep playing to stay in the action and watch it grow!'
|
|
52
|
+
: '🔥 It’s about to pop! Stay in the game for your shot at the prize!';
|
|
53
|
+
};
|
|
54
|
+
const starTierStyles = [
|
|
55
|
+
{
|
|
56
|
+
starColor: 'text-yellow-400',
|
|
57
|
+
numberColor: 'text-bg-primary',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
starColor: 'text-utility-gray-700',
|
|
61
|
+
numberColor: 'text-bg-primary',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
starColor: 'text-yellow-700',
|
|
65
|
+
numberColor: 'text-bg-primary',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
starColor: 'text-bg-quaternary',
|
|
69
|
+
numberColor: 'text-text-primary-900',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
starColor: 'text-bg-quaternary',
|
|
73
|
+
numberColor: 'text-text-primary-900',
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
return {
|
|
77
|
+
jackpotPayouts,
|
|
78
|
+
topJackpotPayout,
|
|
79
|
+
filteredGameProviders,
|
|
80
|
+
localeInfo,
|
|
81
|
+
isPayingOut,
|
|
82
|
+
jackpotAmount,
|
|
83
|
+
arrowImages,
|
|
84
|
+
getAccumulatingJackpotDescription,
|
|
85
|
+
starTierStyles,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ChevronLeftIcon
|
|
3
|
-
import {
|
|
2
|
+
import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
|
|
3
|
+
import { XIcon } from '../../icons/XIcon.js';
|
|
4
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
5
|
+
import { IconButton } from '../../ui/IconButton/index.js';
|
|
4
6
|
export function Header() {
|
|
5
7
|
return (_jsx(Dialog.Context, { children: (api) => (_jsxs("div", { className: "bg-bg-primary-alt relative flex items-center gap-xl px-xl py-md lg:justify-center lg:bg-transparent lg:p-0", children: [_jsx(IconButton, { size: "2xs", variant: "outline", colorScheme: "gray", className: "lg:hidden", onClick: () => api.setOpen(false), children: _jsx(ChevronLeftIcon, {}) }), _jsx(Dialog.Title, { className: "text-lg font-semibold", children: "Personal Verification" }), _jsx("button", { type: "button", className: "text-text-quinary absolute right-0 top-1/2 hidden -translate-y-1/2 lg:block", onClick: () => api.setOpen(false), children: _jsx(XIcon, { className: "size-6" }) })] })) }));
|
|
6
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { noop } from 'lodash-es';
|
|
3
|
-
import { ArrowLeftIcon } from '../../icons/
|
|
4
|
-
import { Progress } from '../../ui/index.js';
|
|
3
|
+
import { ArrowLeftIcon } from '../../icons/ArrowLeftIcon.js';
|
|
4
|
+
import { Progress } from '../../ui/Progress/index.js';
|
|
5
5
|
import { useKYCContext } from './KYCContext.js';
|
|
6
6
|
export function Indicator() {
|
|
7
7
|
const context = useKYCContext();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function KYC(): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare function KYC(): import("react/jsx-runtime").JSX.Element | undefined;
|
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx
|
|
3
|
-
import
|
|
4
|
-
import { twMerge } from 'tailwind-merge';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import dynamic from 'next/dynamic';
|
|
5
4
|
import { useShallow } from 'zustand/shallow';
|
|
6
|
-
import { useGlobalStore } from '../../client/hooks/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import { Step1 } from './Step1.js';
|
|
12
|
-
import { Step2 } from './Step2.js';
|
|
13
|
-
import { Step3 } from './Step3.js';
|
|
14
|
-
import { Step4 } from './Step4.js';
|
|
15
|
-
import { useKYC } from './useKYC.js';
|
|
5
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
6
|
+
const Component = dynamic(() => import('./KYC.lazy.js').then((m) => m.KYC), {
|
|
7
|
+
ssr: false,
|
|
8
|
+
loading: () => null,
|
|
9
|
+
});
|
|
16
10
|
export function KYC() {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const context = useKYC();
|
|
21
|
-
return (_jsx(KYCContext, { value: context, children: _jsx(Dialog.Root, { open: globalStore.kyc.open, onOpenChange: (details) => {
|
|
22
|
-
globalStore.kyc.setOpen(details.open);
|
|
23
|
-
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { className: twMerge(context.step === 4 && 'flex items-center'), children: _jsxs(Dialog.Content, { className: twMerge(context.step < 4
|
|
24
|
-
? 'bg-bg-primary lg:bg-bg-primary-alt mx-auto h-full w-full lg:h-auto lg:w-[400px] lg:p-3xl'
|
|
25
|
-
: 'mx-auto w-[25rem] max-w-[calc(100%-2rem)] p-3xl'), children: [context.step < 4 && _jsx(Header, {}), context.step < 4 && _jsx(Indicator, {}), context.step === 1 && _jsx(Step1, {}), context.step === 2 && _jsx(Step2, {}), context.step === 3 && _jsx(Step3, {}), context.step === 4 && _jsx(Step4, {})] }) })] }) }) }));
|
|
11
|
+
const touched = useGlobalStore(useShallow((ctx) => ctx.kyc['~touched']));
|
|
12
|
+
if (touched)
|
|
13
|
+
return _jsx(Component, {});
|
|
26
14
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function KYC(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Portal } from '@ark-ui/react';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { useShallow } from 'zustand/shallow';
|
|
6
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
7
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
8
|
+
import { Header } from './Header.js';
|
|
9
|
+
import { Indicator } from './Indicator.js';
|
|
10
|
+
import { KYCContext } from './KYCContext.js';
|
|
11
|
+
import { Step1 } from './Step1.js';
|
|
12
|
+
import { Step2 } from './Step2.js';
|
|
13
|
+
import { Step3 } from './Step3.js';
|
|
14
|
+
import { Step4 } from './Step4.js';
|
|
15
|
+
import { useKYC } from './useKYC.js';
|
|
16
|
+
export function KYC() {
|
|
17
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
18
|
+
kyc: ctx.kyc,
|
|
19
|
+
})));
|
|
20
|
+
const context = useKYC();
|
|
21
|
+
return (_jsx(KYCContext, { value: context, children: _jsx(Dialog.Root, { open: globalStore.kyc.open, onOpenChange: (details) => {
|
|
22
|
+
globalStore.kyc.setOpen(details.open);
|
|
23
|
+
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { className: twMerge(context.step === 4 && 'flex items-center'), children: _jsxs(Dialog.Content, { className: twMerge(context.step < 4
|
|
24
|
+
? 'bg-bg-primary lg:bg-bg-primary-alt mx-auto h-full w-full lg:h-auto lg:w-[400px] lg:p-3xl'
|
|
25
|
+
: 'mx-auto w-[25rem] max-w-[calc(100%-2rem)] p-3xl'), children: [context.step < 4 && _jsx(Header, {}), context.step < 4 && _jsx(Indicator, {}), context.step === 1 && _jsx(Step1, {}), context.step === 2 && _jsx(Step2, {}), context.step === 3 && _jsx(Step3, {}), context.step === 4 && _jsx(Step4, {})] }) })] }) }) }));
|
|
26
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { createContext } from '../../client/utils/
|
|
1
|
+
import { createContext } from '../../client/utils/createContext.js';
|
|
2
2
|
export const [KYCContext, useKYCContext] = createContext();
|
|
@@ -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 KYCTrigger(props) {
|
|
7
7
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
8
8
|
kyc: ctx.kyc,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import Image from 'next/image';
|
|
3
|
-
import { CheckIcon
|
|
3
|
+
import { CheckIcon } from '../../icons/CheckIcon.js';
|
|
4
|
+
import { XIcon } from '../../icons/XIcon.js';
|
|
4
5
|
import uploadId from '../../images/capture-id-banner.png';
|
|
5
|
-
import { Button } from '../../ui/index.js';
|
|
6
|
+
import { Button } from '../../ui/Button/index.js';
|
|
6
7
|
import { useKYCContext } from './KYCContext.js';
|
|
7
8
|
export function Step1() {
|
|
8
9
|
const context = useKYCContext();
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import Image from 'next/image';
|
|
3
|
-
import { CheckIcon
|
|
3
|
+
import { CheckIcon } from '../../icons/CheckIcon.js';
|
|
4
|
+
import { XIcon } from '../../icons/XIcon.js';
|
|
4
5
|
import selfie from '../../images/capture-selfie-banner.png';
|
|
5
|
-
import { Button } from '../../ui/index.js';
|
|
6
|
+
import { Button } from '../../ui/Button/index.js';
|
|
6
7
|
import { useKYCContext } from './KYCContext.js';
|
|
7
8
|
export function Step2() {
|
|
8
9
|
const context = useKYCContext();
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { CheckIcon } from '../../icons/
|
|
3
|
-
import { Button
|
|
2
|
+
import { CheckIcon } from '../../icons/CheckIcon.js';
|
|
3
|
+
import { Button } from '../../ui/Button/index.js';
|
|
4
|
+
import { Checkbox } from '../../ui/Checkbox/index.js';
|
|
5
|
+
import { Field } from '../../ui/Field/index.js';
|
|
4
6
|
import { useKYCContext } from './KYCContext.js';
|
|
5
7
|
export function Step3() {
|
|
6
8
|
const context = useKYCContext();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { CheckCircleIcon } from '../../icons/
|
|
3
|
-
import { Button
|
|
2
|
+
import { CheckCircleIcon } from '../../icons/CheckCircleIcon.js';
|
|
3
|
+
import { Button } from '../../ui/Button/index.js';
|
|
4
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
4
5
|
export function Step4() {
|
|
5
6
|
return (_jsxs("div", { children: [_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success mx-auto flex size-12 items-center justify-center rounded-full", children: _jsx(CheckCircleIcon, {}) }), _jsx("h2", { className: "mt-3 text-center", children: "Submission Successful" }), _jsx("p", { className: "text-text-tertiary-600 text-center", children: "Your documents have been submitted successfully. They\u2019re now under review, and you\u2019ll receive a notification as soon as your account is verified." }), _jsx(Dialog.Context, { children: (api) => (_jsx(Button, { className: "mt-3xl", onClick: () => api.setOpen(false), children: "Ok" })) })] }));
|
|
6
7
|
}
|
|
@@ -3,7 +3,9 @@ import { tz } from '@date-fns/tz';
|
|
|
3
3
|
import { format } from 'date-fns';
|
|
4
4
|
import Link from 'next/link';
|
|
5
5
|
import { useShallow } from 'zustand/shallow';
|
|
6
|
-
import { useGlobalStore
|
|
6
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
7
|
+
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
8
|
+
import { useMarkMessageAsReadMutation } from '../../client/hooks/useMarkMessageAsReadMutation.js';
|
|
7
9
|
import { useMessageContext } from './MessageContext.js';
|
|
8
10
|
import { getMessageIcon } from './utils.js';
|
|
9
11
|
export function Message() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { createContext } from '../../client/utils/
|
|
1
|
+
import { createContext } from '../../client/utils/createContext.js';
|
|
2
2
|
export const [MessageContext, useMessageContext] = createContext();
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { tz } from '@date-fns/tz';
|
|
3
|
+
import { format } from 'date-fns';
|
|
4
|
+
import Link from 'next/link';
|
|
5
|
+
import { useShallow } from 'zustand/shallow';
|
|
6
|
+
import { useGlobalStore, useLocaleInfo, useMarkMessageAsReadMutation, } from '../../client/hooks/index.js';
|
|
7
|
+
import { getMessageIcon } from '../../components/Messages/utils.js';
|
|
8
|
+
export function MessageItem({ message }) {
|
|
9
|
+
const {
|
|
10
|
+
/**/
|
|
11
|
+
id, icon, title, content, actions, markedAsRead, dateTimeCreated, } = message;
|
|
12
|
+
const localeInfo = useLocaleInfo();
|
|
13
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
14
|
+
message: ctx.message,
|
|
15
|
+
messages: ctx.messages,
|
|
16
|
+
})));
|
|
17
|
+
const markMessageAsReadMutation = useMarkMessageAsReadMutation();
|
|
18
|
+
const Icon = getMessageIcon(icon);
|
|
19
|
+
const handleViewMessage = async () => {
|
|
20
|
+
globalStore.message.setData(message);
|
|
21
|
+
globalStore.message.setOpen(true);
|
|
22
|
+
globalStore.messages.setOpen(false);
|
|
23
|
+
if (!markedAsRead)
|
|
24
|
+
markMessageAsReadMutation.mutate(id);
|
|
25
|
+
};
|
|
26
|
+
const handleActionClick = (e) => {
|
|
27
|
+
e.stopPropagation();
|
|
28
|
+
globalStore.messages.setOpen(false);
|
|
29
|
+
globalStore.messages.setTab('ALL');
|
|
30
|
+
};
|
|
31
|
+
return (_jsxs("div", { role: "button", tabIndex: 0, className: "border-border-secondary rounded-xs bg-bg-secondary flex h-auto flex-shrink-0 cursor-pointer flex-col border px-3.5 py-2.5", onClick: handleViewMessage, "aria-pressed": "false", children: [_jsxs("div", { className: "flex items-center space-x-2", children: [_jsx("p", { className: "text-text-tertiary-600 text-xs font-normal", children: format(new Date(dateTimeCreated), 'M/d/yyyy - h:mma', {
|
|
32
|
+
in: tz(localeInfo.timezone),
|
|
33
|
+
}) }), !markedAsRead && (_jsx("div", { className: "bg-utility-success-500 h-2.5 w-2.5 rounded-full" }))] }), _jsxs("div", { className: "mb-2 flex items-center space-x-2", children: [_jsx(Icon, { className: "text-brand-400" }), _jsx("p", { className: "text-text-primary-brand text-sm font-semibold", children: title })] }), _jsx("p", { className: "line-clamp-3 text-wrap text-sm font-normal", dangerouslySetInnerHTML: { __html: content } }), actions.length > 0 && (_jsx("div", { className: "mt-2 flex flex-wrap items-center justify-end gap-2", children: actions.map((action, index) => (_jsx(Link, { className: "border-button-secondary-border text-button-secondary-fg rounded-md border px-3 py-2 text-sm", href: action.url, onClick: handleActionClick, children: action.name }, index))) }))] }));
|
|
34
|
+
}
|
|
@@ -3,9 +3,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { Portal } from '@ark-ui/react';
|
|
4
4
|
import Link from 'next/link';
|
|
5
5
|
import { useShallow } from 'zustand/shallow';
|
|
6
|
-
import { useGlobalStore } from '../../client/hooks/
|
|
7
|
-
import { XIcon } from '../../icons/
|
|
8
|
-
import { Dialog } from '../../ui/index.js';
|
|
6
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
7
|
+
import { XIcon } from '../../icons/XIcon.js';
|
|
8
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
9
9
|
import { getMessageIcon } from './utils.js';
|
|
10
10
|
export const MessagePopup = () => {
|
|
11
11
|
const globalStore = useGlobalStore(useShallow((ctx) => ({ message: ctx.message })));
|
|
@@ -2,7 +2,8 @@
|
|
|
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
|
|
5
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
6
|
+
import { useMarkMessageAsReadMutation } from '../../client/hooks/useMarkMessageAsReadMutation.js';
|
|
6
7
|
export function MessageTrigger(props) {
|
|
7
8
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
8
9
|
message: ctx.message,
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @example
|
|
5
|
-
* ```tsx
|
|
6
|
-
* offsetTop="1em"
|
|
7
|
-
* offsetTop="1rem"
|
|
8
|
-
* offsetTop="16px"
|
|
9
|
-
* ```
|
|
10
|
-
*/
|
|
11
|
-
offsetTop?: string | [mobile: string, desktop: string];
|
|
12
|
-
}
|
|
13
|
-
export declare function Messages(props: MessagesProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import type { MessagesProps } from './Messages.lazy';
|
|
2
|
+
export declare function Messages(props: MessagesProps): import("react/jsx-runtime").JSX.Element | undefined;
|
|
3
|
+
export type { MessagesProps };
|
|
@@ -1,39 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx
|
|
3
|
-
import
|
|
4
|
-
import { twMerge } from 'tailwind-merge';
|
|
5
|
-
import { z } from 'zod';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import dynamic from 'next/dynamic';
|
|
6
4
|
import { useShallow } from 'zustand/shallow';
|
|
7
|
-
import { useGlobalStore
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import { MessageContext } from './MessageContext.js';
|
|
13
|
-
import { MessagePopup } from './MessagePopup.js';
|
|
14
|
-
const TABS = ['ALL', 'UNREAD'];
|
|
5
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
6
|
+
const Component = dynamic(() => import('./Messages.lazy.js').then((mod) => mod.Messages), {
|
|
7
|
+
ssr: false,
|
|
8
|
+
loading: () => null,
|
|
9
|
+
});
|
|
15
10
|
export function Messages(props) {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const messagesQuery = useMessagesQuery({
|
|
20
|
-
first: 10,
|
|
21
|
-
...(globalStore.messages.tab === 'UNREAD' && {
|
|
22
|
-
filter: {
|
|
23
|
-
markedAsRead: {
|
|
24
|
-
equal: false,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
}),
|
|
28
|
-
}, { refetchInterval: 5000 });
|
|
29
|
-
const messages = messagesQuery.data?.pages.flatMap((page) => page.edges.map((e) => e.node)) ?? [];
|
|
30
|
-
const [mobileOffsetTop, desktopOffsetTop] = Array.isArray(props.offsetTop)
|
|
31
|
-
? props.offsetTop
|
|
32
|
-
: [props.offsetTop ?? '0px', props.offsetTop ?? '0px'];
|
|
33
|
-
return (_jsxs(_Fragment, { children: [_jsx(Drawer.Root, { open: globalStore.messages.open, onOpenChange: ({ open }) => globalStore.messages.setOpen(open), lazyMount: true, unmountOnExit: true, children: _jsx(Portal, { children: _jsx(Drawer.Positioner, { children: _jsx(Drawer.Content, { className: twMerge('flex', 'flex-col', 'border-border-secondary', 'top-[var(--offset-top-mobile)]', 'h-[calc(100%-var(--offset-top-mobile))]', 'lg:border-l', 'lg:top-[var(--offset-top-desktop)]', 'lg:h-[calc(100%-var(--offset-top-desktop))]'), style: {
|
|
34
|
-
['--offset-top-mobile']: mobileOffsetTop,
|
|
35
|
-
['--offset-top-desktop']: desktopOffsetTop,
|
|
36
|
-
}, children: _jsxs("div", { className: "flex flex-col space-y-6", children: [_jsxs("div", { className: "flex items-end justify-between px-4 pt-6", children: [_jsx("p", { className: "text-text-primary-brand text-xl font-semibold", children: "Notifications" }), _jsx(Drawer.CloseTrigger, { className: "p-2", children: _jsx(XIcon, {}) })] }), _jsxs(Tabs.Root, { value: globalStore.messages.tab, onValueChange: (details) => globalStore.messages.setTab(z.enum(TABS).parse(details.value)), lazyMount: true, unmountOnExit: true, children: [_jsx("div", { className: "mb-4 w-full px-4", children: _jsxs(Tabs.List, { className: "border-border-secondary w-full border", children: [_jsx(Tabs.Trigger, { value: "ALL", className: "flex-1/5 ui-selected:text-text-primary-brand text-text-tertiary-600", children: "All" }), _jsxs(Tabs.Trigger, { value: "UNREAD", className: "flex-1/5 ui-selected:text-text-primary-brand text-text-tertiary-600 flex items-center justify-center space-x-2", children: [_jsx("div", { children: "Unread" }), !!unreadMessagesCount && (_jsx("div", { className: "border-border-primary bg-bg-secondary rounded-full border px-2 py-0.5", children: unreadMessagesCount }))] }), _jsx(Tabs.Indicator, { className: "bg-bg-active" })] }) }), _jsx("div", { className: "border-border-secondary w-full border-t" }), TABS.map((tab) => (_jsxs(Tabs.Content, { value: tab, className: "scrollbar:w-2 scrollbar-track:bg-bg-primary-alt scrollbar-track:rounded-full scrollbar-thumb:bg-bg-quaternary scrollbar-thumb:rounded-full max-h-[calc(100vh-197px)] overflow-y-auto p-xl", style: { scrollbarGutter: 'stable' }, children: [messages.length > 0 && (_jsx("div", { className: "flex flex-col space-y-4", children: messages.map((message) => (_jsx(MessageContext, { value: message, children: _jsx(Message, {}) }, message.id))) })), _jsx(InfiniteScroll, { loader: _jsx(SpinnerIcon, { className: "mx-auto size-5" }), hasMore: !!messagesQuery.hasNextPage, loadMore: async () => {
|
|
37
|
-
await messagesQuery.fetchNextPage();
|
|
38
|
-
}, className: "mt-4" })] }, tab)))] })] }) }) }) }) }), _jsx(MessagePopup, {})] }));
|
|
11
|
+
const touched = useGlobalStore(useShallow((ctx) => ctx.messages['~touched']));
|
|
12
|
+
if (touched)
|
|
13
|
+
return _jsx(Component, { ...props });
|
|
39
14
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface MessagesProps {
|
|
2
|
+
/**
|
|
3
|
+
* @default '0px'
|
|
4
|
+
* @example
|
|
5
|
+
* ```tsx
|
|
6
|
+
* offsetTop="1em"
|
|
7
|
+
* offsetTop="1rem"
|
|
8
|
+
* offsetTop="16px"
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
offsetTop?: string | [mobile: string, desktop: string];
|
|
12
|
+
}
|
|
13
|
+
export declare function Messages(props: MessagesProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { useShallow } from 'zustand/shallow';
|
|
7
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
8
|
+
import { useMessagesQuery } from '../../client/hooks/useMessagesQuery.js';
|
|
9
|
+
import { useUnreadMessagesCountQuery } from '../../client/hooks/useUnreadMessagesCountQuery.js';
|
|
10
|
+
import { SpinnerIcon } from '../../icons/SpinnerIcon.js';
|
|
11
|
+
import { XIcon } from '../../icons/XIcon.js';
|
|
12
|
+
import { Drawer } from '../../ui/Drawer/index.js';
|
|
13
|
+
import { Tabs } from '../../ui/Tabs/index.js';
|
|
14
|
+
import { InfiniteScroll } from '../InfiniteScroll.js';
|
|
15
|
+
import { Message } from './Message.js';
|
|
16
|
+
import { MessageContext } from './MessageContext.js';
|
|
17
|
+
import { MessagePopup } from './MessagePopup.js';
|
|
18
|
+
const TABS = ['ALL', 'UNREAD'];
|
|
19
|
+
export function Messages(props) {
|
|
20
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({ messages: ctx.messages })));
|
|
21
|
+
const unreadMessagesCountQuery = useUnreadMessagesCountQuery({}, {
|
|
22
|
+
refetchInterval: globalStore.messages.open ? 5000 : 10000,
|
|
23
|
+
});
|
|
24
|
+
const unreadMessagesCount = unreadMessagesCountQuery.data ?? 0;
|
|
25
|
+
const messagesQuery = useMessagesQuery({
|
|
26
|
+
first: 10,
|
|
27
|
+
...(globalStore.messages.tab === 'UNREAD' && {
|
|
28
|
+
filter: {
|
|
29
|
+
markedAsRead: {
|
|
30
|
+
equal: false,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
}, {
|
|
35
|
+
enabled: globalStore.messages.open,
|
|
36
|
+
refetchInterval: 5000,
|
|
37
|
+
});
|
|
38
|
+
const messages = messagesQuery.data?.pages.flatMap((page) => page.edges.map((e) => e.node)) ?? [];
|
|
39
|
+
const [mobileOffsetTop, desktopOffsetTop] = Array.isArray(props.offsetTop)
|
|
40
|
+
? props.offsetTop
|
|
41
|
+
: [props.offsetTop ?? '0px', props.offsetTop ?? '0px'];
|
|
42
|
+
return (_jsxs(_Fragment, { children: [_jsx(Drawer.Root, { open: globalStore.messages.open, onOpenChange: ({ open }) => globalStore.messages.setOpen(open), lazyMount: true, unmountOnExit: true, children: _jsx(Portal, { children: _jsx(Drawer.Positioner, { children: _jsx(Drawer.Content, { className: twMerge('flex', 'flex-col', 'border-border-secondary', 'top-[var(--offset-top-mobile)]', 'h-[calc(100%-var(--offset-top-mobile))]', 'lg:border-l', 'lg:top-[var(--offset-top-desktop)]', 'lg:h-[calc(100%-var(--offset-top-desktop))]'), style: {
|
|
43
|
+
['--offset-top-mobile']: mobileOffsetTop,
|
|
44
|
+
['--offset-top-desktop']: desktopOffsetTop,
|
|
45
|
+
}, children: _jsxs("div", { className: "flex flex-col space-y-6", children: [_jsxs("div", { className: "flex items-end justify-between px-4 pt-6", children: [_jsx("p", { className: "text-text-primary-brand text-xl font-semibold", children: "Notifications" }), _jsx(Drawer.CloseTrigger, { className: "p-2", children: _jsx(XIcon, {}) })] }), _jsxs(Tabs.Root, { value: globalStore.messages.tab, onValueChange: (details) => globalStore.messages.setTab(z.enum(TABS).parse(details.value)), lazyMount: true, unmountOnExit: true, children: [_jsx("div", { className: "mb-4 w-full px-4", children: _jsxs(Tabs.List, { className: "border-border-secondary w-full border", children: [_jsx(Tabs.Trigger, { value: "ALL", className: "flex-1/5 ui-selected:text-text-primary-brand text-text-tertiary-600", children: "All" }), _jsxs(Tabs.Trigger, { value: "UNREAD", className: "flex-1/5 ui-selected:text-text-primary-brand text-text-tertiary-600 flex items-center justify-center space-x-2", children: [_jsx("div", { children: "Unread" }), !!unreadMessagesCount && (_jsx("div", { className: "border-border-primary bg-bg-secondary rounded-full border px-2 py-0.5", children: unreadMessagesCount }))] }), _jsx(Tabs.Indicator, { className: "bg-bg-active" })] }) }), _jsx("div", { className: "border-border-secondary w-full border-t" }), TABS.map((tab) => (_jsxs(Tabs.Content, { value: tab, className: "scrollbar:w-2 scrollbar-track:bg-bg-primary-alt scrollbar-track:rounded-full scrollbar-thumb:bg-bg-quaternary scrollbar-thumb:rounded-full max-h-[calc(100vh-197px)] overflow-y-auto p-xl", style: { scrollbarGutter: 'stable' }, children: [messages.length > 0 && (_jsx("div", { className: "flex flex-col space-y-4", children: messages.map((message) => (_jsx(MessageContext, { value: message, children: _jsx(Message, {}) }, message.id))) })), _jsx(InfiniteScroll, { loader: _jsx(SpinnerIcon, { className: "mx-auto size-5" }), hasMore: !!messagesQuery.hasNextPage, loadMore: async () => {
|
|
46
|
+
await messagesQuery.fetchNextPage();
|
|
47
|
+
}, className: "mt-4" })] }, tab)))] })] }) }) }) }) }), _jsx(MessagePopup, {})] }));
|
|
48
|
+
}
|
|
@@ -2,14 +2,17 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { ark } from '@ark-ui/react';
|
|
4
4
|
import { useShallow } from 'zustand/shallow';
|
|
5
|
-
import { useGlobalStore
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
6
|
+
import { useUnreadMessagesCountQuery } from '../../client/hooks/useUnreadMessagesCountQuery.js';
|
|
7
|
+
import { Bell01Icon } from '../../icons/Bell01Icon.js';
|
|
8
|
+
import { IconButton } from '../../ui/IconButton/index.js';
|
|
8
9
|
export function MessagesTrigger({ asChild, children, ...props }) {
|
|
9
10
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
10
11
|
messages: ctx.messages,
|
|
11
12
|
})));
|
|
12
|
-
const unreadMessagesCountQuery = useUnreadMessagesCountQuery({}, {
|
|
13
|
+
const unreadMessagesCountQuery = useUnreadMessagesCountQuery({}, {
|
|
14
|
+
refetchInterval: globalStore.messages.open ? 5000 : 10000,
|
|
15
|
+
});
|
|
13
16
|
const unreadMessagesCount = unreadMessagesCountQuery.data ?? 0;
|
|
14
17
|
return (_jsx(ark.button, { type: "button", "aria-label": "Toggle messages panel", "data-state": globalStore.messages.open ? 'open' : 'closed', ...props, onClick: (e) => {
|
|
15
18
|
globalStore.messages.setOpen(!globalStore.messages.open);
|