@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,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { ark } from '@ark-ui/react';
|
|
4
|
+
import { useShallow } from 'zustand/shallow';
|
|
5
|
+
import { useGlobalStore, useSessionQuery } from '../../client/hooks/index.js';
|
|
6
|
+
export function DepositWithdrawalTrigger(props) {
|
|
7
|
+
const sessionQuery = useSessionQuery();
|
|
8
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
9
|
+
depositWithdrawal: ctx.depositWithdrawal,
|
|
10
|
+
})));
|
|
11
|
+
const disabled = sessionQuery.data?.status === 'unauthenticated'
|
|
12
|
+
? true
|
|
13
|
+
: globalStore.depositWithdrawal.open
|
|
14
|
+
? true
|
|
15
|
+
: props.disabled;
|
|
16
|
+
return (_jsx(ark.button, { type: "button", "aria-label": "Deposit or Withdraw", "data-state": globalStore.depositWithdrawal.open ? 'open' : 'closed', ...props, disabled: disabled, onClick: async (e) => {
|
|
17
|
+
props.onClick?.(e);
|
|
18
|
+
globalStore.depositWithdrawal.setTab('DEPOSIT');
|
|
19
|
+
globalStore.depositWithdrawal.setOpen(true);
|
|
20
|
+
} }));
|
|
21
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type PaymentMethod } from './utils';
|
|
2
|
+
interface PaymentMethodsProps {
|
|
3
|
+
value?: PaymentMethod;
|
|
4
|
+
onChange?: (value: PaymentMethod) => void;
|
|
5
|
+
defaultValue?: PaymentMethod;
|
|
6
|
+
options?: PaymentMethod[];
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function PaymentMethods(props: PaymentMethodsProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Image from 'next/image';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { useControllableState } from '../../client/hooks/index.js';
|
|
5
|
+
import { CheckIcon } from '../../icons/index.js';
|
|
6
|
+
import qrph from '../../images/QRPH.png';
|
|
7
|
+
import gcash from '../../images/gcash.png';
|
|
8
|
+
import instapay from '../../images/instapay.png';
|
|
9
|
+
import maya from '../../images/maya.png';
|
|
10
|
+
import onlineBank from '../../images/online-bank.png';
|
|
11
|
+
import { Checkbox, Field } from '../../ui/index.js';
|
|
12
|
+
import { PaymentMethodDefinition } from './utils.js';
|
|
13
|
+
const OPTIONS = [
|
|
14
|
+
{
|
|
15
|
+
value: 'GCASH',
|
|
16
|
+
label: 'GCash',
|
|
17
|
+
image: gcash,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
value: 'MAYA_APP',
|
|
21
|
+
label: 'Maya App',
|
|
22
|
+
image: maya,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
value: 'MAYA',
|
|
26
|
+
label: 'Maya',
|
|
27
|
+
image: maya,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: 'QRPH',
|
|
31
|
+
label: 'QRPH',
|
|
32
|
+
image: qrph,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
value: 'ONLINE_BANK',
|
|
36
|
+
label: 'Online Bank',
|
|
37
|
+
image: onlineBank,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
value: 'INSTAPAY',
|
|
41
|
+
label: 'Instapay',
|
|
42
|
+
image: instapay,
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
export function PaymentMethods(props) {
|
|
46
|
+
const options = props.options?.length
|
|
47
|
+
? OPTIONS.filter((option) => props.options?.includes(option.value))
|
|
48
|
+
: OPTIONS;
|
|
49
|
+
const [value, setValue] = useControllableState({
|
|
50
|
+
value: props.value,
|
|
51
|
+
defaultValue: props.defaultValue ?? options[0].value,
|
|
52
|
+
onChange: props.onChange,
|
|
53
|
+
});
|
|
54
|
+
return (_jsxs("div", { className: props.className, children: [_jsx(Field.Label, { asChild: true, children: _jsx("div", { children: "Available payment methods" }) }), _jsx(Checkbox.Group, { value: [value], onValueChange: (newValue) => {
|
|
55
|
+
const lastValue = newValue.at(-1);
|
|
56
|
+
if (!lastValue)
|
|
57
|
+
return;
|
|
58
|
+
setValue(PaymentMethodDefinition.parse(lastValue));
|
|
59
|
+
}, className: "grid grid-cols-2 gap-x-4 gap-y-3", children: options.map((option) => (_jsxs(Checkbox.Root, { value: option.value, className: "border-border-secondary ui-checked:border-border-brand-solid flex cursor-pointer items-center justify-between rounded-xl border p-lg", children: [_jsx("div", { className: twMerge('rounded-xs bg-white px-sm py-[0.688rem]', option.value === 'GCASH' && 'bg-[#017EFF]'), children: _jsx(Image, { src: option.image, alt: "", width: 200, height: 40, className: "h-[1.063rem] w-auto", draggable: false }) }), _jsx(Checkbox.Control, { className: "shrink-0", children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.HiddenInput, {})] }, option.value))) })] }));
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function GCashWithdrawal(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,109 @@
|
|
|
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 { useCreateGCashWithdrawalMutation, useLocaleInfo, useMobileNumberParser, usePaymentSettingsQuery, } from '../../../../client/hooks/index.js';
|
|
8
|
+
import { AlertCircleIcon, ChevronDownIcon, ChevronUpIcon, EyeIcon, EyeOffIcon, SpinnerIcon, XIcon, } from '../../../../icons/index.js';
|
|
9
|
+
import { AlertDialog, Button, Field, NumberInput, PasswordInput, } from '../../../../ui/index.js';
|
|
10
|
+
import { parseDecimal } from '../../../../utils/index.js';
|
|
11
|
+
import { AmountChoices } from '../../AmountChoices.js';
|
|
12
|
+
export function GCashWithdrawal() {
|
|
13
|
+
const [status, setStatus] = useState('waiting');
|
|
14
|
+
const localeInfo = useLocaleInfo();
|
|
15
|
+
const mobileNumberParser = useMobileNumberParser();
|
|
16
|
+
const createWithdrawalMutation = useCreateGCashWithdrawalMutation({
|
|
17
|
+
onMutate() {
|
|
18
|
+
setStatus('processing');
|
|
19
|
+
},
|
|
20
|
+
onSuccess() {
|
|
21
|
+
setStatus('success');
|
|
22
|
+
form.reset();
|
|
23
|
+
},
|
|
24
|
+
onError() {
|
|
25
|
+
setStatus('failed');
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const paymentSettingsQuery = usePaymentSettingsQuery();
|
|
29
|
+
const paymentSettings = paymentSettingsQuery.data;
|
|
30
|
+
const gatewaySettings = paymentSettings?.gcashWithdrawalGatewaySettings;
|
|
31
|
+
const minimumAmount = parseDecimal(gatewaySettings?.minimumAmount, 0);
|
|
32
|
+
const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
|
|
33
|
+
const definition = z.object({
|
|
34
|
+
amount: z.string().superRefine((val, ctx) => {
|
|
35
|
+
const n = parseDecimal(val, 0);
|
|
36
|
+
if (n < minimumAmount) {
|
|
37
|
+
ctx.addIssue({
|
|
38
|
+
type: 'number',
|
|
39
|
+
code: z.ZodIssueCode.too_small,
|
|
40
|
+
inclusive: true,
|
|
41
|
+
minimum: minimumAmount,
|
|
42
|
+
message: `Minimum amount is ${minimumAmount.toLocaleString()}`,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
if (n > maximumAmount) {
|
|
46
|
+
ctx.addIssue({
|
|
47
|
+
type: 'number',
|
|
48
|
+
code: z.ZodIssueCode.too_big,
|
|
49
|
+
inclusive: true,
|
|
50
|
+
maximum: maximumAmount,
|
|
51
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}),
|
|
55
|
+
password: z
|
|
56
|
+
.string()
|
|
57
|
+
.min(8, 'Password must be 8 or more characters')
|
|
58
|
+
.max(64, 'Password must be not be more than 64 characters'),
|
|
59
|
+
mobileNumber: z
|
|
60
|
+
.string()
|
|
61
|
+
.regex(localeInfo.mobileNumber.pattern, 'Invalid mobile number'),
|
|
62
|
+
});
|
|
63
|
+
const form = useForm({
|
|
64
|
+
mode: 'all',
|
|
65
|
+
resolver: zodResolver(definition),
|
|
66
|
+
defaultValues: {
|
|
67
|
+
amount: '0',
|
|
68
|
+
password: '',
|
|
69
|
+
mobileNumber: '',
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (minimumAmount) {
|
|
74
|
+
form.reset({
|
|
75
|
+
amount: minimumAmount.toString(),
|
|
76
|
+
password: '',
|
|
77
|
+
mobileNumber: '',
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}, [form, minimumAmount]);
|
|
81
|
+
const handleSubmit = form.handleSubmit(async (data) => {
|
|
82
|
+
createWithdrawalMutation.mutate({
|
|
83
|
+
amount: data.amount,
|
|
84
|
+
recipientMobileNumber: mobileNumberParser.format(data.mobileNumber),
|
|
85
|
+
transactionPassword: data.password,
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
return (_jsxs("form", { onSubmit: handleSubmit, noValidate: true, autoComplete: "off", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsx(localeInfo.country.flag, { className: "pointer-events-none absolute left-3.5 top-1/2 size-5 -translate-y-1/2" }), _jsx(Field.Input, { className: "pl-10.5", ...form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: form.formState.errors.mobileNumber?.message })] }), _jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, className: "mt-3xl", children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
|
|
89
|
+
o.field.onChange(details.value);
|
|
90
|
+
}, formatOptions: {
|
|
91
|
+
maximumFractionDigits: 2,
|
|
92
|
+
minimumFractionDigits: 0,
|
|
93
|
+
}, allowMouseWheel: true, children: [_jsx(NumberInput.Label, { children: "Enter amount you want to withdraw" }), _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) => {
|
|
94
|
+
form.setValue('amount', value.toString(), {
|
|
95
|
+
shouldTouch: true,
|
|
96
|
+
shouldDirty: true,
|
|
97
|
+
shouldValidate: true,
|
|
98
|
+
});
|
|
99
|
+
}, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx("button", { type: "button", className: "underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
|
|
100
|
+
if (!details.open) {
|
|
101
|
+
setStatus('waiting');
|
|
102
|
+
}
|
|
103
|
+
}, 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 Withdraw', status === 'success' && 'Withdrawal Submitted', status === 'failed' && 'Withdraw Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
|
|
104
|
+
"We're verifying your account and amount. Please hold a moment.", status === 'success' &&
|
|
105
|
+
'Your withdrawal request has been submitted successfully and is awaiting confirmation. You won’t have to wait long — once approved, the funds will be credited to your account.', status === 'failed' &&
|
|
106
|
+
'Something went wrong while processing your withdrawal. Please try again or contact support.'] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
|
|
107
|
+
api.setOpen(false);
|
|
108
|
+
}, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
|
|
109
|
+
}
|
package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function InstapayWithdrawal(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createListCollection, Portal } from '@ark-ui/react';
|
|
3
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
4
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
5
|
+
import { Controller, useForm } from 'react-hook-form';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { useCreateInstapayWithdrawalMutation, useInstapayBankListQuery, usePaymentSettingsQuery, } from '../../../../client/hooks/index.js';
|
|
8
|
+
import { AlertCircleIcon, CheckIcon, ChevronDownIcon, ChevronUpIcon, EyeIcon, EyeOffIcon, SpinnerIcon, XIcon, } from '../../../../icons/index.js';
|
|
9
|
+
import { AlertDialog, Button, Field, NumberInput, PasswordInput, Select, } from '../../../../ui/index.js';
|
|
10
|
+
import { parseDecimal } from '../../../../utils/index.js';
|
|
11
|
+
import { AmountChoices } from '../../AmountChoices.js';
|
|
12
|
+
export function InstapayWithdrawal() {
|
|
13
|
+
const [status, setStatus] = useState('waiting');
|
|
14
|
+
const createWithdrawalMutation = useCreateInstapayWithdrawalMutation({
|
|
15
|
+
onMutate() {
|
|
16
|
+
setStatus('processing');
|
|
17
|
+
},
|
|
18
|
+
onSuccess() {
|
|
19
|
+
form.reset();
|
|
20
|
+
setStatus('success');
|
|
21
|
+
},
|
|
22
|
+
onError() {
|
|
23
|
+
setStatus('failed');
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
const instapayBankListQuery = useInstapayBankListQuery();
|
|
27
|
+
const instapayBankList = instapayBankListQuery.data;
|
|
28
|
+
const paymentSettingsQuery = usePaymentSettingsQuery();
|
|
29
|
+
const paymentSettings = paymentSettingsQuery.data;
|
|
30
|
+
const gatewaySettings = paymentSettings?.instapayWithdrawalGatewaySettings;
|
|
31
|
+
const minimumAmount = parseDecimal(gatewaySettings?.minimumAmount, 0);
|
|
32
|
+
const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
|
|
33
|
+
const definition = z.object({
|
|
34
|
+
amount: z.string().superRefine((val, ctx) => {
|
|
35
|
+
const n = parseDecimal(val, 0);
|
|
36
|
+
if (n < minimumAmount) {
|
|
37
|
+
ctx.addIssue({
|
|
38
|
+
type: 'number',
|
|
39
|
+
code: z.ZodIssueCode.too_small,
|
|
40
|
+
inclusive: true,
|
|
41
|
+
minimum: minimumAmount,
|
|
42
|
+
message: `Minimum amount is ${minimumAmount.toLocaleString()}`,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
if (n > maximumAmount) {
|
|
46
|
+
ctx.addIssue({
|
|
47
|
+
type: 'number',
|
|
48
|
+
code: z.ZodIssueCode.too_big,
|
|
49
|
+
inclusive: true,
|
|
50
|
+
maximum: maximumAmount,
|
|
51
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}),
|
|
55
|
+
password: z
|
|
56
|
+
.string()
|
|
57
|
+
.min(8, 'Password must be 8 or more characters')
|
|
58
|
+
.max(64, 'Password must be not be more than 64 characters'),
|
|
59
|
+
accountNumber: z.string().min(1).trim(),
|
|
60
|
+
bankCode: z.string().min(1, 'Bank is required').trim(),
|
|
61
|
+
});
|
|
62
|
+
const form = useForm({
|
|
63
|
+
mode: 'all',
|
|
64
|
+
resolver: zodResolver(definition),
|
|
65
|
+
defaultValues: {
|
|
66
|
+
amount: '0',
|
|
67
|
+
password: '',
|
|
68
|
+
accountNumber: '',
|
|
69
|
+
bankCode: '',
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (minimumAmount) {
|
|
74
|
+
form.reset({
|
|
75
|
+
amount: minimumAmount.toString(),
|
|
76
|
+
bankCode: form.getValues('bankCode'),
|
|
77
|
+
password: '',
|
|
78
|
+
accountNumber: '',
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}, [form, minimumAmount]);
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
if (instapayBankList?.length) {
|
|
84
|
+
form.reset({
|
|
85
|
+
amount: form.getValues('amount'),
|
|
86
|
+
bankCode: instapayBankList[0].code,
|
|
87
|
+
password: '',
|
|
88
|
+
accountNumber: '',
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}, [form, instapayBankList]);
|
|
92
|
+
const handleSubmit = form.handleSubmit(async (data) => {
|
|
93
|
+
createWithdrawalMutation.mutate({
|
|
94
|
+
amount: data.amount,
|
|
95
|
+
transactionPassword: data.password,
|
|
96
|
+
accountNumber: data.accountNumber,
|
|
97
|
+
bankCode: data.bankCode,
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
const bankCollection = useMemo(() => createListCollection({
|
|
101
|
+
items: instapayBankList ?? [],
|
|
102
|
+
itemToValue: (item) => item.code,
|
|
103
|
+
itemToString: (item) => item.name,
|
|
104
|
+
}), [instapayBankList]);
|
|
105
|
+
console.log(bankCollection.items);
|
|
106
|
+
return (_jsxs("form", { onSubmit: handleSubmit, noValidate: true, autoComplete: "off", children: [_jsx(Controller, { control: form.control, name: "bankCode", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.bankCode, children: [_jsxs(Select.Root, { collection: bankCollection, positioning: {
|
|
107
|
+
sameWidth: true,
|
|
108
|
+
}, value: o.field.value ? [o.field.value] : [], onValueChange: (details) => {
|
|
109
|
+
o.field.onChange(details.value.at(0) ?? '');
|
|
110
|
+
}, children: [_jsx(Select.Label, { children: "Bank" }), _jsx(Select.Control, { children: _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, {}), _jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })] }) }), _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: bankCollection.items.map((item) => (_jsxs(Select.Item, { item: item, children: [_jsx(Select.ItemText, { children: item.name }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, item.id))) }) }) })] }), _jsx(Field.ErrorText, { children: form.formState.errors.bankCode?.message })] })) }), _jsxs(Field.Root, { invalid: !!form.formState.errors.accountNumber, className: "mt-3xl", children: [_jsx(Field.Label, { children: "Bank account number" }), _jsx(Field.Input, { ...form.register('accountNumber') }), _jsx(Field.ErrorText, { children: form.formState.errors.accountNumber?.message })] }), _jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, className: "mt-3xl", children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
|
|
111
|
+
o.field.onChange(details.value);
|
|
112
|
+
}, formatOptions: {
|
|
113
|
+
maximumFractionDigits: 2,
|
|
114
|
+
minimumFractionDigits: 0,
|
|
115
|
+
}, allowMouseWheel: true, children: [_jsx(NumberInput.Label, { children: "Enter amount you want to withdraw" }), _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) => {
|
|
116
|
+
form.setValue('amount', value.toString(), {
|
|
117
|
+
shouldTouch: true,
|
|
118
|
+
shouldDirty: true,
|
|
119
|
+
shouldValidate: true,
|
|
120
|
+
});
|
|
121
|
+
}, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx("button", { type: "button", className: "underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
|
|
122
|
+
if (!details.open) {
|
|
123
|
+
setStatus('waiting');
|
|
124
|
+
}
|
|
125
|
+
}, 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 Withdraw', status === 'success' && 'Withdrawal Submitted', status === 'failed' && 'Withdraw Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
|
|
126
|
+
"We're verifying your account and amount. Please hold a moment.", status === 'success' &&
|
|
127
|
+
'Your withdrawal request has been submitted successfully and is awaiting confirmation. You won’t have to wait long — once approved, the funds will be credited to your account.', status === 'failed' &&
|
|
128
|
+
'Something went wrong while processing your withdrawal. Please try again or contact support.'] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
|
|
129
|
+
api.setOpen(false);
|
|
130
|
+
}, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
|
|
131
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function MayaAppWithdrawal(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,101 @@
|
|
|
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 { useCreateMayaAppWithdrawalMutation, usePaymentSettingsQuery, } from '../../../../client/hooks/index.js';
|
|
8
|
+
import { AlertCircleIcon, ChevronDownIcon, ChevronUpIcon, EyeIcon, EyeOffIcon, SpinnerIcon, XIcon, } from '../../../../icons/index.js';
|
|
9
|
+
import { AlertDialog, Button, Field, NumberInput, PasswordInput, } from '../../../../ui/index.js';
|
|
10
|
+
import { parseDecimal } from '../../../../utils/index.js';
|
|
11
|
+
import { AmountChoices } from '../../AmountChoices.js';
|
|
12
|
+
export function MayaAppWithdrawal() {
|
|
13
|
+
const [status, setStatus] = useState('waiting');
|
|
14
|
+
const createWithdrawalMutation = useCreateMayaAppWithdrawalMutation({
|
|
15
|
+
onMutate() {
|
|
16
|
+
setStatus('processing');
|
|
17
|
+
},
|
|
18
|
+
onSuccess() {
|
|
19
|
+
form.reset();
|
|
20
|
+
setStatus('success');
|
|
21
|
+
},
|
|
22
|
+
onError() {
|
|
23
|
+
setStatus('failed');
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
const paymentSettingsQuery = usePaymentSettingsQuery();
|
|
27
|
+
const paymentSettings = paymentSettingsQuery.data;
|
|
28
|
+
const gatewaySettings = paymentSettings?.mayaAppWithdrawalGatewaySettings;
|
|
29
|
+
const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
|
|
30
|
+
const minimumAmount = parseDecimal(gatewaySettings?.minimumAmount, 0);
|
|
31
|
+
const definition = z.object({
|
|
32
|
+
amount: z.string().superRefine((val, ctx) => {
|
|
33
|
+
const n = parseDecimal(val, 0);
|
|
34
|
+
if (n < minimumAmount) {
|
|
35
|
+
ctx.addIssue({
|
|
36
|
+
type: 'number',
|
|
37
|
+
code: z.ZodIssueCode.too_small,
|
|
38
|
+
inclusive: true,
|
|
39
|
+
minimum: minimumAmount,
|
|
40
|
+
message: `Minimum amount is ${minimumAmount.toLocaleString()}`,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
if (n > maximumAmount) {
|
|
44
|
+
ctx.addIssue({
|
|
45
|
+
type: 'number',
|
|
46
|
+
code: z.ZodIssueCode.too_big,
|
|
47
|
+
inclusive: true,
|
|
48
|
+
maximum: maximumAmount,
|
|
49
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
password: z
|
|
54
|
+
.string()
|
|
55
|
+
.min(8, 'Password must be 8 or more characters')
|
|
56
|
+
.max(64, 'Password must be not be more than 64 characters'),
|
|
57
|
+
});
|
|
58
|
+
const form = useForm({
|
|
59
|
+
mode: 'all',
|
|
60
|
+
resolver: zodResolver(definition),
|
|
61
|
+
defaultValues: {
|
|
62
|
+
amount: '0',
|
|
63
|
+
password: '',
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (minimumAmount) {
|
|
68
|
+
form.reset({
|
|
69
|
+
amount: minimumAmount.toString(),
|
|
70
|
+
password: '',
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}, [form, minimumAmount]);
|
|
74
|
+
const handleSubmit = form.handleSubmit(async (data) => {
|
|
75
|
+
createWithdrawalMutation.mutate({
|
|
76
|
+
amount: data.amount,
|
|
77
|
+
transactionPassword: data.password,
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
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) => {
|
|
81
|
+
o.field.onChange(details.value);
|
|
82
|
+
}, formatOptions: {
|
|
83
|
+
maximumFractionDigits: 2,
|
|
84
|
+
minimumFractionDigits: 0,
|
|
85
|
+
}, 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) => {
|
|
86
|
+
form.setValue('amount', value.toString(), {
|
|
87
|
+
shouldTouch: true,
|
|
88
|
+
shouldDirty: true,
|
|
89
|
+
shouldValidate: true,
|
|
90
|
+
});
|
|
91
|
+
}, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx("button", { type: "button", className: "underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
|
|
92
|
+
if (!details.open) {
|
|
93
|
+
setStatus('waiting');
|
|
94
|
+
}
|
|
95
|
+
}, 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 Withdraw', status === 'success' && 'Withdrawal Submitted', status === 'failed' && 'Withdraw Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
|
|
96
|
+
"We're verifying your account and amount. Please hold a moment.", status === 'success' &&
|
|
97
|
+
'Your withdrawal request has been submitted successfully and is awaiting confirmation. You won’t have to wait long — once approved, the funds will be credited to your account.', status === 'failed' &&
|
|
98
|
+
'Something went wrong while processing your withdrawal. Please try again or contact support.'] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
|
|
99
|
+
api.setOpen(false);
|
|
100
|
+
}, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
|
|
101
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function MayaWithdrawal(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,109 @@
|
|
|
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 { useCreateMayaWithdrawalMutation, useLocaleInfo, useMobileNumberParser, usePaymentSettingsQuery, } from '../../../../client/hooks/index.js';
|
|
8
|
+
import { AlertCircleIcon, ChevronDownIcon, ChevronUpIcon, EyeIcon, EyeOffIcon, SpinnerIcon, XIcon, } from '../../../../icons/index.js';
|
|
9
|
+
import { AlertDialog, Button, Field, NumberInput, PasswordInput, } from '../../../../ui/index.js';
|
|
10
|
+
import { parseDecimal } from '../../../../utils/index.js';
|
|
11
|
+
import { AmountChoices } from '../../AmountChoices.js';
|
|
12
|
+
export function MayaWithdrawal() {
|
|
13
|
+
const [status, setStatus] = useState('waiting');
|
|
14
|
+
const localeInfo = useLocaleInfo();
|
|
15
|
+
const mobileNumberParser = useMobileNumberParser();
|
|
16
|
+
const createWithdrawalMutation = useCreateMayaWithdrawalMutation({
|
|
17
|
+
onMutate() {
|
|
18
|
+
setStatus('processing');
|
|
19
|
+
},
|
|
20
|
+
onSuccess() {
|
|
21
|
+
form.reset();
|
|
22
|
+
setStatus('success');
|
|
23
|
+
},
|
|
24
|
+
onError() {
|
|
25
|
+
setStatus('failed');
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const paymentSettingsQuery = usePaymentSettingsQuery();
|
|
29
|
+
const paymentSettings = paymentSettingsQuery.data;
|
|
30
|
+
const gatewaySettings = paymentSettings?.mayaWithdrawalGatewaySettings;
|
|
31
|
+
const minimumAmount = parseDecimal(gatewaySettings?.minimumAmount, 0);
|
|
32
|
+
const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
|
|
33
|
+
const definition = z.object({
|
|
34
|
+
amount: z.string().superRefine((val, ctx) => {
|
|
35
|
+
const n = parseDecimal(val, 0);
|
|
36
|
+
if (n < minimumAmount) {
|
|
37
|
+
ctx.addIssue({
|
|
38
|
+
type: 'number',
|
|
39
|
+
code: z.ZodIssueCode.too_small,
|
|
40
|
+
inclusive: true,
|
|
41
|
+
minimum: minimumAmount,
|
|
42
|
+
message: `Minimum amount is ${minimumAmount.toLocaleString()}`,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
if (n > maximumAmount) {
|
|
46
|
+
ctx.addIssue({
|
|
47
|
+
type: 'number',
|
|
48
|
+
code: z.ZodIssueCode.too_big,
|
|
49
|
+
inclusive: true,
|
|
50
|
+
maximum: maximumAmount,
|
|
51
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}),
|
|
55
|
+
password: z
|
|
56
|
+
.string()
|
|
57
|
+
.min(8, 'Password must be 8 or more characters')
|
|
58
|
+
.max(64, 'Password must be not be more than 64 characters'),
|
|
59
|
+
mobileNumber: z
|
|
60
|
+
.string()
|
|
61
|
+
.regex(localeInfo.mobileNumber.pattern, 'Invalid mobile number'),
|
|
62
|
+
});
|
|
63
|
+
const form = useForm({
|
|
64
|
+
mode: 'all',
|
|
65
|
+
resolver: zodResolver(definition),
|
|
66
|
+
defaultValues: {
|
|
67
|
+
amount: '0',
|
|
68
|
+
password: '',
|
|
69
|
+
mobileNumber: '',
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (minimumAmount) {
|
|
74
|
+
form.reset({
|
|
75
|
+
amount: minimumAmount.toString(),
|
|
76
|
+
password: '',
|
|
77
|
+
mobileNumber: '',
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}, [form, minimumAmount]);
|
|
81
|
+
const handleSubmit = form.handleSubmit(async (data) => {
|
|
82
|
+
createWithdrawalMutation.mutate({
|
|
83
|
+
amount: data.amount,
|
|
84
|
+
recipientMobileNumber: mobileNumberParser.format(data.mobileNumber),
|
|
85
|
+
transactionPassword: data.password,
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
return (_jsxs("form", { onSubmit: handleSubmit, noValidate: true, autoComplete: "off", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsx(localeInfo.country.flag, { className: "pointer-events-none absolute left-3.5 top-1/2 size-5 -translate-y-1/2" }), _jsx(Field.Input, { className: "pl-10.5", ...form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: form.formState.errors.mobileNumber?.message })] }), _jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, className: "mt-3xl", children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
|
|
89
|
+
o.field.onChange(details.value);
|
|
90
|
+
}, formatOptions: {
|
|
91
|
+
maximumFractionDigits: 2,
|
|
92
|
+
minimumFractionDigits: 0,
|
|
93
|
+
}, allowMouseWheel: true, children: [_jsx(NumberInput.Label, { children: "Enter amount you want to withdraw" }), _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) => {
|
|
94
|
+
form.setValue('amount', value.toString(), {
|
|
95
|
+
shouldTouch: true,
|
|
96
|
+
shouldDirty: true,
|
|
97
|
+
shouldValidate: true,
|
|
98
|
+
});
|
|
99
|
+
}, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx("button", { type: "button", className: "underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
|
|
100
|
+
if (!details.open) {
|
|
101
|
+
setStatus('waiting');
|
|
102
|
+
}
|
|
103
|
+
}, 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 Withdraw', status === 'success' && 'Withdrawal Submitted', status === 'failed' && 'Withdraw Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
|
|
104
|
+
"We're verifying your account and amount. Please hold a moment.", status === 'success' &&
|
|
105
|
+
'Your withdrawal request has been submitted successfully and is awaiting confirmation. You won’t have to wait long — once approved, the funds will be credited to your account.', status === 'failed' &&
|
|
106
|
+
'Something went wrong while processing your withdrawal. Please try again or contact support.'] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
|
|
107
|
+
api.setOpen(false);
|
|
108
|
+
}, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
|
|
109
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Withdrawal(): import("react/jsx-runtime").JSX.Element;
|