@opexa/portal-components 0.0.65 → 0.0.66
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/components/Account/Account.d.ts +23 -0
- package/dist/components/Account/Account.js +107 -0
- package/dist/components/Account/AccountTrigger.d.ts +6 -0
- package/dist/components/Account/AccountTrigger.js +13 -0
- package/dist/components/Account/account.recipe.d.ts +61 -0
- package/dist/components/Account/account.recipe.js +32 -0
- package/dist/components/Account/index.d.ts +2 -0
- package/dist/components/Account/index.js +2 -0
- package/dist/components/AccountInfo/AccountInfo.d.ts +4 -0
- package/dist/components/AccountInfo/AccountInfo.js +143 -0
- package/dist/components/AccountInfo/index.d.ts +1 -0
- package/dist/components/AccountInfo/index.js +1 -0
- package/dist/components/AccountSecurity/AccountSecurity.d.ts +4 -0
- package/dist/components/AccountSecurity/AccountSecurity.js +171 -0
- package/dist/components/AccountSecurity/index.d.ts +1 -0
- package/dist/components/AccountSecurity/index.js +1 -0
- package/dist/components/AccountVerification/AccountVerification.d.ts +4 -0
- package/dist/components/AccountVerification/AccountVerification.js +37 -0
- package/dist/components/AccountVerification/index.d.ts +1 -0
- package/dist/components/AccountVerification/index.js +1 -0
- package/dist/components/Banner/Banner.d.ts +11 -0
- package/dist/components/Banner/Banner.js +38 -0
- package/dist/components/Banner/index.d.ts +1 -0
- package/dist/components/Banner/index.js +1 -0
- package/dist/components/BetRecords/BetRecords.d.ts +7 -0
- package/dist/components/BetRecords/BetRecords.js +181 -0
- package/dist/components/BetRecords/index.d.ts +1 -0
- package/dist/components/BetRecords/index.js +1 -0
- package/dist/components/Bonus/Bonus.client.d.ts +2 -0
- package/dist/components/Bonus/Bonus.client.js +9 -0
- package/dist/components/Bonus/Bonus.d.ts +10 -0
- package/dist/components/Bonus/Bonus.js +5 -0
- package/dist/components/Bonus/index.d.ts +1 -0
- package/dist/components/Bonus/index.js +1 -0
- package/dist/components/Bonuses/Bonuses.client.js +1 -1
- package/dist/components/Bonuses/Bonuses.d.ts +15 -0
- package/dist/components/Bonuses/Bonuses.js +7 -0
- package/dist/components/Bonuses/index.js +1 -1
- package/dist/components/Cashback/Cashback.client.d.ts +2 -0
- package/dist/components/Cashback/Cashback.client.js +27 -0
- package/dist/components/Cashback/Cashback.d.ts +7 -0
- package/dist/components/Cashback/Cashback.js +15 -0
- package/dist/components/Cashback/index.d.ts +1 -0
- package/dist/components/Cashback/index.js +1 -0
- 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.d.ts +11 -0
- package/dist/components/DepositWithdrawal/AmountChoices.js +25 -0
- package/dist/components/DepositWithdrawal/Deposit/AvailablePromos.d.ts +8 -0
- package/dist/components/DepositWithdrawal/Deposit/AvailablePromos.js +31 -0
- package/dist/components/DepositWithdrawal/Deposit/Deposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/Deposit.js +75 -0
- package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +129 -0
- package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.js +126 -0
- package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +129 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDeposit.js +10 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositAlert.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositAlert.js +96 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +21 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.js +2 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositDetails.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositDetails.js +16 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.js +102 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +13 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.js +60 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDeposit.js +10 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositAlert.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositAlert.js +96 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +21 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.js +2 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositDetails.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositDetails.js +16 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.js +101 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +13 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.js +60 -0
- package/dist/components/DepositWithdrawal/DepositWithdrawal.d.ts +6 -0
- package/dist/components/DepositWithdrawal/DepositWithdrawal.js +39 -0
- package/dist/components/DepositWithdrawal/DepositWithdrawalTrigger.d.ts +5 -0
- package/dist/components/DepositWithdrawal/DepositWithdrawalTrigger.js +21 -0
- package/dist/components/DepositWithdrawal/PaymentMethods.d.ts +10 -0
- package/dist/components/DepositWithdrawal/PaymentMethods.js +60 -0
- package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.js +109 -0
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js +131 -0
- package/dist/components/DepositWithdrawal/Withdrawal/MayaAppWithdrawal/MayaAppWithdrawal.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Withdrawal/MayaAppWithdrawal/MayaAppWithdrawal.js +101 -0
- package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.js +109 -0
- package/dist/components/DepositWithdrawal/Withdrawal/Withdrawal.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Withdrawal/Withdrawal.js +91 -0
- package/dist/components/DepositWithdrawal/index.d.ts +1 -0
- package/dist/components/DepositWithdrawal/index.js +1 -0
- package/dist/components/DepositWithdrawal/utils.d.ts +3 -0
- package/dist/components/DepositWithdrawal/utils.js +9 -0
- package/dist/components/Disclaimer/Disclaimer.d.ts +5 -0
- package/dist/components/Disclaimer/Disclaimer.js +14 -0
- package/dist/components/Disclaimer/index.d.ts +1 -0
- package/dist/components/Disclaimer/index.js +1 -0
- package/dist/components/Disclaimer/useDisclaimer.d.ts +4 -0
- package/dist/components/Disclaimer/useDisclaimer.js +37 -0
- package/dist/components/Empty.d.ts +10 -0
- package/dist/components/Empty.js +7 -0
- package/dist/components/FavoriteGames/FavoriteGames.client.d.ts +2 -0
- package/dist/components/FavoriteGames/FavoriteGames.client.js +31 -0
- package/dist/components/FavoriteGames/FavoriteGames.d.ts +6 -0
- package/dist/components/FavoriteGames/FavoriteGames.js +7 -0
- package/dist/components/FavoriteGames/index.d.ts +1 -0
- package/dist/components/FavoriteGames/index.js +1 -0
- package/dist/components/GameLaunch/GameLaunch.d.ts +1 -0
- package/dist/components/GameLaunch/GameLaunch.js +75 -0
- package/dist/components/GameLaunch/GameLaunchTrigger.d.ts +7 -0
- package/dist/components/GameLaunch/GameLaunchTrigger.js +57 -0
- package/dist/components/GameLaunch/index.d.ts +2 -0
- package/dist/components/GameLaunch/index.js +2 -0
- package/dist/components/GameProviders/GameProviders.d.ts +11 -0
- package/dist/components/GameProviders/GameProviders.js +32 -0
- package/dist/components/GameProviders/index.d.ts +1 -0
- package/dist/components/GameProviders/index.js +1 -0
- package/dist/components/Games/BadgeNew.d.ts +2 -0
- package/dist/components/Games/BadgeNew.js +4 -0
- package/dist/components/Games/BadgePopular.d.ts +2 -0
- package/dist/components/Games/BadgePopular.js +4 -0
- package/dist/components/Games/BadgeTop.d.ts +2 -0
- package/dist/components/Games/BadgeTop.js +4 -0
- package/dist/components/Games/Game.d.ts +4 -0
- package/dist/components/Games/Game.js +37 -0
- package/dist/components/Games/GameContext.d.ts +2 -0
- package/dist/components/Games/GameContext.js +2 -0
- package/dist/components/Games/Games.d.ts +8 -0
- package/dist/components/Games/Games.js +6 -0
- package/dist/components/Games/GamesCarousel.client.d.ts +2 -0
- package/dist/components/Games/GamesCarousel.client.js +58 -0
- package/dist/components/Games/GamesCarousel.d.ts +16 -0
- package/dist/components/Games/GamesCarousel.js +11 -0
- package/dist/components/Games/GamesList.client.d.ts +2 -0
- package/dist/components/Games/GamesList.client.js +14 -0
- package/dist/components/Games/GamesList.d.ts +11 -0
- package/dist/components/Games/GamesList.js +10 -0
- package/dist/components/Games/index.d.ts +1 -0
- package/dist/components/Games/index.js +1 -0
- package/dist/components/GamesSearch/GamesSearch.d.ts +8 -0
- package/dist/components/GamesSearch/GamesSearch.js +45 -0
- package/dist/components/GamesSearch/index.d.ts +1 -0
- package/dist/components/GamesSearch/index.js +1 -0
- package/dist/components/InfiniteScroll.d.ts +10 -0
- package/dist/components/InfiniteScroll.js +25 -0
- package/dist/components/JackpotCounter/JackpotCounter.client.d.ts +2 -0
- package/dist/components/JackpotCounter/JackpotCounter.client.js +57 -0
- package/dist/components/JackpotCounter/JackpotCounter.d.ts +8 -0
- package/dist/components/JackpotCounter/JackpotCounter.js +21 -0
- package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +8 -0
- package/dist/components/JackpotCounter/JackpotCounterItem.js +103 -0
- package/dist/components/JackpotCounter/index.d.ts +1 -0
- package/dist/components/JackpotCounter/index.js +1 -0
- package/dist/components/Jackpots/JackpotGameProviders.d.ts +5 -0
- package/dist/components/Jackpots/JackpotGameProviders.js +38 -0
- 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/JackpotRules.d.ts +6 -0
- package/dist/components/Jackpots/JackpotRules.js +9 -0
- package/dist/components/Jackpots/Jackpots.client.d.ts +2 -0
- package/dist/components/Jackpots/Jackpots.client.js +28 -0
- package/dist/components/Jackpots/Jackpots.d.ts +10 -0
- package/dist/components/Jackpots/Jackpots.js +21 -0
- package/dist/components/Jackpots/index.d.ts +1 -0
- package/dist/components/Jackpots/index.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.d.ts +1 -0
- package/dist/components/KYC/Header.js +6 -0
- package/dist/components/KYC/Indicator.d.ts +1 -0
- package/dist/components/KYC/Indicator.js +9 -0
- package/dist/components/KYC/KYC.d.ts +1 -0
- package/dist/components/KYC/KYC.js +26 -0
- package/dist/components/KYC/KYCContext.d.ts +2 -0
- package/dist/components/KYC/KYCContext.js +2 -0
- package/dist/components/KYC/KYCTrigger.d.ts +5 -0
- package/dist/components/KYC/KYCTrigger.js +14 -0
- package/dist/components/KYC/Step1.d.ts +1 -0
- package/dist/components/KYC/Step1.js +12 -0
- package/dist/components/KYC/Step2.d.ts +1 -0
- package/dist/components/KYC/Step2.js +12 -0
- package/dist/components/KYC/Step3.d.ts +1 -0
- package/dist/components/KYC/Step3.js +11 -0
- package/dist/components/KYC/Step4.d.ts +1 -0
- package/dist/components/KYC/Step4.js +6 -0
- package/dist/components/KYC/index.d.ts +2 -0
- package/dist/components/KYC/index.js +2 -0
- package/dist/components/KYC/useKYC.d.ts +10 -0
- package/dist/components/KYC/useKYC.js +8 -0
- package/dist/components/Marquee/Marquee.d.ts +5 -0
- package/dist/components/Marquee/Marquee.js +5 -0
- package/dist/components/Marquee/index.d.ts +1 -0
- package/dist/components/Marquee/index.js +1 -0
- package/dist/components/Messages/MessageItem.d.ts +4 -0
- package/dist/components/Messages/MessageItem.js +34 -0
- package/dist/components/Messages/MessagePopup.d.ts +1 -0
- package/dist/components/Messages/MessagePopup.js +20 -0
- package/dist/components/Messages/MessageTrigger.d.ts +8 -0
- package/dist/components/Messages/MessageTrigger.js +18 -0
- package/dist/components/Messages/Messages.d.ts +14 -0
- package/dist/components/Messages/Messages.js +38 -0
- package/dist/components/Messages/MessagesTrigger.d.ts +6 -0
- package/dist/components/Messages/MessagesTrigger.js +14 -0
- package/dist/components/Messages/index.d.ts +4 -0
- package/dist/components/Messages/index.js +4 -0
- package/dist/components/Messages/utils.d.ts +3 -0
- package/dist/components/Messages/utils.js +27 -0
- package/dist/components/PortalProvider/PortalProvider.d.ts +9 -0
- package/dist/components/PortalProvider/PortalProvider.js +18 -0
- package/dist/components/PortalProvider/Providers.d.ts +4 -0
- package/dist/components/PortalProvider/Providers.js +12 -0
- package/dist/components/PortalProvider/Snackbar.d.ts +1 -0
- package/dist/components/PortalProvider/Snackbar.js +21 -0
- package/dist/components/PortalProvider/WebVitals.d.ts +1 -0
- package/dist/components/PortalProvider/WebVitals.js +8 -0
- package/dist/components/PortalProvider/index.d.ts +1 -0
- package/dist/components/PortalProvider/index.js +1 -0
- package/dist/components/Promo/Promo.client.d.ts +2 -0
- package/dist/components/Promo/Promo.client.js +27 -0
- package/dist/components/Promo/Promo.d.ts +7 -0
- package/dist/components/Promo/Promo.js +15 -0
- package/dist/components/Promo/index.d.ts +1 -0
- package/dist/components/Promo/index.js +1 -0
- package/dist/components/Promos/Cashback.d.ts +7 -0
- package/dist/components/Promos/Cashback.js +17 -0
- package/dist/components/Promos/Promo.d.ts +7 -0
- package/dist/components/Promos/Promo.js +17 -0
- package/dist/components/Promos/Promos.d.ts +15 -0
- package/dist/components/Promos/Promos.js +13 -0
- package/dist/components/Promos/PromosCarousel.d.ts +2 -0
- package/dist/components/Promos/PromosCarousel.js +45 -0
- package/dist/components/Promos/PromosGrid.d.ts +2 -0
- package/dist/components/Promos/PromosGrid.js +16 -0
- package/dist/components/Promos/index.d.ts +1 -0
- package/dist/components/Promos/index.js +1 -0
- package/dist/components/Protected/Protected.d.ts +6 -0
- package/dist/components/Protected/Protected.js +8 -0
- package/dist/components/Protected/index.d.ts +1 -0
- package/dist/components/Protected/index.js +1 -0
- package/dist/components/Quests/CountdownTimer.d.ts +15 -0
- package/dist/components/Quests/CountdownTimer.js +33 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +4 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +73 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +8 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +8 -0
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +4 -0
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +4 -0
- package/dist/components/Quests/Quests.client.d.ts +2 -0
- package/dist/components/Quests/Quests.client.js +27 -0
- package/dist/components/Quests/Quests.d.ts +6 -0
- package/dist/components/Quests/Quests.js +7 -0
- package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +4 -0
- package/dist/components/Quests/WageringQuest/WageringQuest.js +19 -0
- package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +9 -0
- package/dist/components/Quests/WageringQuest/WageringQuestModal.js +8 -0
- package/dist/components/Quests/index.d.ts +1 -0
- package/dist/components/Quests/index.js +1 -0
- package/dist/components/Search/Search.d.ts +6 -0
- package/dist/components/Search/Search.js +38 -0
- package/dist/components/Search/SearchTrigger.d.ts +5 -0
- package/dist/components/Search/SearchTrigger.js +14 -0
- package/dist/components/Search/index.d.ts +2 -0
- package/dist/components/Search/index.js +2 -0
- package/dist/components/SignIn/MobileNumberSignIn.d.ts +1 -0
- package/dist/components/SignIn/MobileNumberSignIn.js +121 -0
- package/dist/components/SignIn/NameAndPasswordSignIn.d.ts +1 -0
- package/dist/components/SignIn/NameAndPasswordSignIn.js +116 -0
- package/dist/components/SignIn/SignIn.d.ts +7 -0
- package/dist/components/SignIn/SignIn.js +18 -0
- package/dist/components/SignIn/SignInContext.d.ts +2 -0
- package/dist/components/SignIn/SignInContext.js +2 -0
- package/dist/components/SignIn/SignInForm.d.ts +1 -0
- package/dist/components/SignIn/SignInForm.js +10 -0
- package/dist/components/SignIn/SignInMethod.d.ts +1 -0
- package/dist/components/SignIn/SignInMethod.js +19 -0
- package/dist/components/SignIn/SignInTrigger.d.ts +6 -0
- package/dist/components/SignIn/SignInTrigger.js +14 -0
- package/dist/components/SignIn/index.d.ts +2 -0
- package/dist/components/SignIn/index.js +2 -0
- package/dist/components/SignIn/useSignIn.d.ts +10 -0
- package/dist/components/SignIn/useSignIn.js +11 -0
- package/dist/components/SignUp/SignUp.d.ts +7 -0
- package/dist/components/SignUp/SignUp.js +16 -0
- package/dist/components/SignUp/SignUpForm.d.ts +1 -0
- package/dist/components/SignUp/SignUpForm.js +133 -0
- package/dist/components/SignUp/SignUpTrigger.d.ts +6 -0
- package/dist/components/SignUp/SignUpTrigger.js +14 -0
- package/dist/components/SignUp/index.d.ts +2 -0
- package/dist/components/SignUp/index.js +2 -0
- package/dist/components/TopWins/TopWins.client.d.ts +2 -0
- package/dist/components/TopWins/TopWins.client.js +23 -0
- package/dist/components/TopWins/TopWins.d.ts +6 -0
- package/dist/components/TopWins/TopWins.js +7 -0
- package/dist/components/TopWins/index.d.ts +1 -0
- package/dist/components/TopWins/index.js +1 -0
- package/dist/components/TournamentCounter/TournamentCounter.client.d.ts +2 -0
- package/dist/components/TournamentCounter/TournamentCounter.client.js +50 -0
- package/dist/components/TournamentCounter/TournamentCounter.d.ts +8 -0
- package/dist/components/TournamentCounter/TournamentCounter.js +21 -0
- package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +8 -0
- package/dist/components/TournamentCounter/TournamentCounterItem.js +106 -0
- package/dist/components/TournamentCounter/index.d.ts +1 -0
- package/dist/components/TournamentCounter/index.js +1 -0
- package/dist/components/Tournaments/TournamentGameProviders.d.ts +5 -0
- package/dist/components/Tournaments/TournamentGameProviders.js +38 -0
- 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/TournamentRules.d.ts +6 -0
- package/dist/components/Tournaments/TournamentRules.js +9 -0
- package/dist/components/Tournaments/Tournaments.client.d.ts +2 -0
- package/dist/components/Tournaments/Tournaments.client.js +19 -0
- package/dist/components/Tournaments/Tournaments.d.ts +10 -0
- package/dist/components/Tournaments/Tournaments.js +14 -0
- package/dist/components/Tournaments/index.d.ts +1 -0
- package/dist/components/Tournaments/index.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.d.ts +1 -0
- package/dist/components/TransactionRecords/DepositRecordsTable.js +76 -0
- package/dist/components/TransactionRecords/TableFilters.d.ts +28 -0
- package/dist/components/TransactionRecords/TableFilters.js +212 -0
- package/dist/components/TransactionRecords/TransactionRecords.d.ts +7 -0
- package/dist/components/TransactionRecords/TransactionRecords.js +9 -0
- package/dist/components/TransactionRecords/TransactionRecordsTable.d.ts +1 -0
- package/dist/components/TransactionRecords/TransactionRecordsTable.js +51 -0
- package/dist/components/TransactionRecords/WithdrawalRecordsTable.d.ts +1 -0
- package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +70 -0
- package/dist/components/TransactionRecords/index.d.ts +1 -0
- package/dist/components/TransactionRecords/index.js +1 -0
- package/dist/components/index.js +34 -0
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createListCollection } from '@ark-ui/react';
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
import { useAvailablePromosQuery, useControllableState, } from '../../../client/hooks/index.js';
|
|
5
|
+
import { CheckIcon, ChevronDownIcon } from '../../../icons/index.js';
|
|
6
|
+
import gift from '../../../images/gift.png';
|
|
7
|
+
import { Select } from '../../../ui/index.js';
|
|
8
|
+
export function AvailablePromos(props) {
|
|
9
|
+
const query = useAvailablePromosQuery();
|
|
10
|
+
const promos = query.data ?? [];
|
|
11
|
+
const [value, setValue] = useControllableState({
|
|
12
|
+
value: props.value,
|
|
13
|
+
defaultValue: props.defaultValue ?? null,
|
|
14
|
+
onChange: props.onChange,
|
|
15
|
+
});
|
|
16
|
+
const collection = createListCollection({
|
|
17
|
+
items: promos,
|
|
18
|
+
itemToValue: (item) => item.id,
|
|
19
|
+
itemToString: (item) => item.name,
|
|
20
|
+
});
|
|
21
|
+
return (_jsxs(Select.Root, { collection: collection, lazyMount: true, positioning: {
|
|
22
|
+
sameWidth: true,
|
|
23
|
+
}, value: value ? [value] : [], onValueChange: (details) => {
|
|
24
|
+
const value = details.value.at(0);
|
|
25
|
+
setValue(value ?? null);
|
|
26
|
+
}, className: props.className, children: [_jsx(Select.Label, { children: "Choose a bonus" }), _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, { placeholder: "Pay without bonus" }), _jsx(Select.Context, { children: (api) => (_jsx(_Fragment, { children: api.value.length ? (_jsx(Select.ClearTrigger, { asChild: true, children: _jsx("span", { onClick: (e) => {
|
|
27
|
+
e.stopPropagation();
|
|
28
|
+
}, children: "Clear" }) })) : (_jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })) })) })] }), _jsx(Select.Positioner, { children: _jsxs(Select.Content, { children: [collection.items.length <= 0 && (_jsxs("div", { className: "p-2", children: [_jsx(Image, { src: gift, alt: "", width: 160, height: 160, className: "mx-auto size-[8.313rem] grayscale" }), _jsx("p", { className: "text-text-tertiary-600 mx-auto mt-1 max-w-[20rem] text-center text-sm", children: "No Bonuses are available at the moment. Please check back later!" })] })), collection.items.length > 0 && (_jsx(Select.ItemGroup, { children: collection.items.map((promo) => (_jsxs(Select.Item, { item: promo, children: [_jsxs(Select.ItemText, { children: [_jsx("span", { className: "block font-medium", children: promo.name }), _jsx("span", { className: "text-text-warning-primary-600 line-clamp-1 block", dangerouslySetInnerHTML: {
|
|
29
|
+
__html: promo.description,
|
|
30
|
+
} })] }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, promo.id))) }))] }) })] }));
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Deposit(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { useIsMayaSessionValidQuery, useOnMMA, usePaymentSettingsQuery, } from '../../../client/hooks/index.js';
|
|
4
|
+
import { AlertCircleIcon, SpinnerIcon } from '../../../icons/index.js';
|
|
5
|
+
import { onMobileDevice } from '../../../utils/index.js';
|
|
6
|
+
import { PaymentMethods } from '../PaymentMethods.js';
|
|
7
|
+
import { GCashDeposit } from './GCashDeposit/GCashDeposit.js';
|
|
8
|
+
import { MayaAppDeposit } from './MayaAppDeposit/MayaAppDeposit.js';
|
|
9
|
+
import { MayaDeposit } from './MayaDeposit/MayaDeposit.js';
|
|
10
|
+
import { OnlineBankDeposit } from './OnlineBankDeposit/OnlineBankDeposit.js';
|
|
11
|
+
import { QRPHDeposit } from './QRPHDeposit/QRPHDeposit.js';
|
|
12
|
+
export function Deposit() {
|
|
13
|
+
const [onMMA] = useOnMMA();
|
|
14
|
+
const paymentSettingsQuery = usePaymentSettingsQuery();
|
|
15
|
+
const paymentSettings = paymentSettingsQuery.data;
|
|
16
|
+
const enabledPaymentMethods = (() => {
|
|
17
|
+
const l = [];
|
|
18
|
+
if (onMMA) {
|
|
19
|
+
l.push('MAYA_APP');
|
|
20
|
+
}
|
|
21
|
+
else if (onMobileDevice()) {
|
|
22
|
+
if (paymentSettings?.gcashDepositGatewaySettings?.mobileWebEnabled) {
|
|
23
|
+
l.push('GCASH');
|
|
24
|
+
}
|
|
25
|
+
if (paymentSettings?.mayaDepositGatewaySettings?.mobileWebEnabled) {
|
|
26
|
+
l.push('MAYA');
|
|
27
|
+
}
|
|
28
|
+
if (paymentSettings?.qrphDepositGatewaySettings?.mobileWebEnabled) {
|
|
29
|
+
l.push('QRPH');
|
|
30
|
+
}
|
|
31
|
+
if (paymentSettings?.onlineBankDepositGatewaySettings?.mobileWebEnabled) {
|
|
32
|
+
l.push('ONLINE_BANK');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
if (paymentSettings?.gcashDepositGatewaySettings?.webEnabled) {
|
|
37
|
+
l.push('GCASH');
|
|
38
|
+
}
|
|
39
|
+
if (paymentSettings?.mayaDepositGatewaySettings?.webEnabled) {
|
|
40
|
+
l.push('MAYA');
|
|
41
|
+
}
|
|
42
|
+
if (paymentSettings?.qrphDepositGatewaySettings?.webEnabled) {
|
|
43
|
+
l.push('QRPH');
|
|
44
|
+
}
|
|
45
|
+
if (paymentSettings?.onlineBankDepositGatewaySettings?.webEnabled) {
|
|
46
|
+
l.push('ONLINE_BANK');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return l;
|
|
50
|
+
})();
|
|
51
|
+
const [paymentMethod, setPaymentMethod] = useState();
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (enabledPaymentMethods.length > 0 && !paymentMethod) {
|
|
54
|
+
setPaymentMethod(enabledPaymentMethods[0]);
|
|
55
|
+
}
|
|
56
|
+
}, [enabledPaymentMethods, paymentMethod]);
|
|
57
|
+
const isMayaSessionValidQuery = useIsMayaSessionValidQuery();
|
|
58
|
+
const isMayaSessionValid = isMayaSessionValidQuery.data ?? true;
|
|
59
|
+
if (paymentSettingsQuery.isLoading || isMayaSessionValidQuery.isLoading) {
|
|
60
|
+
return _jsx(SpinnerIcon, { className: "mx-auto size-6" });
|
|
61
|
+
}
|
|
62
|
+
if (!isMayaSessionValid) {
|
|
63
|
+
return _jsx(MayaSessionSessionExpired, {});
|
|
64
|
+
}
|
|
65
|
+
if (enabledPaymentMethods.length <= 0) {
|
|
66
|
+
return _jsx(NoAvailablePaymentMethods, {});
|
|
67
|
+
}
|
|
68
|
+
return (_jsxs(_Fragment, { children: [_jsx(PaymentMethods, { value: paymentMethod, onChange: setPaymentMethod, options: enabledPaymentMethods }), paymentMethod === 'QRPH' && _jsx(QRPHDeposit, {}), paymentMethod === 'GCASH' && _jsx(GCashDeposit, {}), paymentMethod === 'MAYA' && _jsx(MayaDeposit, {}), paymentMethod === 'MAYA_APP' && _jsx(MayaAppDeposit, {}), paymentMethod === 'ONLINE_BANK' && _jsx(OnlineBankDeposit, {})] }));
|
|
69
|
+
}
|
|
70
|
+
function MayaSessionSessionExpired() {
|
|
71
|
+
return (_jsxs("div", { className: "py-xl", children: [_jsx("div", { className: "bg-bg-warning-secondary mx-auto flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, { className: "text-text-featured-icon-light-warning size-6" }) }), _jsx("h2", { className: "mt-lg text-center text-lg font-semibold", children: "Session Expired" }), _jsx("p", { className: "text-text-tertiary-600 mx-auto mt-xs max-w-[25rem] text-center text-sm", children: "Your session has timed out. To continue with deposits or withdrawals, Please try reloading the app." })] }));
|
|
72
|
+
}
|
|
73
|
+
function NoAvailablePaymentMethods() {
|
|
74
|
+
return (_jsxs("div", { className: "py-xl", children: [_jsx("div", { className: "bg-bg-warning-secondary mx-auto flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, { className: "text-text-featured-icon-light-warning size-6" }) }), _jsx("h2", { className: "mt-lg text-center text-lg font-semibold", children: "Not Available" }), _jsx("p", { className: "text-text-tertiary-600 mx-auto mt-xs max-w-[25rem] text-center text-sm", children: "Deposit is not available at this time. Please try again later or contact support for assistance." })] }));
|
|
75
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function GCashDeposit(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Portal } from '@ark-ui/react';
|
|
3
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
import { Controller, useForm } from 'react-hook-form';
|
|
6
|
+
import invariant from 'tiny-invariant';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { useAvailablePromosQuery, useCreateGCashDepositMutation, useDepositsCountQuery, usePaymentSettingsQuery, } from '../../../../client/hooks/index.js';
|
|
9
|
+
import { AlertCircleIcon, ChevronDownIcon, ChevronUpIcon, SpinnerIcon, XIcon, } from '../../../../icons/index.js';
|
|
10
|
+
import { AlertDialog, Button, Field, NumberInput } from '../../../../ui/index.js';
|
|
11
|
+
import { parseDecimal } from '../../../../utils/index.js';
|
|
12
|
+
import { AmountChoices } from '../../AmountChoices.js';
|
|
13
|
+
import { AvailablePromos } from '../AvailablePromos.js';
|
|
14
|
+
export function GCashDeposit() {
|
|
15
|
+
const [status, setStatus] = useState('waiting');
|
|
16
|
+
const createDepositMutation = useCreateGCashDepositMutation({
|
|
17
|
+
onMutate() {
|
|
18
|
+
setStatus('processing');
|
|
19
|
+
},
|
|
20
|
+
onSuccess(data) {
|
|
21
|
+
invariant(data.checkoutUrl);
|
|
22
|
+
window.open(data.checkoutUrl, '_blank', 'noopener,noreferrer');
|
|
23
|
+
form.reset();
|
|
24
|
+
setStatus('success');
|
|
25
|
+
},
|
|
26
|
+
onError() {
|
|
27
|
+
setStatus('failed');
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
const depositsCountQuery = useDepositsCountQuery();
|
|
31
|
+
const depositsCount = depositsCountQuery.data ?? 0;
|
|
32
|
+
const paymentSettingsQuery = usePaymentSettingsQuery();
|
|
33
|
+
const paymentSettings = paymentSettingsQuery.data;
|
|
34
|
+
const gatewaySettings = paymentSettings?.gcashDepositGatewaySettings;
|
|
35
|
+
const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
|
|
36
|
+
const minimumAmount = depositsCount <= 0
|
|
37
|
+
? parseDecimal(paymentSettingsQuery.data?.minimumFirstDepositAmount, 0)
|
|
38
|
+
: parseDecimal(gatewaySettings?.minimumAmount, 0);
|
|
39
|
+
const promosQuery = useAvailablePromosQuery();
|
|
40
|
+
const promos = promosQuery.data ?? [];
|
|
41
|
+
const definition = z
|
|
42
|
+
.object({
|
|
43
|
+
amount: z.string().superRefine((val, ctx) => {
|
|
44
|
+
const n = parseDecimal(val, 0);
|
|
45
|
+
if (n < minimumAmount) {
|
|
46
|
+
ctx.addIssue({
|
|
47
|
+
type: 'number',
|
|
48
|
+
code: z.ZodIssueCode.too_small,
|
|
49
|
+
inclusive: true,
|
|
50
|
+
minimum: minimumAmount,
|
|
51
|
+
message: `Minimum amount is ${minimumAmount.toLocaleString()}`,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (n > maximumAmount) {
|
|
55
|
+
ctx.addIssue({
|
|
56
|
+
type: 'number',
|
|
57
|
+
code: z.ZodIssueCode.too_big,
|
|
58
|
+
inclusive: true,
|
|
59
|
+
maximum: maximumAmount,
|
|
60
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}),
|
|
64
|
+
promo: z.string().optional().nullable(),
|
|
65
|
+
})
|
|
66
|
+
.superRefine((value, ctx) => {
|
|
67
|
+
const promo = promos.find((o) => o.id === value.promo);
|
|
68
|
+
const promoMinAmount = parseDecimal(promo?.minimumDepositAmount, 0);
|
|
69
|
+
const promoMaxAmount = parseDecimal(promo?.maximumDepositAmount, 0);
|
|
70
|
+
const amount = parseDecimal(value.amount, 0);
|
|
71
|
+
if (promo && amount < promoMinAmount) {
|
|
72
|
+
ctx.addIssue({
|
|
73
|
+
path: ['amount'],
|
|
74
|
+
code: z.ZodIssueCode.custom,
|
|
75
|
+
message: `Minimum amount for this promo is ${promoMinAmount.toLocaleString()}`,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
if (promo && amount > promoMaxAmount) {
|
|
79
|
+
ctx.addIssue({
|
|
80
|
+
path: ['amount'],
|
|
81
|
+
code: z.ZodIssueCode.custom,
|
|
82
|
+
message: `Maximum amount for this promo is ${promoMaxAmount}`,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
const form = useForm({
|
|
87
|
+
mode: 'all',
|
|
88
|
+
resolver: zodResolver(definition),
|
|
89
|
+
defaultValues: {
|
|
90
|
+
amount: '0',
|
|
91
|
+
promo: null,
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (minimumAmount) {
|
|
96
|
+
form.reset({
|
|
97
|
+
amount: minimumAmount.toString(),
|
|
98
|
+
promo: null,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}, [form, minimumAmount]);
|
|
102
|
+
const handleSubmit = form.handleSubmit(async (data) => {
|
|
103
|
+
createDepositMutation.mutate({
|
|
104
|
+
amount: data.amount.toString(),
|
|
105
|
+
promo: data.promo ?? undefined,
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
return (_jsxs("form", { onSubmit: handleSubmit, noValidate: true, children: [_jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
|
|
109
|
+
o.field.onChange(details.value);
|
|
110
|
+
}, formatOptions: {
|
|
111
|
+
maximumFractionDigits: 2,
|
|
112
|
+
minimumFractionDigits: 0,
|
|
113
|
+
}, allowMouseWheel: true, children: [_jsx(NumberInput.Label, { children: "Enter amount you want to deposit" }), _jsxs(NumberInput.Control, { children: [_jsx(NumberInput.Input, {}), _jsx(NumberInput.IncrementTrigger, { children: _jsx(ChevronUpIcon, {}) }), _jsx(NumberInput.DecrementTrigger, { children: _jsx(ChevronDownIcon, {}) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.amount?.message })] })) }), _jsx(AmountChoices, { value: parseDecimal(form.watch('amount'), 0), onChange: (value) => {
|
|
114
|
+
form.setValue('amount', value.toString(), {
|
|
115
|
+
shouldTouch: true,
|
|
116
|
+
shouldDirty: true,
|
|
117
|
+
shouldValidate: true,
|
|
118
|
+
});
|
|
119
|
+
}, min: minimumAmount, max: maximumAmount, className: "mt-lg" }), _jsx(Controller, { control: form.control, name: "promo", render: (o) => (_jsx(AvailablePromos, { value: o.field.value, onChange: o.field.onChange, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: createDepositMutation.isPending, children: "Deposit" }), _jsxs("p", { className: "text-text-tertiary-600 mt-lg text-xs", children: ["By depositing, you agree to our", ' ', _jsx("button", { type: "button", className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
|
|
120
|
+
if (!details.open) {
|
|
121
|
+
setStatus('waiting');
|
|
122
|
+
}
|
|
123
|
+
}, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { disabled: status === 'processing', children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "text-text-brand-primary-600 size-12" })), status === 'success' && (_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "bg-bg-error-secondary text-text-featured-icon-light-error flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Deposit', status === 'success' && 'Deposit Successful', status === 'failed' && 'Deposit Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
|
|
124
|
+
"We're verifying your account and amount. Please hold a moment.", status === 'success' &&
|
|
125
|
+
'Your deposit has been successfully processed.', status === 'failed' &&
|
|
126
|
+
'Something went wrong while processing your deposit. Please try again or contact support.'] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
|
|
127
|
+
api.setOpen(false);
|
|
128
|
+
}, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
|
|
129
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function MayaAppDeposit(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Portal } from '@ark-ui/react';
|
|
3
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
import { Controller, useForm } from 'react-hook-form';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { useAvailablePromosQuery, useCreateMayaAppDepositMutation, useDepositsCountQuery, usePaymentSettingsQuery, } from '../../../../client/hooks/index.js';
|
|
8
|
+
import { AlertCircleIcon, ChevronDownIcon, ChevronUpIcon, SpinnerIcon, XIcon, } from '../../../../icons/index.js';
|
|
9
|
+
import { AlertDialog, Button, Field, NumberInput } from '../../../../ui/index.js';
|
|
10
|
+
import { parseDecimal } from '../../../../utils/index.js';
|
|
11
|
+
import { AmountChoices } from '../../AmountChoices.js';
|
|
12
|
+
import { AvailablePromos } from '../AvailablePromos.js';
|
|
13
|
+
export function MayaAppDeposit() {
|
|
14
|
+
const [status, setStatus] = useState('waiting');
|
|
15
|
+
const createDepositMutation = useCreateMayaAppDepositMutation({
|
|
16
|
+
onMutate() {
|
|
17
|
+
setStatus('processing');
|
|
18
|
+
},
|
|
19
|
+
onSuccess() {
|
|
20
|
+
setStatus('success');
|
|
21
|
+
form.reset();
|
|
22
|
+
},
|
|
23
|
+
onError() {
|
|
24
|
+
setStatus('failed');
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
const depositsCountQuery = useDepositsCountQuery();
|
|
28
|
+
const depositsCount = depositsCountQuery.data ?? 0;
|
|
29
|
+
const paymentSettingsQuery = usePaymentSettingsQuery();
|
|
30
|
+
const paymentSettings = paymentSettingsQuery.data;
|
|
31
|
+
const gatewaySettings = paymentSettings?.mayaAppDepositGatewaySettings;
|
|
32
|
+
const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
|
|
33
|
+
const minimumAmount = depositsCount <= 0
|
|
34
|
+
? parseDecimal(paymentSettingsQuery.data?.minimumFirstDepositAmount, 0)
|
|
35
|
+
: parseDecimal(gatewaySettings?.minimumAmount, 0);
|
|
36
|
+
const promosQuery = useAvailablePromosQuery();
|
|
37
|
+
const promos = promosQuery.data ?? [];
|
|
38
|
+
const definition = z
|
|
39
|
+
.object({
|
|
40
|
+
amount: z.string().superRefine((val, ctx) => {
|
|
41
|
+
const n = parseDecimal(val, 0);
|
|
42
|
+
if (n < minimumAmount) {
|
|
43
|
+
ctx.addIssue({
|
|
44
|
+
type: 'number',
|
|
45
|
+
code: z.ZodIssueCode.too_small,
|
|
46
|
+
inclusive: true,
|
|
47
|
+
minimum: minimumAmount,
|
|
48
|
+
message: `Minimum amount is ${minimumAmount.toLocaleString()}`,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (n > maximumAmount) {
|
|
52
|
+
ctx.addIssue({
|
|
53
|
+
type: 'number',
|
|
54
|
+
code: z.ZodIssueCode.too_big,
|
|
55
|
+
inclusive: true,
|
|
56
|
+
maximum: maximumAmount,
|
|
57
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}),
|
|
61
|
+
promo: z.string().optional().nullable(),
|
|
62
|
+
})
|
|
63
|
+
.superRefine((value, ctx) => {
|
|
64
|
+
const promo = promos.find((o) => o.id === value.promo);
|
|
65
|
+
const promoMinAmount = parseDecimal(promo?.minimumDepositAmount, 0);
|
|
66
|
+
const promoMaxAmount = parseDecimal(promo?.maximumDepositAmount, 0);
|
|
67
|
+
const amount = parseDecimal(value.amount, 0);
|
|
68
|
+
if (promo && amount < promoMinAmount) {
|
|
69
|
+
ctx.addIssue({
|
|
70
|
+
path: ['amount'],
|
|
71
|
+
code: z.ZodIssueCode.custom,
|
|
72
|
+
message: `Minimum amount for this promo is ${promoMinAmount.toLocaleString()}`,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
if (promo && amount > promoMaxAmount) {
|
|
76
|
+
ctx.addIssue({
|
|
77
|
+
path: ['amount'],
|
|
78
|
+
code: z.ZodIssueCode.custom,
|
|
79
|
+
message: `Maximum amount for this promo is ${promoMaxAmount}`,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
const form = useForm({
|
|
84
|
+
mode: 'all',
|
|
85
|
+
resolver: zodResolver(definition),
|
|
86
|
+
defaultValues: {
|
|
87
|
+
amount: '0',
|
|
88
|
+
promo: null,
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
if (minimumAmount) {
|
|
93
|
+
form.reset({
|
|
94
|
+
amount: minimumAmount.toString(),
|
|
95
|
+
promo: null,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}, [form, minimumAmount]);
|
|
99
|
+
const handleSubmit = form.handleSubmit(async (data) => {
|
|
100
|
+
createDepositMutation.mutate({
|
|
101
|
+
amount: data.amount.toString(),
|
|
102
|
+
promo: data.promo ?? undefined,
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
return (_jsxs("form", { onSubmit: handleSubmit, noValidate: true, children: [_jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
|
|
106
|
+
o.field.onChange(details.value);
|
|
107
|
+
}, formatOptions: {
|
|
108
|
+
maximumFractionDigits: 2,
|
|
109
|
+
minimumFractionDigits: 0,
|
|
110
|
+
}, allowMouseWheel: true, children: [_jsx(NumberInput.Label, { children: "Enter amount you want to deposit" }), _jsxs(NumberInput.Control, { children: [_jsx(NumberInput.Input, {}), _jsx(NumberInput.IncrementTrigger, { children: _jsx(ChevronUpIcon, {}) }), _jsx(NumberInput.DecrementTrigger, { children: _jsx(ChevronDownIcon, {}) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.amount?.message })] })) }), _jsx(AmountChoices, { value: parseDecimal(form.watch('amount'), 0), onChange: (value) => {
|
|
111
|
+
form.setValue('amount', value.toString(), {
|
|
112
|
+
shouldTouch: true,
|
|
113
|
+
shouldDirty: true,
|
|
114
|
+
shouldValidate: true,
|
|
115
|
+
});
|
|
116
|
+
}, min: minimumAmount, max: maximumAmount, className: "mt-lg" }), _jsx(Controller, { control: form.control, name: "promo", render: (o) => (_jsx(AvailablePromos, { value: o.field.value, onChange: o.field.onChange, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: createDepositMutation.isPending, children: "Deposit" }), _jsxs("p", { className: "text-text-tertiary-600 mt-lg text-xs", children: ["By depositing, you agree to our", ' ', _jsx("button", { type: "button", className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
|
|
117
|
+
if (!details.open) {
|
|
118
|
+
setStatus('waiting');
|
|
119
|
+
}
|
|
120
|
+
}, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { disabled: status === 'processing', children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "text-text-brand-primary-600 size-12" })), status === 'success' && (_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "bg-bg-error-secondary text-text-featured-icon-light-error flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Deposit', status === 'success' && 'Deposit Successful', status === 'failed' && 'Deposit Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
|
|
121
|
+
"We're verifying your account and amount. Please hold a moment.", status === 'success' &&
|
|
122
|
+
'Your deposit has been successfully processed.', status === 'failed' &&
|
|
123
|
+
'Something went wrong while processing your deposit. Please try again or contact support.'] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
|
|
124
|
+
api.setOpen(false);
|
|
125
|
+
}, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
|
|
126
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function MayaDeposit(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Portal } from '@ark-ui/react';
|
|
3
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
import { Controller, useForm } from 'react-hook-form';
|
|
6
|
+
import invariant from 'tiny-invariant';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { useAvailablePromosQuery, useCreateMayaDepositMutation, useDepositsCountQuery, usePaymentSettingsQuery, } from '../../../../client/hooks/index.js';
|
|
9
|
+
import { AlertCircleIcon, ChevronDownIcon, ChevronUpIcon, SpinnerIcon, XIcon, } from '../../../../icons/index.js';
|
|
10
|
+
import { AlertDialog, Button, Field, NumberInput } from '../../../../ui/index.js';
|
|
11
|
+
import { parseDecimal } from '../../../../utils/index.js';
|
|
12
|
+
import { AmountChoices } from '../../AmountChoices.js';
|
|
13
|
+
import { AvailablePromos } from '../AvailablePromos.js';
|
|
14
|
+
export function MayaDeposit() {
|
|
15
|
+
const [status, setStatus] = useState('waiting');
|
|
16
|
+
const createDepositMutation = useCreateMayaDepositMutation({
|
|
17
|
+
onMutate() {
|
|
18
|
+
setStatus('processing');
|
|
19
|
+
},
|
|
20
|
+
onSuccess(data) {
|
|
21
|
+
invariant(data.checkoutUrl);
|
|
22
|
+
window.open(data.checkoutUrl, '_blank', 'noopener,noreferrer');
|
|
23
|
+
form.reset();
|
|
24
|
+
setStatus('success');
|
|
25
|
+
},
|
|
26
|
+
onError() {
|
|
27
|
+
setStatus('failed');
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
const depositsCountQuery = useDepositsCountQuery();
|
|
31
|
+
const depositsCount = depositsCountQuery.data ?? 0;
|
|
32
|
+
const paymentSettingsQuery = usePaymentSettingsQuery();
|
|
33
|
+
const paymentSettings = paymentSettingsQuery.data;
|
|
34
|
+
const gatewaySettings = paymentSettings?.mayaDepositGatewaySettings;
|
|
35
|
+
const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
|
|
36
|
+
const minimumAmount = depositsCount <= 0
|
|
37
|
+
? parseDecimal(paymentSettingsQuery.data?.minimumFirstDepositAmount, 0)
|
|
38
|
+
: parseDecimal(gatewaySettings?.minimumAmount, 0);
|
|
39
|
+
const promosQuery = useAvailablePromosQuery();
|
|
40
|
+
const promos = promosQuery.data ?? [];
|
|
41
|
+
const definition = z
|
|
42
|
+
.object({
|
|
43
|
+
amount: z.string().superRefine((val, ctx) => {
|
|
44
|
+
const n = parseDecimal(val, 0);
|
|
45
|
+
if (n < minimumAmount) {
|
|
46
|
+
ctx.addIssue({
|
|
47
|
+
type: 'number',
|
|
48
|
+
code: z.ZodIssueCode.too_small,
|
|
49
|
+
inclusive: true,
|
|
50
|
+
minimum: minimumAmount,
|
|
51
|
+
message: `Minimum amount is ${minimumAmount.toLocaleString()}`,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (n > maximumAmount) {
|
|
55
|
+
ctx.addIssue({
|
|
56
|
+
type: 'number',
|
|
57
|
+
code: z.ZodIssueCode.too_big,
|
|
58
|
+
inclusive: true,
|
|
59
|
+
maximum: maximumAmount,
|
|
60
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}),
|
|
64
|
+
promo: z.string().optional().nullable(),
|
|
65
|
+
})
|
|
66
|
+
.superRefine((value, ctx) => {
|
|
67
|
+
const promo = promos.find((o) => o.id === value.promo);
|
|
68
|
+
const promoMinAmount = parseDecimal(promo?.minimumDepositAmount, 0);
|
|
69
|
+
const promoMaxAmount = parseDecimal(promo?.maximumDepositAmount, 0);
|
|
70
|
+
const amount = parseDecimal(value.amount, 0);
|
|
71
|
+
if (promo && amount < promoMinAmount) {
|
|
72
|
+
ctx.addIssue({
|
|
73
|
+
path: ['amount'],
|
|
74
|
+
code: z.ZodIssueCode.custom,
|
|
75
|
+
message: `Minimum amount for this promo is ${promoMinAmount.toLocaleString()}`,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
if (promo && amount > promoMaxAmount) {
|
|
79
|
+
ctx.addIssue({
|
|
80
|
+
path: ['amount'],
|
|
81
|
+
code: z.ZodIssueCode.custom,
|
|
82
|
+
message: `Maximum amount for this promo is ${promoMaxAmount}`,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
const form = useForm({
|
|
87
|
+
mode: 'all',
|
|
88
|
+
resolver: zodResolver(definition),
|
|
89
|
+
defaultValues: {
|
|
90
|
+
amount: '0',
|
|
91
|
+
promo: null,
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (minimumAmount) {
|
|
96
|
+
form.reset({
|
|
97
|
+
amount: minimumAmount.toString(),
|
|
98
|
+
promo: null,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}, [form, minimumAmount]);
|
|
102
|
+
const handleSubmit = form.handleSubmit(async (data) => {
|
|
103
|
+
createDepositMutation.mutate({
|
|
104
|
+
amount: data.amount.toString(),
|
|
105
|
+
promo: data.promo ?? undefined,
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
return (_jsxs("form", { onSubmit: handleSubmit, noValidate: true, children: [_jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
|
|
109
|
+
o.field.onChange(details.value);
|
|
110
|
+
}, formatOptions: {
|
|
111
|
+
maximumFractionDigits: 2,
|
|
112
|
+
minimumFractionDigits: 0,
|
|
113
|
+
}, allowMouseWheel: true, children: [_jsx(NumberInput.Label, { children: "Enter amount you want to deposit" }), _jsxs(NumberInput.Control, { children: [_jsx(NumberInput.Input, {}), _jsx(NumberInput.IncrementTrigger, { children: _jsx(ChevronUpIcon, {}) }), _jsx(NumberInput.DecrementTrigger, { children: _jsx(ChevronDownIcon, {}) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.amount?.message })] })) }), _jsx(AmountChoices, { value: parseDecimal(form.watch('amount'), 0), onChange: (value) => {
|
|
114
|
+
form.setValue('amount', value.toString(), {
|
|
115
|
+
shouldTouch: true,
|
|
116
|
+
shouldDirty: true,
|
|
117
|
+
shouldValidate: true,
|
|
118
|
+
});
|
|
119
|
+
}, min: minimumAmount, max: maximumAmount, className: "mt-lg" }), _jsx(Controller, { control: form.control, name: "promo", render: (o) => (_jsx(AvailablePromos, { value: o.field.value, onChange: o.field.onChange, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: createDepositMutation.isPending, children: "Deposit" }), _jsxs("p", { className: "text-text-tertiary-600 mt-lg text-xs", children: ["By depositing, you agree to our", ' ', _jsx("button", { type: "button", className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
|
|
120
|
+
if (!details.open) {
|
|
121
|
+
setStatus('waiting');
|
|
122
|
+
}
|
|
123
|
+
}, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { disabled: status === 'processing', children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "text-text-brand-primary-600 size-12" })), status === 'success' && (_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "bg-bg-error-secondary text-text-featured-icon-light-error flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Deposit', status === 'success' && 'Deposit Successful', status === 'failed' && 'Deposit Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
|
|
124
|
+
"We're verifying your account and amount. Please hold a moment.", status === 'success' &&
|
|
125
|
+
'Your deposit has been successfully processed.', status === 'failed' &&
|
|
126
|
+
'Something went wrong while processing your deposit. Please try again or contact support.'] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
|
|
127
|
+
api.setOpen(false);
|
|
128
|
+
}, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
|
|
129
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function OnlineBankDeposit(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { OnlineBankDepositAlert } from './OnlineBankDepositAlert.js';
|
|
3
|
+
import { OnlineBankDepositContext } from './OnlineBankDepositContext.js';
|
|
4
|
+
import { OnlineBankDepositDetails } from './OnlineBankDepositDetails.js';
|
|
5
|
+
import { OnlineBankDepositForm } from './OnlineBankDepositForm.js';
|
|
6
|
+
import { useOnlineBankDeposit } from './useOnlineBankDeposit.js';
|
|
7
|
+
export function OnlineBankDeposit() {
|
|
8
|
+
const context = useOnlineBankDeposit();
|
|
9
|
+
return (_jsxs(OnlineBankDepositContext, { value: context, children: [_jsx(OnlineBankDepositForm, {}), _jsx(OnlineBankDepositDetails, {}), _jsx(OnlineBankDepositAlert, {})] }));
|
|
10
|
+
}
|
package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositAlert.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function OnlineBankDepositAlert(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Portal } from '@ark-ui/react';
|
|
3
|
+
import { AlertCircleIcon, SpinnerIcon, XIcon } from '../../../../icons/index.js';
|
|
4
|
+
import { AlertDialog, Button } from '../../../../ui/index.js';
|
|
5
|
+
import { useOnlineBankDepositContext } from './OnlineBankDepositContext.js';
|
|
6
|
+
export function OnlineBankDepositAlert() {
|
|
7
|
+
const context = useOnlineBankDepositContext();
|
|
8
|
+
const details = useDetails();
|
|
9
|
+
return (_jsx(AlertDialog.Root, { open: context.status !== 'waiting' &&
|
|
10
|
+
context.status !== 'verification-waiting', onOpenChange: (details) => {
|
|
11
|
+
if (!details.open) {
|
|
12
|
+
context.reset();
|
|
13
|
+
}
|
|
14
|
+
}, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { disabled: details.type === 'loading', children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [details.type === 'loading' && (_jsx(SpinnerIcon, { className: "text-text-brand-primary-600 size-12" })), details.type === 'success' && (_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) })), details.type === 'erorr' && (_jsx("div", { className: "bg-bg-error-secondary text-text-featured-icon-light-error flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsx(AlertDialog.Title, { children: details.title }), _jsx(AlertDialog.Description, { children: details.description })] }), (details.type === 'erorr' || details.type === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
|
|
15
|
+
api.setOpen(false);
|
|
16
|
+
}, children: details.type === 'success' ? 'Ok' : 'Try Again' })) }) }))] }) })] }) }));
|
|
17
|
+
}
|
|
18
|
+
function useDetails() {
|
|
19
|
+
const context = useOnlineBankDepositContext();
|
|
20
|
+
const title = (() => {
|
|
21
|
+
let s = '';
|
|
22
|
+
if (context.status === 'processing') {
|
|
23
|
+
s = 'Processing Deposit';
|
|
24
|
+
}
|
|
25
|
+
else if (context.status === 'failed') {
|
|
26
|
+
s = 'Deposit Failed';
|
|
27
|
+
}
|
|
28
|
+
else if (context.status === 'verification-success') {
|
|
29
|
+
s = 'Deposit Successful';
|
|
30
|
+
}
|
|
31
|
+
else if (context.status === 'verification-processing') {
|
|
32
|
+
s = 'Verifying Deposit';
|
|
33
|
+
}
|
|
34
|
+
else if (context.status === 'verification-failed') {
|
|
35
|
+
if (context.deposit?.status === 'CANCELLED') {
|
|
36
|
+
s = 'Deposit Cancelled';
|
|
37
|
+
}
|
|
38
|
+
else if (context.deposit?.status === 'REJECTED') {
|
|
39
|
+
s = 'Deposit Rejected';
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
s = 'Deposit Failed';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return s;
|
|
46
|
+
})();
|
|
47
|
+
const description = (() => {
|
|
48
|
+
let d = '';
|
|
49
|
+
if (context.status === 'processing') {
|
|
50
|
+
d = "We're verifying your account and amount. Please hold a moment.";
|
|
51
|
+
}
|
|
52
|
+
else if (context.status === 'failed') {
|
|
53
|
+
d =
|
|
54
|
+
'Something went wrong while processing your deposit. ' +
|
|
55
|
+
'Please try again or contact support.';
|
|
56
|
+
}
|
|
57
|
+
else if (context.status === 'verification-success') {
|
|
58
|
+
d = 'Your deposit has been successfully processed.';
|
|
59
|
+
}
|
|
60
|
+
else if (context.status === 'verification-processing') {
|
|
61
|
+
d = 'Your deposit is being processed.';
|
|
62
|
+
}
|
|
63
|
+
else if (context.status === 'verification-failed') {
|
|
64
|
+
if (context.deposit?.status === 'CANCELLED') {
|
|
65
|
+
d = 'Your deposit has been cancelled.';
|
|
66
|
+
}
|
|
67
|
+
else if (context.deposit?.status === 'REJECTED') {
|
|
68
|
+
d = 'Your deposit has been rejected.';
|
|
69
|
+
}
|
|
70
|
+
else if (context.deposit?.status === 'FAILED') {
|
|
71
|
+
d = context.deposit.error ?? 'Your deposit has failed.';
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
d =
|
|
75
|
+
'Something went wrong while processing your deposit. ' +
|
|
76
|
+
'Please try again or contact support.';
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return d;
|
|
80
|
+
})();
|
|
81
|
+
const type = (() => {
|
|
82
|
+
if (context.status === 'failed' ||
|
|
83
|
+
context.status === 'verification-failed') {
|
|
84
|
+
return 'erorr';
|
|
85
|
+
}
|
|
86
|
+
if (context.status === 'verification-success') {
|
|
87
|
+
return 'success';
|
|
88
|
+
}
|
|
89
|
+
return 'loading';
|
|
90
|
+
})();
|
|
91
|
+
return {
|
|
92
|
+
type,
|
|
93
|
+
title,
|
|
94
|
+
description,
|
|
95
|
+
};
|
|
96
|
+
}
|