@opexa/portal-components 0.0.65 → 0.0.67
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 +2 -3
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface AccountProps {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* @default '0px'
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* offsetTop="1em"
|
|
9
|
+
* offsetTop="1rem"
|
|
10
|
+
* offsetTop="16px"
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
offsetTop?: string;
|
|
14
|
+
/** @default '/rewards' */
|
|
15
|
+
rewardsUrl?: string;
|
|
16
|
+
/** @default '/bet-records' */
|
|
17
|
+
betRecordsUrl?: string;
|
|
18
|
+
/** @default '/transactions' */
|
|
19
|
+
transactionsUrl?: string;
|
|
20
|
+
/** @default '/account' */
|
|
21
|
+
accountSettingsUrl?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function Account(props: AccountProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Portal } from '@ark-ui/react';
|
|
4
|
+
import Image from 'next/image';
|
|
5
|
+
import Link from 'next/link';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
7
|
+
import { useShallow } from 'zustand/shallow';
|
|
8
|
+
import { useAccountQuery, useGlobalStore, useLocaleInfo, useSignOutMutation, useUnreadMessagesCountQuery, useWalletQuery, } from '../../client/hooks/index.js';
|
|
9
|
+
import { AlertCircleIcon, ChevronRightIcon, CoinsStacked02Icon, CoinsSwap02Icon, Gift01Icon, Logout01Icon, Settings02Icon, XIcon, } from '../../icons/index.js';
|
|
10
|
+
import avatarPlaceholder from '../../images/placeholder-avatar.png';
|
|
11
|
+
import { Badge, Button, Drawer, IconButton, Popover } from '../../ui/index.js';
|
|
12
|
+
import { formatNumber, parseDecimal } from '../../utils/index.js';
|
|
13
|
+
import { accountRecipe } from './account.recipe.js';
|
|
14
|
+
const recipe = accountRecipe();
|
|
15
|
+
export function Account(props) {
|
|
16
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
17
|
+
account: ctx.account,
|
|
18
|
+
account__mobile: ctx.account__mobile,
|
|
19
|
+
})));
|
|
20
|
+
const rewardsUrl = props.rewardsUrl ?? '/rewards';
|
|
21
|
+
const betRecordsUrl = props.betRecordsUrl ?? '/bet-records';
|
|
22
|
+
const transactionsUrl = props.transactionsUrl ?? '/transactions';
|
|
23
|
+
const accountSettingsUrl = props.accountSettingsUrl ?? '/account';
|
|
24
|
+
const [mobileOffsetTop, desktopOffsetTop] = Array.isArray(props.offsetTop)
|
|
25
|
+
? props.offsetTop
|
|
26
|
+
: [props.offsetTop ?? '0px', props.offsetTop ?? '0px'];
|
|
27
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Drawer.Root, { open: globalStore.account__mobile.open, onOpenChange: (details) => {
|
|
28
|
+
globalStore.account__mobile.setOpen(details.open);
|
|
29
|
+
}, lazyMount: true, unmountOnExit: true, children: [_jsx(Drawer.Trigger, { asChild: true, className: "lg:hidden", children: props.children ?? (_jsx(IconButton, { size: "sm", colorScheme: "gray", children: globalStore.account__mobile.open ? (_jsx(XIcon, {})) : (_jsx(Image, { src: avatarPlaceholder, alt: "", width: 100, height: 100, className: "size-10" })) })) }), _jsx(Portal, { children: _jsx(Drawer.Positioner, { children: _jsxs(Drawer.Content, { className: twMerge('relative', 'flex', 'flex-col', 'top-[var(--offset-top-mobile)]', 'h-[calc(100%-var(--offset-top-mobile))]', 'w-full', 'px-xl', 'py-6', 'lg:top-[var(--offset-top-desktop)]', 'lg:h-[calc(100%-var(--offset-top-desktop))]'), style: {
|
|
30
|
+
['--offset-top-mobile']: mobileOffsetTop,
|
|
31
|
+
['--offset-top-desktop']: desktopOffsetTop,
|
|
32
|
+
}, children: [_jsx(Profile, {}), _jsx(Wallet, {}), _jsx(Links, { rewardsUrl: rewardsUrl, betRecordsUrl: betRecordsUrl, transactionsUrl: transactionsUrl, accountSettingsUrl: accountSettingsUrl })] }) }) })] }), _jsxs(Popover.Root, { open: globalStore.account.open, onOpenChange: (details) => {
|
|
33
|
+
globalStore.account.setOpen(details.open);
|
|
34
|
+
}, lazyMount: true, unmountOnExit: true, positioning: {
|
|
35
|
+
placement: 'bottom',
|
|
36
|
+
strategy: 'fixed',
|
|
37
|
+
}, children: [_jsx(Popover.Trigger, { className: "hidden lg:flex", asChild: true, children: props.children ?? (_jsx(IconButton, { size: "sm", colorScheme: "gray", children: _jsx(Image, { src: avatarPlaceholder, alt: "", width: 48, height: 48, className: "size-10" }) })) }), _jsx(Portal, { children: _jsx(Popover.Positioner, { children: _jsxs(Popover.Content, { className: "border-border-primary bg-bg-primary relative z-popover w-[23.438rem] overflow-hidden rounded-xl border p-xl ui-open:animate-fade-in ui-closed:animate-fade-out", children: [_jsx(Profile, {}), _jsx(Wallet, {}), _jsx(Links, { rewardsUrl: rewardsUrl, betRecordsUrl: betRecordsUrl, transactionsUrl: transactionsUrl, accountSettingsUrl: accountSettingsUrl })] }) }) })] })] }));
|
|
38
|
+
}
|
|
39
|
+
function Profile() {
|
|
40
|
+
const accountQuery = useAccountQuery();
|
|
41
|
+
const account = accountQuery.data;
|
|
42
|
+
return (_jsxs("div", { className: "flex shrink-0 items-center gap-lg", children: [_jsx(Image, { src: avatarPlaceholder, alt: "", width: 48, height: 48, className: "size-12" }), _jsxs("div", { className: "grow", children: [_jsx("p", { className: "text-text-secondary-700 font-semibold leading-tight", children: account?.name }), _jsxs("div", { className: "flex", children: [_jsx("p", { className: "text-text-tertiary-600 grow items-center leading-tight", children: account?.id }), _jsxs(Badge.Root, { colorScheme: account?.verified ? 'success' : 'danger', className: "self-start", children: [_jsx(Badge.Indicator, {}), _jsx(Badge.Label, { children: account?.verified ? 'Verified' : 'Unverified' })] })] })] })] }));
|
|
43
|
+
}
|
|
44
|
+
function Wallet() {
|
|
45
|
+
const localeInfo = useLocaleInfo();
|
|
46
|
+
const walletQuery = useWalletQuery({
|
|
47
|
+
refetchInterval: 1000,
|
|
48
|
+
});
|
|
49
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
50
|
+
profile: ctx.account,
|
|
51
|
+
mobileProfile: ctx.account__mobile,
|
|
52
|
+
depositWithdrawal: ctx.depositWithdrawal,
|
|
53
|
+
})));
|
|
54
|
+
const depositBalance = parseDecimal(walletQuery.data?.balance, 0);
|
|
55
|
+
const bonusBalance = parseDecimal(walletQuery.data?.bonus, 0);
|
|
56
|
+
const totalBalance = depositBalance + bonusBalance;
|
|
57
|
+
return (_jsxs("div", { className: "border-border-primary bg-bg-tertiary mt-3 rounded-xl border p-xl", children: [_jsx("div", { className: "text-text-secondary-700 text-sm", children: "Total Balance" }), _jsx("div", { className: "text-3xl font-bold", children: formatNumber(totalBalance, {
|
|
58
|
+
currency: localeInfo?.currency.code,
|
|
59
|
+
minDecimalPlaces: 2,
|
|
60
|
+
}) }), _jsxs("div", { className: "mt-1.5 flex gap-7xl", children: [_jsxs("div", { children: [_jsx("p", { className: "text-text-secondary-700 text-2xs", children: "Deposit Balance" }), _jsx("p", { className: "text-medium text-text-primary-brand", children: formatNumber(depositBalance, {
|
|
61
|
+
currency: localeInfo?.currency.code,
|
|
62
|
+
minDecimalPlaces: 2,
|
|
63
|
+
}) })] }), _jsxs("div", { children: [_jsx("p", { className: "text-text-secondary-700 text-2xs", children: "Bonus Balance" }), _jsx("p", { className: "text-medium text-text-primary-brand", children: formatNumber(bonusBalance, {
|
|
64
|
+
currency: localeInfo?.currency.code,
|
|
65
|
+
minDecimalPlaces: 2,
|
|
66
|
+
}) })] })] }), _jsxs("div", { className: "mt-3 flex gap-lg", children: [_jsx(Button, { size: "xs", variant: "outline", onClick: () => {
|
|
67
|
+
globalStore.depositWithdrawal.setOpen(true);
|
|
68
|
+
globalStore.depositWithdrawal.setTab('WITHDRAWAL');
|
|
69
|
+
globalStore.profile.setOpen(false);
|
|
70
|
+
globalStore.mobileProfile.setOpen(false);
|
|
71
|
+
}, children: "Withdraw" }), _jsx(Button, { size: "xs", onClick: () => {
|
|
72
|
+
globalStore.depositWithdrawal.setOpen(true);
|
|
73
|
+
globalStore.depositWithdrawal.setTab('DEPOSIT');
|
|
74
|
+
globalStore.profile.setOpen(false);
|
|
75
|
+
globalStore.mobileProfile.setOpen(false);
|
|
76
|
+
}, children: "Deposit" })] })] }));
|
|
77
|
+
}
|
|
78
|
+
function Links(props) {
|
|
79
|
+
const signOutMutation = useSignOutMutation();
|
|
80
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
81
|
+
account: ctx.account,
|
|
82
|
+
account__mobile: ctx.account__mobile,
|
|
83
|
+
messages: ctx.messages,
|
|
84
|
+
})));
|
|
85
|
+
const unreadMessagesCountQuery = useUnreadMessagesCountQuery({}, { refetchInterval: 5000 });
|
|
86
|
+
return (_jsxs("nav", { className: recipe.nav({ className: 'mt-xl' }), children: [_jsxs("ul", { children: [_jsx("li", { className: recipe.navItemRoot(), children: _jsxs("button", { type: "button", className: recipe.navItemLink(), onClick: () => {
|
|
87
|
+
globalStore.account.setOpen(false);
|
|
88
|
+
globalStore.account__mobile.setOpen(false);
|
|
89
|
+
globalStore.messages.setOpen(true);
|
|
90
|
+
}, children: [_jsx(Logout01Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Notifications" }), _jsx("span", { className: recipe.navItemBadge(), "data-type": "warning", children: unreadMessagesCountQuery.data ?? 0 }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) }), _jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.rewardsUrl, className: recipe.navItemLink(), onClick: () => {
|
|
91
|
+
globalStore.account.setOpen(false);
|
|
92
|
+
globalStore.account__mobile.setOpen(false);
|
|
93
|
+
}, children: [_jsx(Gift01Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Rewards" }), _jsx("span", { className: recipe.navItemBadge(), "data-type": "warning", children: "0" }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) })] }), _jsx("ul", { children: _jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.accountSettingsUrl, className: recipe.navItemLink(), onClick: () => {
|
|
94
|
+
globalStore.account.setOpen(false);
|
|
95
|
+
globalStore.account__mobile.setOpen(false);
|
|
96
|
+
}, children: [_jsx(Settings02Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Settings" }), _jsx("span", { className: recipe.navItemBadge(), "data-type": "error", children: _jsx(AlertCircleIcon, {}) }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) }) }), _jsxs("ul", { children: [_jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.betRecordsUrl, className: recipe.navItemLink(), onClick: () => {
|
|
97
|
+
globalStore.account.setOpen(false);
|
|
98
|
+
globalStore.account__mobile.setOpen(false);
|
|
99
|
+
}, children: [_jsx(CoinsStacked02Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Bet Records" }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) }), _jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.transactionsUrl, className: recipe.navItemLink(), onClick: () => {
|
|
100
|
+
globalStore.account.setOpen(false);
|
|
101
|
+
globalStore.account__mobile.setOpen(false);
|
|
102
|
+
}, children: [_jsx(CoinsSwap02Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Transactions" }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) })] }), _jsx("ul", { children: _jsx("li", { className: recipe.navItemRoot(), children: _jsxs("button", { type: "button", className: recipe.navItemLink(), disabled: signOutMutation.isPending, onClick: () => {
|
|
103
|
+
signOutMutation.mutate();
|
|
104
|
+
globalStore.account.setOpen(false);
|
|
105
|
+
globalStore.account__mobile.setOpen(false);
|
|
106
|
+
}, children: [_jsx(Logout01Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Log Out" }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) }) })] }));
|
|
107
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
export interface AccountTriggerProps extends ComponentPropsWithRef<'button'> {
|
|
3
|
+
mobile?: boolean;
|
|
4
|
+
asChild?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function AccountTrigger(props: AccountTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
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 } from '../../client/hooks/index.js';
|
|
6
|
+
export function AccountTrigger(props) {
|
|
7
|
+
const { mobile, ...rest } = props;
|
|
8
|
+
const { open, setOpen } = useGlobalStore(useShallow((ctx) => (mobile ? ctx.account__mobile : ctx.account)));
|
|
9
|
+
return (_jsx(ark.button, { type: "button", "aria-label": "Toggle account menu", "data-open": open ? 'open' : 'closed', ...rest, onClick: (e) => {
|
|
10
|
+
setOpen(!open);
|
|
11
|
+
return props.onClick?.(e);
|
|
12
|
+
} }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export declare const accountRecipe: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
[key: string]: {
|
|
3
|
+
[key: string]: import("tailwind-variants").ClassValue | {
|
|
4
|
+
nav?: import("tailwind-variants").ClassValue;
|
|
5
|
+
navItemRoot?: import("tailwind-variants").ClassValue;
|
|
6
|
+
navItemLink?: import("tailwind-variants").ClassValue;
|
|
7
|
+
navItemIcon?: import("tailwind-variants").ClassValue;
|
|
8
|
+
navItemLabel?: import("tailwind-variants").ClassValue;
|
|
9
|
+
navItemIndicator?: import("tailwind-variants").ClassValue;
|
|
10
|
+
navItemBadge?: import("tailwind-variants").ClassValue;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
} | {
|
|
14
|
+
[x: string]: {
|
|
15
|
+
[x: string]: import("tailwind-variants").ClassValue | {
|
|
16
|
+
nav?: import("tailwind-variants").ClassValue;
|
|
17
|
+
navItemRoot?: import("tailwind-variants").ClassValue;
|
|
18
|
+
navItemLink?: import("tailwind-variants").ClassValue;
|
|
19
|
+
navItemIcon?: import("tailwind-variants").ClassValue;
|
|
20
|
+
navItemLabel?: import("tailwind-variants").ClassValue;
|
|
21
|
+
navItemIndicator?: import("tailwind-variants").ClassValue;
|
|
22
|
+
navItemBadge?: import("tailwind-variants").ClassValue;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
} | {}, {
|
|
26
|
+
nav: string;
|
|
27
|
+
navItemRoot: string;
|
|
28
|
+
navItemLink: string;
|
|
29
|
+
navItemIcon: string;
|
|
30
|
+
navItemLabel: string;
|
|
31
|
+
navItemIndicator: string;
|
|
32
|
+
navItemBadge: string[];
|
|
33
|
+
}, undefined, {
|
|
34
|
+
[key: string]: {
|
|
35
|
+
[key: string]: import("tailwind-variants").ClassValue | {
|
|
36
|
+
nav?: import("tailwind-variants").ClassValue;
|
|
37
|
+
navItemRoot?: import("tailwind-variants").ClassValue;
|
|
38
|
+
navItemLink?: import("tailwind-variants").ClassValue;
|
|
39
|
+
navItemIcon?: import("tailwind-variants").ClassValue;
|
|
40
|
+
navItemLabel?: import("tailwind-variants").ClassValue;
|
|
41
|
+
navItemIndicator?: import("tailwind-variants").ClassValue;
|
|
42
|
+
navItemBadge?: import("tailwind-variants").ClassValue;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
} | {}, {
|
|
46
|
+
nav: string;
|
|
47
|
+
navItemRoot: string;
|
|
48
|
+
navItemLink: string;
|
|
49
|
+
navItemIcon: string;
|
|
50
|
+
navItemLabel: string;
|
|
51
|
+
navItemIndicator: string;
|
|
52
|
+
navItemBadge: string[];
|
|
53
|
+
}, import("tailwind-variants").TVReturnType<unknown, {
|
|
54
|
+
nav: string;
|
|
55
|
+
navItemRoot: string;
|
|
56
|
+
navItemLink: string;
|
|
57
|
+
navItemIcon: string;
|
|
58
|
+
navItemLabel: string;
|
|
59
|
+
navItemIndicator: string;
|
|
60
|
+
navItemBadge: string[];
|
|
61
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
export const accountRecipe = tv({
|
|
3
|
+
slots: {
|
|
4
|
+
nav: 'space-y-xl',
|
|
5
|
+
navItemRoot: 'bg-bg-primary-alt block first:rounded-t-xl last:rounded-b-xl',
|
|
6
|
+
navItemLink: 'flex w-full items-center px-xl py-xl text-left text-sm font-semibold',
|
|
7
|
+
navItemIcon: 'text-text-nav-item-button-icon size-5',
|
|
8
|
+
navItemLabel: 'ml-lg grow',
|
|
9
|
+
navItemIndicator: 'text-gray-400 text-text-quarterary-500 size-5',
|
|
10
|
+
navItemBadge: [
|
|
11
|
+
'mr-md',
|
|
12
|
+
'flex',
|
|
13
|
+
'items-center',
|
|
14
|
+
'justify-center',
|
|
15
|
+
'border',
|
|
16
|
+
'rounded-full',
|
|
17
|
+
'h-5.5',
|
|
18
|
+
'ui-type-[warning]:min-w-6',
|
|
19
|
+
'ui-type-[warning]:text-xs',
|
|
20
|
+
'ui-type-[warning]:font-medium',
|
|
21
|
+
'ui-type-[warning]:leading-tight',
|
|
22
|
+
'ui-type-[warning]:border-utility-brand-200',
|
|
23
|
+
'ui-type-[warning]:bg-utility-brand-50',
|
|
24
|
+
'ui-type-[warning]:text-utility-brand-700',
|
|
25
|
+
'ui-type-[error]:w-5.5',
|
|
26
|
+
'ui-type-[error]:icon:size-3',
|
|
27
|
+
'ui-type-[error]:border-utility-warning-200',
|
|
28
|
+
'ui-type-[error]:bg-utility-warning-50',
|
|
29
|
+
'ui-type-[error]:text-utility-warning-500',
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
});
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
4
|
+
import { differenceInYears, format } from 'date-fns';
|
|
5
|
+
import Image from 'next/image';
|
|
6
|
+
import { useEffect } from 'react';
|
|
7
|
+
import { useForm } from 'react-hook-form';
|
|
8
|
+
import { twMerge } from 'tailwind-merge';
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { useAccountQuery, useLocaleInfo, useMobileNumberParser, useUpdateAccountMutation, } from '../../client/hooks/index.js';
|
|
11
|
+
import { toaster } from '../../client/utils/index.js';
|
|
12
|
+
import { FacebookIcon, GoogleIcon } from '../../icons/index.js';
|
|
13
|
+
import avatar from '../../images/placeholder-avatar.png';
|
|
14
|
+
import { Button, Field, IconButton } from '../../ui/index.js';
|
|
15
|
+
export function AccountInfo(props) {
|
|
16
|
+
return (_jsxs("div", { className: twMerge('space-y-3xl', props.className), children: [_jsx(ProfileInfo, {}), _jsx(ContactInfo, {}), _jsx(PersonalInfo, {}), _jsx(SSO, {})] }));
|
|
17
|
+
}
|
|
18
|
+
function ProfileInfo() {
|
|
19
|
+
const accountQuery = useAccountQuery();
|
|
20
|
+
const account = accountQuery.data;
|
|
21
|
+
return (_jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Profile Info" }), _jsxs("div", { className: "bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border", children: [_jsx("div", { className: "border-border-secondary border-b px-4 py-5", children: _jsxs("div", { className: "flex items-center gap-xl", children: [_jsx(Image, { src: avatar, alt: "", width: 80, height: 80, className: "size-14 shrink-0 rounded-md object-cover" }), _jsxs("div", { children: [_jsx("h3", { className: "text-text-secondary-700 text-lg font-semibold leading-tight", children: account?.name }), _jsx("p", { className: "text-text-tertiary-600 leading-tight", children: account?.id })] })] }) }), _jsx("div", { className: "flex justify-end px-xl py-lg", children: _jsx(Button, { size: "sm", variant: "outline", fullWidth: false, children: "Upload New Avatar" }) })] })] }));
|
|
22
|
+
}
|
|
23
|
+
function PersonalInfo() {
|
|
24
|
+
const accountQuery = useAccountQuery();
|
|
25
|
+
const account = accountQuery.data;
|
|
26
|
+
const updateAccountMutation = useUpdateAccountMutation({
|
|
27
|
+
onSuccess() {
|
|
28
|
+
toaster.success({
|
|
29
|
+
description: 'Changes saved!',
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
onError(error) {
|
|
33
|
+
toaster.error({
|
|
34
|
+
description: error.message,
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
const schema = z.object({
|
|
39
|
+
realName: z.string().min(4).max(50).optional().or(z.literal('')),
|
|
40
|
+
birthDay: z
|
|
41
|
+
.string()
|
|
42
|
+
.optional()
|
|
43
|
+
.or(z.literal(''))
|
|
44
|
+
.superRefine((val, ctx) => {
|
|
45
|
+
if (!val)
|
|
46
|
+
return;
|
|
47
|
+
const date = new Date(val);
|
|
48
|
+
const age = differenceInYears(new Date(), date);
|
|
49
|
+
if (age < 21) {
|
|
50
|
+
ctx.addIssue({
|
|
51
|
+
code: z.ZodIssueCode.custom,
|
|
52
|
+
message: 'You must be at least 21 years old',
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}),
|
|
56
|
+
});
|
|
57
|
+
const form = useForm({
|
|
58
|
+
mode: 'all',
|
|
59
|
+
resolver: zodResolver(schema),
|
|
60
|
+
defaultValues: {
|
|
61
|
+
birthDay: '',
|
|
62
|
+
realName: '',
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (account) {
|
|
67
|
+
form.reset({
|
|
68
|
+
realName: account.realName ?? '',
|
|
69
|
+
birthDay: account.birthDay
|
|
70
|
+
? format(account.birthDay, 'yyyy-MM-dd')
|
|
71
|
+
: '',
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}, [account, form]);
|
|
75
|
+
return (_jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Personal Data" }), _jsxs("form", { className: "shadow-xs bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border", onSubmit: form.handleSubmit((data) => {
|
|
76
|
+
updateAccountMutation.mutate({
|
|
77
|
+
realName: data.realName && account?.realName !== data.realName
|
|
78
|
+
? data.realName
|
|
79
|
+
: undefined,
|
|
80
|
+
birthDay: data.birthDay && account?.birthDay !== data.birthDay
|
|
81
|
+
? data.birthDay
|
|
82
|
+
: undefined,
|
|
83
|
+
});
|
|
84
|
+
}), children: [_jsxs("div", { className: "px-4 py-5 lg:px-3xl lg:py-5", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.realName, children: [_jsx(Field.Label, { children: "Real name" }), _jsx(Field.Input, { ...form.register('realName') }), _jsx(Field.ErrorText, { children: form.formState.errors.realName?.message })] }), _jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.birthDay, children: [_jsx(Field.Label, { children: "Date of birth" }), _jsx(Field.Input, { type: "date", ...form.register('birthDay') }), _jsx(Field.ErrorText, { children: form.formState.errors.birthDay?.message })] })] }), form.formState.isDirty && (_jsxs("div", { className: "border-border-secondary flex justify-end gap-lg border-t px-xl py-lg lg:px-3xl lg:py-xl", children: [_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, disabled: updateAccountMutation.isPending, onClick: () => form.reset(), children: "Cancel" }), _jsx(Button, { type: "submit", size: "sm", fullWidth: false, disabled: !form.formState.isValid || updateAccountMutation.isPending, children: "Save Changes" })] }))] })] }));
|
|
85
|
+
}
|
|
86
|
+
function ContactInfo() {
|
|
87
|
+
const localeInfo = useLocaleInfo();
|
|
88
|
+
const accountQuery = useAccountQuery();
|
|
89
|
+
const account = accountQuery.data;
|
|
90
|
+
const { parse, format, equals } = useMobileNumberParser();
|
|
91
|
+
const updateAccountMutation = useUpdateAccountMutation({
|
|
92
|
+
onSuccess() {
|
|
93
|
+
toaster.success({
|
|
94
|
+
description: 'Changes saved!',
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
onError(error) {
|
|
98
|
+
toaster.error({
|
|
99
|
+
description: error.message,
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
const schema = z.object({
|
|
104
|
+
emailAddress: z.string().email().optional().or(z.literal('')),
|
|
105
|
+
mobileNumber: z
|
|
106
|
+
.string()
|
|
107
|
+
.regex(localeInfo.mobileNumber.pattern, 'Invalid mobile number')
|
|
108
|
+
.optional()
|
|
109
|
+
.or(z.literal('')),
|
|
110
|
+
});
|
|
111
|
+
const form = useForm({
|
|
112
|
+
mode: 'all',
|
|
113
|
+
resolver: zodResolver(schema),
|
|
114
|
+
defaultValues: {
|
|
115
|
+
mobileNumber: '',
|
|
116
|
+
emailAddress: '',
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
if (account) {
|
|
121
|
+
form.reset({
|
|
122
|
+
emailAddress: account.emailAddress ?? '',
|
|
123
|
+
mobileNumber: account.mobileNumber
|
|
124
|
+
? parse(account.mobileNumber).mobileNumber
|
|
125
|
+
: '',
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}, [account, form, parse]);
|
|
129
|
+
return (_jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Contact Info" }), _jsxs("form", { className: "shadow-xs bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border", onSubmit: form.handleSubmit((data) => {
|
|
130
|
+
updateAccountMutation.mutate({
|
|
131
|
+
emailAddress: data.emailAddress && account?.emailAddress !== data.emailAddress
|
|
132
|
+
? data.emailAddress
|
|
133
|
+
: undefined,
|
|
134
|
+
mobileNumber: data.mobileNumber &&
|
|
135
|
+
!equals(account?.mobileNumber, data.mobileNumber)
|
|
136
|
+
? format(data.mobileNumber)
|
|
137
|
+
: undefined,
|
|
138
|
+
});
|
|
139
|
+
}), children: [_jsxs("div", { className: "px-xl py-5 lg:px-3xl lg:py-5", 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", readOnly: account?.mobileNumber != null, ...form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: form.formState.errors.mobileNumber?.message })] }), _jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.emailAddress, children: [_jsx(Field.Label, { children: "Email address" }), _jsx(Field.Input, { ...form.register('emailAddress') }), _jsx(Field.ErrorText, { children: form.formState.errors.emailAddress?.message })] })] }), form.formState.isDirty && (_jsxs("div", { className: "border-border-secondary flex justify-end gap-lg border-t px-xl py-lg lg:px-3xl lg:py-xl", children: [_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, disabled: updateAccountMutation.isPending, onClick: () => form.reset(), children: "Cancel" }), _jsx(Button, { type: "submit", size: "sm", fullWidth: false, disabled: updateAccountMutation.isPending || !form.formState.isValid, children: "Save Changes" })] }))] })] }));
|
|
140
|
+
}
|
|
141
|
+
function SSO() {
|
|
142
|
+
return (_jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Account Connections" }), _jsxs("div", { className: "shadow-xs bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border px-4 py-5", children: [_jsxs("div", { className: "flex items-center", children: [_jsxs("div", { className: "flex grow items-center gap-sm", children: [_jsx(IconButton, { variant: "outline", colorScheme: "gray", children: _jsx(GoogleIcon, { className: "size-6" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium leading-tight", children: "Google" }), _jsx("p", { className: "text-text-secondary-700 mt-xs text-xs leading-tight", children: "Not Connected" })] })] }), _jsx(Button, { fullWidth: false, children: "Connect" })] }), _jsxs("div", { className: "mt-6 flex items-center", children: [_jsxs("div", { className: "flex grow items-center gap-sm", children: [_jsx(IconButton, { variant: "outline", colorScheme: "gray", children: _jsx(FacebookIcon, { className: "size-6" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium leading-tight", children: "Facebook" }), _jsx("p", { className: "text-text-success-primary-600 mt-xs text-xs leading-tight", children: "Connected" })] })] }), _jsx("button", { className: "text-button-tertiary-error-fg text-sm font-semibold", children: "Disconnect" })] })] })] }));
|
|
143
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AccountInfo';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AccountInfo.js';
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ark, createListCollection, Portal } from '@ark-ui/react';
|
|
4
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
5
|
+
import { useForm } from 'react-hook-form';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { useProfileCompletionQuery, useUpdateAccountMutation, } from '../../client/hooks/index.js';
|
|
9
|
+
import { toaster } from '../../client/utils/index.js';
|
|
10
|
+
import { AlertCircleIcon, CheckIcon, CheckVerified02Icon, ChevronDownIcon, EyeIcon, EyeOffIcon, } from '../../icons/index.js';
|
|
11
|
+
import { Button, Field, PasswordInput, Select } from '../../ui/index.js';
|
|
12
|
+
export function AccountSecurity(props) {
|
|
13
|
+
return (_jsxs("div", { className: twMerge('space-y-3xl', props.className), children: [_jsx(LoginPassword, {}), _jsx(TransactionPassword, {})] }));
|
|
14
|
+
}
|
|
15
|
+
function LoginPassword() {
|
|
16
|
+
const profileCompletionQuery = useProfileCompletionQuery();
|
|
17
|
+
const profileCompletion = profileCompletionQuery.data;
|
|
18
|
+
const updateAccountMutation = useUpdateAccountMutation({
|
|
19
|
+
onSuccess() {
|
|
20
|
+
form.reset();
|
|
21
|
+
toaster.success({
|
|
22
|
+
description: 'Changes saved!',
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
onError(error) {
|
|
26
|
+
toaster.error({
|
|
27
|
+
description: error.message,
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
const schema = z
|
|
32
|
+
.object({
|
|
33
|
+
password: z.string().min(8).max(150).optional().or(z.literal('')),
|
|
34
|
+
confirmPassword: z.string().optional(),
|
|
35
|
+
secretQuestion: z.enum(SECRET_QUESTIONS).nullable().optional(),
|
|
36
|
+
secretAnswer: z
|
|
37
|
+
.string()
|
|
38
|
+
.min(2, 'Answer is too short')
|
|
39
|
+
.optional()
|
|
40
|
+
.or(z.literal('')),
|
|
41
|
+
})
|
|
42
|
+
.superRefine((data, ctx) => {
|
|
43
|
+
if (data.password && data.password !== data.confirmPassword) {
|
|
44
|
+
ctx.addIssue({
|
|
45
|
+
path: ['confirmPassword'],
|
|
46
|
+
code: z.ZodIssueCode.custom,
|
|
47
|
+
message: 'Passwords do not match',
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
if (data.secretAnswer && !data.secretQuestion) {
|
|
51
|
+
ctx.addIssue({
|
|
52
|
+
path: ['secretQuestion'],
|
|
53
|
+
code: z.ZodIssueCode.custom,
|
|
54
|
+
message: 'Please select a security question',
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
if (data.secretQuestion && !data.secretAnswer) {
|
|
58
|
+
ctx.addIssue({
|
|
59
|
+
path: ['secretAnswer'],
|
|
60
|
+
code: z.ZodIssueCode.custom,
|
|
61
|
+
message: 'Please provide an answer to the security question',
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
const form = useForm({
|
|
66
|
+
mode: 'all',
|
|
67
|
+
resolver: zodResolver(schema),
|
|
68
|
+
defaultValues: {
|
|
69
|
+
password: '',
|
|
70
|
+
confirmPassword: '',
|
|
71
|
+
secretAnswer: '',
|
|
72
|
+
secretQuestion: null,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
const secretQuestion = form.watch('secretQuestion');
|
|
76
|
+
return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Log in password" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "Access your account by logging in with your name and password." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountPassword
|
|
77
|
+
? 'text-text-success-primary'
|
|
78
|
+
: 'text-text-warning-primary'), children: profileCompletion?.accountPassword ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("form", { className: "shadow-xs bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border", onSubmit: form.handleSubmit((data) => {
|
|
79
|
+
updateAccountMutation.mutate({
|
|
80
|
+
password: data.password ? data.password : undefined,
|
|
81
|
+
secretAnswer: data.secretAnswer ? data.secretAnswer : undefined,
|
|
82
|
+
secretQuestion: data.secretQuestion
|
|
83
|
+
? data.secretQuestion
|
|
84
|
+
: undefined,
|
|
85
|
+
});
|
|
86
|
+
}), children: [_jsxs("div", { className: "px-xl py-5 lg:px-3xl lg:py-5", children: [_jsxs(Field.Root, { 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(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.confirmPassword, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Confirm Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('confirmPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.confirmPassword?.message })] }), _jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.secretQuestion, children: [_jsxs(Select.Root, { deselectable: true, collection: secretQuestionCollection, lazyMount: true, positioning: {
|
|
87
|
+
sameWidth: true,
|
|
88
|
+
}, value: secretQuestion ? [secretQuestion] : [], onValueChange: (details) => {
|
|
89
|
+
form.setValue('secretQuestion', z.enum(SECRET_QUESTIONS).safeParse(details.value.at(0))
|
|
90
|
+
.data ?? null, {
|
|
91
|
+
shouldDirty: true,
|
|
92
|
+
shouldTouch: true,
|
|
93
|
+
shouldValidate: true,
|
|
94
|
+
});
|
|
95
|
+
}, children: [_jsx(Select.Label, { children: "Security Question" }), _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, {}), _jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: secretQuestionCollection.items.map((provider) => (_jsxs(Select.Item, { item: provider, children: [_jsx(Select.ItemText, { children: secretQuestionCollection.stringifyItem(provider) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, provider))) }) }) }) })] }), _jsx(Field.ErrorText, { children: form.formState.errors.secretQuestion?.message })] }), _jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.secretAnswer, children: [_jsx(Field.Label, { children: "Answer" }), _jsx(Field.Input, { ...form.register('secretAnswer') }), _jsx(Field.ErrorText, { children: form.formState.errors.secretAnswer?.message })] })] }), form.formState.isDirty && (_jsxs("div", { className: "border-border-secondary flex justify-end gap-lg border-t px-xl py-lg lg:px-3xl lg:py-xl", children: [_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, disabled: updateAccountMutation.isPending, onClick: () => form.reset(), children: "Cancel" }), _jsx(Button, { type: "submit", size: "sm", fullWidth: false, disabled: updateAccountMutation.isPending || !form.formState.isValid, children: "Save Changes" })] }))] })] }));
|
|
96
|
+
}
|
|
97
|
+
function TransactionPassword() {
|
|
98
|
+
const profileCompletionQuery = useProfileCompletionQuery();
|
|
99
|
+
const profileCompletion = profileCompletionQuery.data;
|
|
100
|
+
const updateAccountMutation = useUpdateAccountMutation({
|
|
101
|
+
onSuccess() {
|
|
102
|
+
form.reset();
|
|
103
|
+
toaster.success({
|
|
104
|
+
description: 'Changes saved!',
|
|
105
|
+
});
|
|
106
|
+
},
|
|
107
|
+
onError(error) {
|
|
108
|
+
toaster.error({
|
|
109
|
+
description: error.message,
|
|
110
|
+
});
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
const schema = z
|
|
114
|
+
.object({
|
|
115
|
+
password: z.string().min(8).max(150).optional().or(z.literal('')),
|
|
116
|
+
confirmPassword: z.string().optional(),
|
|
117
|
+
})
|
|
118
|
+
.superRefine((data, ctx) => {
|
|
119
|
+
if (data.password && data.password !== data.confirmPassword) {
|
|
120
|
+
ctx.addIssue({
|
|
121
|
+
path: ['confirmPassword'],
|
|
122
|
+
code: z.ZodIssueCode.custom,
|
|
123
|
+
message: 'Passwords do not match',
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
const form = useForm({
|
|
128
|
+
mode: 'all',
|
|
129
|
+
resolver: zodResolver(schema),
|
|
130
|
+
defaultValues: {
|
|
131
|
+
password: '',
|
|
132
|
+
confirmPassword: '',
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Transaction password" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "The transaction password secures and confirms your wallet withdrawals." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountPassword
|
|
136
|
+
? 'text-text-success-primary'
|
|
137
|
+
: 'text-text-warning-primary'), children: profileCompletion?.accountPassword ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("form", { className: "shadow-xs bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border", onSubmit: form.handleSubmit((data) => {
|
|
138
|
+
updateAccountMutation.mutate({
|
|
139
|
+
password: data.password ? data.password : undefined,
|
|
140
|
+
});
|
|
141
|
+
}), children: [_jsxs("div", { className: "px-xl py-5 lg:px-3xl lg:py-5", children: [_jsxs(Field.Root, { 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(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.confirmPassword, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Confirm Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('confirmPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.confirmPassword?.message })] })] }), form.formState.isDirty && (_jsxs("div", { className: "border-border-secondary flex justify-end gap-lg border-t px-xl py-lg lg:px-3xl lg:py-xl", children: [_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, disabled: updateAccountMutation.isPending, onClick: () => form.reset(), children: "Cancel" }), _jsx(Button, { type: "submit", size: "sm", fullWidth: false, disabled: !form.formState.isValid || updateAccountMutation.isPending, children: "Save Changes" })] }))] })] }));
|
|
142
|
+
}
|
|
143
|
+
const SECRET_QUESTIONS = [
|
|
144
|
+
'BEST_CHILDHOOD_FRIEND',
|
|
145
|
+
'BIRTH_PLACE',
|
|
146
|
+
'FAVORITE_BOOK',
|
|
147
|
+
'FAVORITE_MOVIE',
|
|
148
|
+
'FAVORITE_TEACHER',
|
|
149
|
+
'FIRST_CAR',
|
|
150
|
+
'FIRST_PET',
|
|
151
|
+
'FIRST_SCHOOL',
|
|
152
|
+
'MOTHERS_MAIDEN_NAME',
|
|
153
|
+
'PARENTS_MET_CITY',
|
|
154
|
+
];
|
|
155
|
+
const SECRET_QUESIONS_MAP = {
|
|
156
|
+
BEST_CHILDHOOD_FRIEND: 'Who is your best childhood friend?',
|
|
157
|
+
BIRTH_PLACE: 'Where were you born?',
|
|
158
|
+
FAVORITE_BOOK: 'What is your favorite book?',
|
|
159
|
+
FAVORITE_MOVIE: 'What is your favorite movie?',
|
|
160
|
+
FAVORITE_TEACHER: 'Who was your favorite teacher?',
|
|
161
|
+
FIRST_CAR: 'What was your first car?',
|
|
162
|
+
FIRST_PET: 'What was your first pet?',
|
|
163
|
+
FIRST_SCHOOL: 'What was the name of your first school?',
|
|
164
|
+
MOTHERS_MAIDEN_NAME: "What is your mother's maiden name?",
|
|
165
|
+
PARENTS_MET_CITY: 'In which city did your parents meet?',
|
|
166
|
+
};
|
|
167
|
+
const secretQuestionCollection = createListCollection({
|
|
168
|
+
items: SECRET_QUESTIONS,
|
|
169
|
+
itemToValue: (item) => item,
|
|
170
|
+
itemToString: (item) => SECRET_QUESIONS_MAP[item],
|
|
171
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AccountSecurity';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AccountSecurity.js';
|