@opexa/portal-components 0.0.190 → 0.0.193
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/hooks/index.d.ts +65 -0
- package/dist/client/hooks/index.js +65 -0
- package/dist/client/hooks/useCreateLibanganDepositMutation.d.ts +4 -0
- package/dist/client/hooks/useCreateLibanganDepositMutation.js +73 -0
- package/dist/client/hooks/useCreateVentajaWithdrawalMutation.d.ts +4 -0
- package/dist/client/hooks/useCreateVentajaWithdrawalMutation.js +28 -0
- package/dist/client/services/index.d.ts +4 -0
- package/dist/client/services/index.js +4 -0
- package/dist/client/utils/index.d.ts +3 -0
- package/dist/client/utils/index.js +3 -0
- package/dist/components/Bonus/Bonus.client.js +1 -1
- package/dist/components/Cashback/Cashback.client.js +1 -1
- 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/CustomPromo/CustomPromo.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/Deposit.js +8 -1
- package/dist/components/DepositWithdrawal/Deposit/LibanganDeposit/LibanganDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/LibanganDeposit/LibanganDeposit.js +175 -0
- package/dist/components/DepositWithdrawal/PaymentMethods.js +7 -1
- package/dist/components/DepositWithdrawal/Withdrawal/VentajaWithdrawal/VentajaWithdrawal.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Withdrawal/VentajaWithdrawal/VentajaWithdrawal.js +154 -0
- package/dist/components/DepositWithdrawal/Withdrawal/Withdrawal.js +8 -1
- package/dist/components/DepositWithdrawal/utils.d.ts +1 -1
- package/dist/components/DepositWithdrawal/utils.js +2 -0
- package/dist/components/Disclaimer/DisclaimerV2.js +7 -5
- package/dist/components/Empty.d.ts +9 -0
- package/dist/components/Empty.js +7 -0
- package/dist/components/GameLaunch/GameLaunch.lazy.js +1 -1
- package/dist/components/GameProviders/GameProvidersList.js +1 -1
- package/dist/components/Games/GameContext.d.ts +2 -0
- package/dist/components/Games/GameContext.js +2 -0
- package/dist/components/GamesSearch/GamesSearch.js +1 -1
- 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 +66 -0
- package/dist/components/JackpotCounter/JackpotCounter.d.ts +17 -0
- package/dist/components/JackpotCounter/JackpotCounter.js +21 -0
- package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +18 -0
- package/dist/components/JackpotCounter/JackpotCounterItem.js +109 -0
- package/dist/components/JackpotCounter/JackpotCounterItem.module.css +184 -0
- package/dist/components/JackpotCounter/index.d.ts +1 -0
- package/dist/components/JackpotCounter/index.js +1 -0
- package/dist/components/Jackpots/JackpotDesktop.d.ts +1 -0
- package/dist/components/Jackpots/JackpotDesktop.js +45 -0
- package/dist/components/Jackpots/JackpotGameProviders.d.ts +5 -0
- package/dist/components/Jackpots/JackpotGameProviders.js +41 -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/JackpotMobile.d.ts +1 -0
- package/dist/components/Jackpots/JackpotMobile.js +46 -0
- package/dist/components/Jackpots/JackpotRules.d.ts +5 -0
- package/dist/components/Jackpots/JackpotRules.js +11 -0
- package/dist/components/Jackpots/Jackpots.client.d.ts +2 -0
- package/dist/components/Jackpots/Jackpots.client.js +29 -0
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsContext.d.ts +4 -0
- package/dist/components/Jackpots/JackpotsContext.js +3 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemGameProviders.js +1 -1
- package/dist/components/Jackpots/useJackpotData.d.ts +14 -0
- package/dist/components/Jackpots/useJackpotData.js +93 -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 +8 -0
- package/dist/components/KYC/Step1.d.ts +1 -0
- package/dist/components/KYC/Step1.js +13 -0
- package/dist/components/KYC/Step2.d.ts +1 -0
- package/dist/components/KYC/Step2.js +13 -0
- package/dist/components/KYC/Step3.d.ts +1 -0
- package/dist/components/KYC/Step3.js +13 -0
- package/dist/components/KYC/Step4.d.ts +1 -0
- package/dist/components/KYC/Step4.js +7 -0
- package/dist/components/KYC/utils.js +18 -18
- package/dist/components/Messages/Message.js +2 -3
- package/dist/components/Messages/MessageItem.d.ts +4 -0
- package/dist/components/Messages/MessageItem.js +34 -0
- package/dist/components/Messages/MessagePopup.js +2 -3
- package/dist/components/News/News.js +1 -1
- package/dist/components/Promo/Promo.client.js +1 -1
- package/dist/components/Promo/PromoContent.d.ts +2 -0
- package/dist/components/Promo/PromoContent.js +9 -0
- package/dist/components/Promos/PromoCarousel.d.ts +2 -0
- package/dist/components/Promos/PromoCarousel.js +41 -0
- package/dist/components/Promos/PromoGrid.d.ts +2 -0
- package/dist/components/Promos/PromoGrid.js +12 -0
- package/dist/components/Promos/PromoItem.d.ts +7 -0
- package/dist/components/Promos/PromoItem.js +10 -0
- package/dist/components/Search/Search.lazy.js +2 -2
- package/dist/components/SignUp/SignUpForm.js +4 -0
- package/dist/components/SignUp/SignUpKYC/ImageUploader.js +2 -1
- package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.js +1 -1
- 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/TournamentDesktop.d.ts +1 -0
- package/dist/components/Tournaments/TournamentDesktop.js +57 -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/TournamentMobile.d.ts +1 -0
- package/dist/components/Tournaments/TournamentMobile.js +55 -0
- package/dist/components/Tournaments/TournamentRules.d.ts +5 -0
- package/dist/components/Tournaments/TournamentRules.js +11 -0
- package/dist/components/Tournaments/Tournaments.client.d.ts +2 -0
- package/dist/components/Tournaments/Tournaments.client.js +20 -0
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
- package/dist/components/Tournaments/TournamentsContext.d.ts +4 -0
- package/dist/components/Tournaments/TournamentsContext.js +3 -0
- package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemGameProviders.js +1 -1
- package/dist/components/Tournaments/useTournamentData.d.ts +10 -0
- package/dist/components/Tournaments/useTournamentData.js +72 -0
- package/dist/components/Tournaments/useTournamentItemData.d.ts +16 -0
- package/dist/components/Tournaments/useTournamentItemData.js +64 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.js +33 -0
- package/dist/constants/GameProvider.d.ts +1 -1
- package/dist/constants/GameProvider.js +8 -0
- package/dist/constants/endpoints.d.ts +10 -0
- package/dist/constants/endpoints.js +41 -0
- package/dist/constants/envVars.d.ts +5 -0
- package/dist/constants/envVars.js +28 -0
- package/dist/constants/gameProviders.d.ts +4 -0
- package/dist/constants/gameProviders.js +368 -0
- package/dist/constants/gameTypes.d.ts +3 -0
- package/dist/constants/gameTypes.js +64 -0
- package/dist/constants/headerKeys.d.ts +2 -0
- package/dist/constants/headerKeys.js +2 -0
- package/dist/constants/secretQuestions.d.ts +3 -0
- package/dist/constants/secretQuestions.js +24 -0
- package/dist/constants/storageKeys.d.ts +2 -0
- package/dist/constants/storageKeys.js +2 -0
- package/dist/icons/index.d.ts +65 -0
- package/dist/icons/index.js +65 -0
- package/dist/images/game-providers/BNG.png +0 -0
- package/dist/images/hacksaw-gaming.png +0 -0
- package/dist/images/libangan.png +0 -0
- package/dist/server/services/index.d.ts +4 -0
- package/dist/server/services/index.js +4 -0
- package/dist/server/utils/index.d.ts +29 -0
- package/dist/server/utils/index.js +29 -0
- package/dist/services/queries.d.ts +4 -2
- package/dist/services/queries.js +2436 -2361
- package/dist/services/wallet.d.ts +33 -0
- package/dist/services/wallet.js +21 -1
- package/dist/styles/theme.css +693 -693
- package/dist/types/index.d.ts +3 -1
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +14 -14
- package/dist/ui/Avatar/avatar.recipe.d.ts +3 -3
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Carousel/carousel.recipe.d.ts +8 -8
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Dialog/dialog.recipe.d.ts +14 -14
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Menu/menu.recipe.d.ts +20 -20
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/popover.recipe.d.ts +8 -8
- package/dist/ui/Presence.d.ts +2 -0
- package/dist/ui/Presence.js +7 -0
- package/dist/ui/Prose.d.ts +2 -0
- package/dist/ui/Prose.js +5 -0
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/dist/ui/Tooltip/tooltip.recipe.d.ts +5 -5
- package/dist/ui/index.d.ts +26 -0
- package/dist/ui/index.js +26 -0
- package/dist/utils/createErrorFromCode.d.ts +2 -0
- package/dist/utils/createErrorFromCode.js +11 -0
- package/dist/utils/index.d.ts +17 -0
- package/dist/utils/index.js +17 -0
- package/dist/utils/isMobile.d.ts +5 -0
- package/dist/utils/isMobile.js +9 -0
- package/dist/utils/mutationKeys.d.ts +2 -0
- package/dist/utils/mutationKeys.js +8 -0
- package/dist/utils/resizeImageSize.d.ts +0 -1
- package/dist/utils/resizeImageSize.js +0 -5
- package/package.json +164 -164
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.d.ts +0 -1
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.js +0 -198
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.d.ts +0 -1
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.js +0 -251
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.d.ts +0 -10
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.js +0 -41
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.d.ts +0 -1
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.js +0 -429
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.d.ts +0 -13
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.js +0 -26
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.d.ts +0 -7
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.js +0 -2
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.d.ts +0 -11
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.js +0 -20
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export * from './useAccountQuery';
|
|
2
|
+
export * from './useAuthenticateMutation';
|
|
3
|
+
export * from './useAvailablePromosQuery';
|
|
4
|
+
export * from './useAvailableQuestsQuery';
|
|
5
|
+
export * from './useBetRecordsQuery';
|
|
6
|
+
export * from './useBonusesQuery';
|
|
7
|
+
export * from './useBonusQuery';
|
|
8
|
+
export * from './useCashbackBonusesQuery';
|
|
9
|
+
export * from './useCashbackBonusQuery';
|
|
10
|
+
export * from './useCashbackQuery';
|
|
11
|
+
export * from './useCashbacksQuery';
|
|
12
|
+
export * from './useCheckInDailyCheckInQuestMutation';
|
|
13
|
+
export * from './useChunk';
|
|
14
|
+
export * from './useClaimCashbackBonusMutation';
|
|
15
|
+
export * from './useClaimSpotBonusMutation';
|
|
16
|
+
export * from './useControllableState';
|
|
17
|
+
export * from './useCooldown';
|
|
18
|
+
export * from './useCreateGameSessionMutation';
|
|
19
|
+
export * from './useCreateGCashDepositMutation';
|
|
20
|
+
export * from './useCreateGCashWithdrawalMutation';
|
|
21
|
+
export * from './useCreateInstapayWithdrawalMutation';
|
|
22
|
+
export * from './useCreateMayaAppDepositMutation';
|
|
23
|
+
export * from './useCreateMayaAppWithdrawalMutation';
|
|
24
|
+
export * from './useCreateMayaDepositMutation';
|
|
25
|
+
export * from './useCreateMayaWithdrawalMutation';
|
|
26
|
+
export * from './useCreateOnlineBankDepositMutation';
|
|
27
|
+
export * from './useCreateQRPHDepositMutation';
|
|
28
|
+
export * from './useDepositQuery';
|
|
29
|
+
export * from './useDepositRecordsQuery';
|
|
30
|
+
export * from './useDepositsCountQuery';
|
|
31
|
+
export * from './useDisclosure';
|
|
32
|
+
export * from './useEndGameSessionMutation';
|
|
33
|
+
export * from './useFavoriteGamesQuery';
|
|
34
|
+
export * from './useGamesQuery';
|
|
35
|
+
export * from './useGlobalStore';
|
|
36
|
+
export * from './useInfiniteQueryHelper';
|
|
37
|
+
export * from './useInstapayBankListQuery';
|
|
38
|
+
export * from './useIsMayaSessionValidQuery';
|
|
39
|
+
export * from './useJackpotsQuery';
|
|
40
|
+
export * from './useLocaleInfo';
|
|
41
|
+
export * from './useMarkGameAsFavoriteMutation';
|
|
42
|
+
export * from './useMarkMessageAsReadMutation';
|
|
43
|
+
export * from './useMemberVerificationQuery';
|
|
44
|
+
export * from './useMessagesQuery';
|
|
45
|
+
export * from './useMobileNumberParser';
|
|
46
|
+
export * from './useOnMMA';
|
|
47
|
+
export * from './usePaymentSettingsQuery';
|
|
48
|
+
export * from './usePlatformQuery';
|
|
49
|
+
export * from './useProfileCompletionQuery';
|
|
50
|
+
export * from './usePromoQuery';
|
|
51
|
+
export * from './usePromosQuery';
|
|
52
|
+
export * from './useRemainingTime';
|
|
53
|
+
export * from './useSendVerificationCodeMutation';
|
|
54
|
+
export * from './useSessionQuery';
|
|
55
|
+
export * from './useSignInMutation';
|
|
56
|
+
export * from './useSignOutMutation';
|
|
57
|
+
export * from './useSignUpMutation';
|
|
58
|
+
export * from './useTopWinsQuery';
|
|
59
|
+
export * from './useTournamentsQuery';
|
|
60
|
+
export * from './useTransactionRecordsQuery';
|
|
61
|
+
export * from './useUnmarkGameAsFavoriteMutation';
|
|
62
|
+
export * from './useUnreadMessagesCountQuery';
|
|
63
|
+
export * from './useUpdateAccountMutation';
|
|
64
|
+
export * from './useWalletQuery';
|
|
65
|
+
export * from './useWithdrawalRecordsQuery';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export * from './useAccountQuery.js';
|
|
2
|
+
export * from './useAuthenticateMutation.js';
|
|
3
|
+
export * from './useAvailablePromosQuery.js';
|
|
4
|
+
export * from './useAvailableQuestsQuery.js';
|
|
5
|
+
export * from './useBetRecordsQuery.js';
|
|
6
|
+
export * from './useBonusesQuery.js';
|
|
7
|
+
export * from './useBonusQuery.js';
|
|
8
|
+
export * from './useCashbackBonusesQuery.js';
|
|
9
|
+
export * from './useCashbackBonusQuery.js';
|
|
10
|
+
export * from './useCashbackQuery.js';
|
|
11
|
+
export * from './useCashbacksQuery.js';
|
|
12
|
+
export * from './useCheckInDailyCheckInQuestMutation.js';
|
|
13
|
+
export * from './useChunk.js';
|
|
14
|
+
export * from './useClaimCashbackBonusMutation.js';
|
|
15
|
+
export * from './useClaimSpotBonusMutation.js';
|
|
16
|
+
export * from './useControllableState.js';
|
|
17
|
+
export * from './useCooldown.js';
|
|
18
|
+
export * from './useCreateGameSessionMutation.js';
|
|
19
|
+
export * from './useCreateGCashDepositMutation.js';
|
|
20
|
+
export * from './useCreateGCashWithdrawalMutation.js';
|
|
21
|
+
export * from './useCreateInstapayWithdrawalMutation.js';
|
|
22
|
+
export * from './useCreateMayaAppDepositMutation.js';
|
|
23
|
+
export * from './useCreateMayaAppWithdrawalMutation.js';
|
|
24
|
+
export * from './useCreateMayaDepositMutation.js';
|
|
25
|
+
export * from './useCreateMayaWithdrawalMutation.js';
|
|
26
|
+
export * from './useCreateOnlineBankDepositMutation.js';
|
|
27
|
+
export * from './useCreateQRPHDepositMutation.js';
|
|
28
|
+
export * from './useDepositQuery.js';
|
|
29
|
+
export * from './useDepositRecordsQuery.js';
|
|
30
|
+
export * from './useDepositsCountQuery.js';
|
|
31
|
+
export * from './useDisclosure.js';
|
|
32
|
+
export * from './useEndGameSessionMutation.js';
|
|
33
|
+
export * from './useFavoriteGamesQuery.js';
|
|
34
|
+
export * from './useGamesQuery.js';
|
|
35
|
+
export * from './useGlobalStore.js';
|
|
36
|
+
export * from './useInfiniteQueryHelper.js';
|
|
37
|
+
export * from './useInstapayBankListQuery.js';
|
|
38
|
+
export * from './useIsMayaSessionValidQuery.js';
|
|
39
|
+
export * from './useJackpotsQuery.js';
|
|
40
|
+
export * from './useLocaleInfo.js';
|
|
41
|
+
export * from './useMarkGameAsFavoriteMutation.js';
|
|
42
|
+
export * from './useMarkMessageAsReadMutation.js';
|
|
43
|
+
export * from './useMemberVerificationQuery.js';
|
|
44
|
+
export * from './useMessagesQuery.js';
|
|
45
|
+
export * from './useMobileNumberParser.js';
|
|
46
|
+
export * from './useOnMMA.js';
|
|
47
|
+
export * from './usePaymentSettingsQuery.js';
|
|
48
|
+
export * from './usePlatformQuery.js';
|
|
49
|
+
export * from './useProfileCompletionQuery.js';
|
|
50
|
+
export * from './usePromoQuery.js';
|
|
51
|
+
export * from './usePromosQuery.js';
|
|
52
|
+
export * from './useRemainingTime.js';
|
|
53
|
+
export * from './useSendVerificationCodeMutation.js';
|
|
54
|
+
export * from './useSessionQuery.js';
|
|
55
|
+
export * from './useSignInMutation.js';
|
|
56
|
+
export * from './useSignOutMutation.js';
|
|
57
|
+
export * from './useSignUpMutation.js';
|
|
58
|
+
export * from './useTopWinsQuery.js';
|
|
59
|
+
export * from './useTournamentsQuery.js';
|
|
60
|
+
export * from './useTransactionRecordsQuery.js';
|
|
61
|
+
export * from './useUnmarkGameAsFavoriteMutation.js';
|
|
62
|
+
export * from './useUnreadMessagesCountQuery.js';
|
|
63
|
+
export * from './useUpdateAccountMutation.js';
|
|
64
|
+
export * from './useWalletQuery.js';
|
|
65
|
+
export * from './useWithdrawalRecordsQuery.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SetOptional } from 'type-fest';
|
|
2
|
+
import { type CreateLibanganDepositInput } from '../../services/wallet';
|
|
3
|
+
import type { Deposit, Mutation } from '../../types';
|
|
4
|
+
export declare const useCreateLibanganDepositMutation: Mutation<Deposit, SetOptional<CreateLibanganDepositInput, 'id'>>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ObjectId } from '@opexa/object-id';
|
|
2
|
+
import { useMutation } from '@tanstack/react-query';
|
|
3
|
+
import { clamp } from 'lodash-es';
|
|
4
|
+
import invariant from 'tiny-invariant';
|
|
5
|
+
import { ObjectType } from '../../services/ObjectType.js';
|
|
6
|
+
import { createLibanganDeposit, getDeposit, } from '../../services/wallet.js';
|
|
7
|
+
import { createPoll } from '../../utils/createPoll.js';
|
|
8
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
9
|
+
import { getCreateLibanganDepositMutationKey } from '../../utils/mutationKeys.js';
|
|
10
|
+
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
11
|
+
import { getAvailableQuestsQueryKey, getDepositsCountQueryKey, } from '../../utils/queryKeys.js';
|
|
12
|
+
import { getSession } from '../services/getSession.js';
|
|
13
|
+
export const useCreateLibanganDepositMutation = (config) => {
|
|
14
|
+
const queryClient = getQueryClient();
|
|
15
|
+
const mutation = useMutation({
|
|
16
|
+
...config,
|
|
17
|
+
mutationKey: getCreateLibanganDepositMutationKey(),
|
|
18
|
+
mutationFn: async (input) => {
|
|
19
|
+
const id = input.id ?? ObjectId.generate(ObjectType.Deposit).toString();
|
|
20
|
+
const session = await getSession();
|
|
21
|
+
invariant(session.status === 'authenticated');
|
|
22
|
+
await createLibanganDeposit({ ...input, id }, {
|
|
23
|
+
headers: {
|
|
24
|
+
Authorization: `Bearer ${session.token}`,
|
|
25
|
+
...(session.domain && {
|
|
26
|
+
Domain: session.domain,
|
|
27
|
+
}),
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
const poll = createPoll(async () => {
|
|
31
|
+
const session = await getSession();
|
|
32
|
+
invariant(session.status === 'authenticated');
|
|
33
|
+
return await getDeposit(id, {
|
|
34
|
+
headers: {
|
|
35
|
+
Authorization: `Bearer ${session.token}`,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}, {
|
|
39
|
+
until(res) {
|
|
40
|
+
return !!res?.checkoutUrl;
|
|
41
|
+
},
|
|
42
|
+
interval: 1000,
|
|
43
|
+
maxAttempt: 5,
|
|
44
|
+
});
|
|
45
|
+
const res = await poll();
|
|
46
|
+
if (!res?.checkoutUrl) {
|
|
47
|
+
const error = new Error();
|
|
48
|
+
error.name = 'LibanganDepositError';
|
|
49
|
+
error.message = 'Failed to process Libangan deposit';
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
const depositsCount = queryClient.getQueryData(getDepositsCountQueryKey()) ?? 0;
|
|
53
|
+
if (depositsCount <= 0) {
|
|
54
|
+
queryClient.setQueryData(getAvailableQuestsQueryKey(), (prev) => {
|
|
55
|
+
return prev?.map((quest) => {
|
|
56
|
+
const progressPercentage = clamp(parseDecimal(quest.progressPercentage, 0) + 50, 100);
|
|
57
|
+
if (quest.type === 'ONBOARDING') {
|
|
58
|
+
return {
|
|
59
|
+
...quest,
|
|
60
|
+
status: progressPercentage >= 100 ? 'COMPLETED' : quest.status,
|
|
61
|
+
progressPercentage: progressPercentage.toFixed(2),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return quest;
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
queryClient.setQueryData(getDepositsCountQueryKey(), (prev) => prev ? prev + 1 : 1);
|
|
69
|
+
return res;
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
return mutation;
|
|
73
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SetOptional } from 'type-fest';
|
|
2
|
+
import { type CreateVentajaWithdrawalInput } from '../../services/wallet';
|
|
3
|
+
import type { Mutation } from '../../types';
|
|
4
|
+
export declare const useCreateVentajaWithdrawalMutation: Mutation<string, SetOptional<CreateVentajaWithdrawalInput, 'id'>>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ObjectId } from '@opexa/object-id';
|
|
2
|
+
import { useMutation } from '@tanstack/react-query';
|
|
3
|
+
import invariant from 'tiny-invariant';
|
|
4
|
+
import { ObjectType } from '../../services/ObjectType.js';
|
|
5
|
+
import { createVentajaWithdrawal, } from '../../services/wallet.js';
|
|
6
|
+
import { getCreateVentajaWithdrawalMutationKey } from '../../utils/mutationKeys.js';
|
|
7
|
+
import { getSession } from '../services/getSession.js';
|
|
8
|
+
export const useCreateVentajaWithdrawalMutation = (config) => {
|
|
9
|
+
const mutation = useMutation({
|
|
10
|
+
...config,
|
|
11
|
+
mutationKey: getCreateVentajaWithdrawalMutationKey(),
|
|
12
|
+
mutationFn: async (input) => {
|
|
13
|
+
const id = input.id ?? ObjectId.generate(ObjectType.Withdrawal).toString();
|
|
14
|
+
const session = await getSession();
|
|
15
|
+
invariant(session.status === 'authenticated');
|
|
16
|
+
await createVentajaWithdrawal({ ...input, id }, {
|
|
17
|
+
headers: {
|
|
18
|
+
Authorization: `Bearer ${session.token}`,
|
|
19
|
+
...(session.domain && {
|
|
20
|
+
Domain: session.domain,
|
|
21
|
+
}),
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
return id;
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
return mutation;
|
|
28
|
+
};
|
|
@@ -13,7 +13,7 @@ import piggyBank from '../../images/piggy-bank.png';
|
|
|
13
13
|
import { Badge } from '../../ui/Badge/index.js';
|
|
14
14
|
import { Collapsible } from '../../ui/Collapsible/index.js';
|
|
15
15
|
import { Progress } from '../../ui/Progress/index.js';
|
|
16
|
-
import { Prose } from '../../ui/Prose
|
|
16
|
+
import { Prose } from '../../ui/Prose.js';
|
|
17
17
|
import { capitalize } from '../../utils/capitalize.js';
|
|
18
18
|
import { formatNumber } from '../../utils/formatNumber.js';
|
|
19
19
|
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
@@ -11,7 +11,7 @@ import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
|
11
11
|
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
12
12
|
import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
|
|
13
13
|
import { Button } from '../../ui/Button/index.js';
|
|
14
|
-
import { Prose } from '../../ui/Prose
|
|
14
|
+
import { Prose } from '../../ui/Prose.js';
|
|
15
15
|
export function Cashback__client(props) {
|
|
16
16
|
const availablePromosQuery = useAvailablePromosQuery();
|
|
17
17
|
const cashbackQuery = useCashbackQuery(props.id);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
import Link from 'next/link';
|
|
5
|
+
import { ChevronLeftIcon, ChevronRightIcon, StopWatchIcon } from '../../icons/index.js';
|
|
6
|
+
import { Badge, Collapsible, Progress, Prose } from '../../ui/index.js';
|
|
7
|
+
export function CashbackBonus__client(props) {
|
|
8
|
+
return (_jsxs("div", { className: props.className, children: [_jsxs(Link, { href: props.viewAllUrl ?? '/rewards', className: "text-button-tertiary-fg flex items-center gap-lg text-lg font-semibold", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to Rewards"] }), _jsx(Image, { src: "https://s3.ap-east-1.amazonaws.com/opexa-assets.opexasystem.com/assets/BSxIXEsa59_zzMAR27-ALLDAYREBATE06-STATIC-WEB-HB-1920x1080.png", alt: "", width: 1024, height: 600, className: "mt-3xl h-auto w-full rounded-xl" }), _jsxs(Badge.Root, { size: "lg", round: false, colorScheme: "brand", className: "mt-xl lg:mt-6", children: [_jsx(Badge.Icon, { children: _jsx(StopWatchIcon, {}) }), _jsx(Badge.Label, { children: "9d:10h:11m" })] }), _jsx("h1", { className: "text-text-primary-900 mt-xl text-2xl font-semibold lg:mt-6 lg:text-3xl", children: "50 PHP First Deposit Bonus" }), _jsx("p", { className: "text-text-primary-brand mt-xl text-base lg:mt-6 lg:text-lg", children: "Complete the wagering before time runs out to convert your bonus balance into real money!" }), _jsxs("div", { className: "border-border-primary bg-bg-tertiary text-text-secondary-700 mt-xl flex items-center justify-between rounded-md border px-3.5 py-xl lg:mt-6", children: [_jsx("p", { children: "Your bonus" }), _jsxs("p", { children: [_jsx("span", { className: "text-text-primary-900", children: "20.00" }), " / 50.00 PHP"] })] }), _jsxs("div", { className: "border-border-primary bg-bg-tertiary text-text-secondary-700 mt-xl flex items-center justify-between rounded-md border px-3.5 py-xl lg:mt-6", children: [_jsx("p", { children: "Required Turnover" }), _jsx("p", { children: "5x" })] }), _jsxs("div", { className: "border-border-primary bg-bg-tertiary text-text-secondary-700 mt-xl rounded-md border px-3.5 py-xl lg:mt-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("p", { children: "Wagering" }), _jsx("p", { children: "400/1000" })] }), _jsx(Progress.Root, { defaultValue: 42, className: "mt-2", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) })] }), _jsxs(Collapsible.Root, { className: "mt-xl lg:mt-6", children: [_jsxs(Collapsible.Trigger, { className: "text-button-tertiary-fg flex w-fit items-center justify-center gap-sm text-sm font-semibold lg:mx-auto", children: ["Game Provider Contribution", _jsx(Collapsible.Indicator, { asChild: true, children: _jsx(ChevronRightIcon, { className: "size-5" }) })] }), _jsxs(Collapsible.Content, { className: "border-border-primary bg-bg-tertiary text-text-secondary-700 mt-xl space-y-1.5 rounded-md border px-3.5 py-xl lg:mt-6", children: [_jsxs("div", { className: "flex items-center justify-between gap-md", children: [_jsx("p", { className: "w-[11.25rem] shrink-0", children: "Playson" }), _jsx(Progress.Root, { defaultValue: 42, className: "mt-2 grow", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) }), _jsx("p", { children: "25%" })] }), _jsxs("div", { className: "flex items-center justify-between gap-md", children: [_jsx("p", { className: "w-[11.25rem] shrink-0", children: "Betsoft Gaming" }), _jsx(Progress.Root, { defaultValue: 42, className: "mt-2 grow", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) }), _jsx("p", { children: "13%" })] }), _jsxs("div", { className: "flex items-center justify-between gap-md", children: [_jsx("p", { className: "w-[11.25rem] shrink-0", children: "Microgaming" }), _jsx(Progress.Root, { defaultValue: 42, className: "mt-2 grow", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) }), _jsx("p", { children: "50%" })] }), _jsxs("div", { className: "flex items-center justify-between gap-md", children: [_jsx("p", { className: "w-[11.25rem] shrink-0", children: "Realtime Gaming" }), _jsx(Progress.Root, { defaultValue: 42, className: "mt-2 grow", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) }), _jsx("p", { children: "10%" })] })] })] }), _jsxs(Prose, { className: "mt-xl lg:mt-6", children: [_jsx("h3", { children: "How to get bonus" }), _jsxs("ol", { children: [_jsx("li", { children: "All OFWin members are eligible for this program." }), _jsx("li", { children: "50 PHP of game credit will be automatically credited to the new member account upon completion of first deposit Auctor vel in vitae placerat." }), _jsx("li", { children: "Member must reach a 5x turnover requirement before a withdrawal can be made. Attempting to make a withdrawal before this turnover requirement is completed could cause your bonus to be voided." }), _jsx("li", { children: "Players will have 10 days from the date the bonus is awarded to complete the rollover requirement." }), _jsx("li", { children: "Bets used to meet other bonus rollover requirements will not count toward this promotion." })] }), _jsx("h3", { children: "Terms and Conditions" }), _jsxs("ul", { children: [_jsx("li", { children: "Only one account per player is allowed. No same IP address/bank account name allowed. Players who have multiple or fraudulent accounts will not be qualified for the promotion." }), _jsx("li", { children: "Players that are found to have any duplicate accounts or those who participate in fraudulent activities may have their funds forfeited and their accounts closed." }), _jsx("li", { children: "OFWin reserves the right to amend or cancel this Referral Program at any time. OFWin General Terms and Conditions apply." })] })] })] }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface CashbackBonusProps {
|
|
2
|
+
id: string;
|
|
3
|
+
className?: string;
|
|
4
|
+
/**
|
|
5
|
+
* @description URL for the bonuses details page
|
|
6
|
+
* @default "/rewards"
|
|
7
|
+
*/
|
|
8
|
+
viewAllUrl?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function CashbackBonus(props: CashbackBonusProps): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CashbackBonus';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CashbackBonus.js';
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import Image from 'next/image';
|
|
4
4
|
import Link from 'next/link';
|
|
5
5
|
import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
|
|
6
|
-
import { Prose } from '../../ui/Prose
|
|
6
|
+
import { Prose } from '../../ui/Prose.js';
|
|
7
7
|
import { stripTags } from '../../utils/stripTags.js';
|
|
8
8
|
export function CustomPromo(props) {
|
|
9
9
|
return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "og:title", content: props.promo.name }), _jsx("meta", { name: "og:description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "og:image", content: props.promo.banner }), _jsx("meta", { name: "twitter:title", content: props.promo.name }), _jsx("meta", { name: "twitter:description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "twitter:image", content: props.promo.banner }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsxs("div", { className: props.className, children: [_jsxs(Link, { href: props.viewAllPromosUrl ?? '/promos', className: "text-button-tertiary-fg flex w-fit items-center gap-lg text-lg font-semibold", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all Promotions"] }), _jsx(Image, { src: props.promo.banner, alt: "", width: 1024, height: 600, priority: true, unoptimized: true, className: "mt-xl h-auto w-full rounded-xl lg:mt-6" }), _jsx("h1", { className: "mt-xl text-2xl font-semibold lg:mt-6 lg:text-3xl", children: props.promo.name }), _jsx(Prose, { className: "mt-2xl lg:mt-6", dangerouslySetInnerHTML: {
|
|
@@ -8,6 +8,7 @@ import { SpinnerIcon } from '../../../icons/SpinnerIcon.js';
|
|
|
8
8
|
import { onMobileDevice } from '../../../utils/onMobileDevice.js';
|
|
9
9
|
import { PaymentMethods } from '../PaymentMethods.js';
|
|
10
10
|
import { GCashDeposit } from './GCashDeposit/GCashDeposit.js';
|
|
11
|
+
import { LibanganDeposit } from './LibanganDeposit/LibanganDeposit.js';
|
|
11
12
|
import { MayaAppDeposit } from './MayaAppDeposit/MayaAppDeposit.js';
|
|
12
13
|
import { MayaDeposit } from './MayaDeposit/MayaDeposit.js';
|
|
13
14
|
import { OnlineBankDeposit } from './OnlineBankDeposit/OnlineBankDeposit.js';
|
|
@@ -34,6 +35,9 @@ export function Deposit() {
|
|
|
34
35
|
if (paymentSettings?.onlineBankDepositGatewaySettings?.mobileWebEnabled) {
|
|
35
36
|
l.push('ONLINE_BANK');
|
|
36
37
|
}
|
|
38
|
+
if (paymentSettings?.libanganDepositGatewaySettings?.mobileWebEnabled) {
|
|
39
|
+
l.push('LIBANGAN');
|
|
40
|
+
}
|
|
37
41
|
}
|
|
38
42
|
else {
|
|
39
43
|
if (paymentSettings?.gcashDepositGatewaySettings?.webEnabled) {
|
|
@@ -48,6 +52,9 @@ export function Deposit() {
|
|
|
48
52
|
if (paymentSettings?.onlineBankDepositGatewaySettings?.webEnabled) {
|
|
49
53
|
l.push('ONLINE_BANK');
|
|
50
54
|
}
|
|
55
|
+
if (paymentSettings?.libanganDepositGatewaySettings?.webEnabled) {
|
|
56
|
+
l.push('LIBANGAN');
|
|
57
|
+
}
|
|
51
58
|
}
|
|
52
59
|
return l;
|
|
53
60
|
})();
|
|
@@ -68,7 +75,7 @@ export function Deposit() {
|
|
|
68
75
|
if (enabledPaymentMethods.length <= 0) {
|
|
69
76
|
return _jsx(NoAvailablePaymentMethods, {});
|
|
70
77
|
}
|
|
71
|
-
return (_jsxs(_Fragment, { children: [_jsx(PaymentMethods, { value: paymentMethod, onChange: setPaymentMethod, options: enabledPaymentMethods }), paymentMethod === 'QRPH' && _jsx(QRPHDeposit, {}), paymentMethod === 'GCASH' && _jsx(GCashDeposit, {}), paymentMethod === 'MAYA' && _jsx(MayaDeposit, {}), paymentMethod === 'MAYA_APP' && _jsx(MayaAppDeposit, {}), paymentMethod === 'ONLINE_BANK' && _jsx(OnlineBankDeposit, {})] }));
|
|
78
|
+
return (_jsxs(_Fragment, { children: [_jsx(PaymentMethods, { value: paymentMethod, onChange: setPaymentMethod, options: enabledPaymentMethods }), paymentMethod === 'QRPH' && _jsx(QRPHDeposit, {}), paymentMethod === 'GCASH' && _jsx(GCashDeposit, {}), paymentMethod === 'MAYA' && _jsx(MayaDeposit, {}), paymentMethod === 'MAYA_APP' && _jsx(MayaAppDeposit, {}), paymentMethod === 'ONLINE_BANK' && _jsx(OnlineBankDeposit, {}), paymentMethod === 'LIBANGAN' && _jsx(LibanganDeposit, {})] }));
|
|
72
79
|
}
|
|
73
80
|
function MayaSessionSessionExpired() {
|
|
74
81
|
return (_jsxs("div", { className: "py-xl", children: [_jsx("div", { className: "bg-bg-warning-secondary mx-auto flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, { className: "text-text-featured-icon-light-warning size-6" }) }), _jsx("h2", { className: "mt-lg text-center text-lg font-semibold", children: "Session Expired" }), _jsx("p", { className: "text-text-tertiary-600 mx-auto mt-xs max-w-[25rem] text-center text-sm", children: "Your session has timed out. To continue with deposits or withdrawals, Please try reloading the app." })] }));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function LibanganDeposit(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
3
|
+
import Link from 'next/link';
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
import { Controller, useForm } from 'react-hook-form';
|
|
6
|
+
import invariant from 'tiny-invariant';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { useShallow } from 'zustand/shallow';
|
|
9
|
+
import { useAvailablePromosQuery } from '../../../../client/hooks/useAvailablePromosQuery.js';
|
|
10
|
+
import { useCreateLibanganDepositMutation } from '../../../../client/hooks/useCreateLibanganDepositMutation.js';
|
|
11
|
+
import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
|
|
12
|
+
import { useDepositsCountQuery } from '../../../../client/hooks/useDepositsCountQuery.js';
|
|
13
|
+
import { useDisclosure } from '../../../../client/hooks/useDisclosure.js';
|
|
14
|
+
import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
|
|
15
|
+
import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
|
|
16
|
+
import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
|
|
17
|
+
import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
|
|
18
|
+
import { ChevronUpIcon } from '../../../../icons/ChevronUpIcon.js';
|
|
19
|
+
import { SpinnerIcon } from '../../../../icons/SpinnerIcon.js';
|
|
20
|
+
import { XIcon } from '../../../../icons/XIcon.js';
|
|
21
|
+
import { AlertDialog } from '../../../../ui/AlertDialog/index.js';
|
|
22
|
+
import { Button } from '../../../../ui/Button/index.js';
|
|
23
|
+
import { Field } from '../../../../ui/Field/index.js';
|
|
24
|
+
import { NumberInput } from '../../../../ui/NumberInput/index.js';
|
|
25
|
+
import { Portal } from '../../../../ui/Portal/index.js';
|
|
26
|
+
import { parseDecimal } from '../../../../utils/parseDecimal.js';
|
|
27
|
+
import { AmountChoices } from '../../AmountChoices.js';
|
|
28
|
+
import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
|
|
29
|
+
import { AvailablePromos } from '../AvailablePromos.js';
|
|
30
|
+
export function LibanganDeposit() {
|
|
31
|
+
const depositWithdrawalProps = useDepositWithdrawalPropsContext();
|
|
32
|
+
const disclosure = useDisclosure();
|
|
33
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
34
|
+
depositWithdrawal: ctx.depositWithdrawal,
|
|
35
|
+
})));
|
|
36
|
+
const [status, setStatus] = useState('waiting');
|
|
37
|
+
const createDepositMutation = useCreateLibanganDepositMutation({
|
|
38
|
+
onMutate() {
|
|
39
|
+
disclosure.setOpen(true);
|
|
40
|
+
setStatus('processing');
|
|
41
|
+
},
|
|
42
|
+
onSuccess(data) {
|
|
43
|
+
invariant(data.checkoutUrl);
|
|
44
|
+
window.open(data.checkoutUrl, '_blank', 'noopener,noreferrer');
|
|
45
|
+
form.reset();
|
|
46
|
+
disclosure.setOpen(false);
|
|
47
|
+
},
|
|
48
|
+
onError() {
|
|
49
|
+
disclosure.setOpen(true);
|
|
50
|
+
setStatus('failed');
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
const depositQuery = useDepositQuery(createDepositMutation.data?.id, {
|
|
54
|
+
enabled: createDepositMutation.data != null,
|
|
55
|
+
refetchInterval(ctx) {
|
|
56
|
+
if (ctx.state.data?.status === 'CANCELLED' ||
|
|
57
|
+
ctx.state.data?.status === 'CONFIRMED') {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
return 2500;
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (depositQuery.data?.status === 'CANCELLED') {
|
|
67
|
+
disclosure.setOpen(true);
|
|
68
|
+
setStatus('failed');
|
|
69
|
+
}
|
|
70
|
+
else if (depositQuery.data?.status === 'CONFIRMED') {
|
|
71
|
+
disclosure.setOpen(true);
|
|
72
|
+
setStatus('success');
|
|
73
|
+
}
|
|
74
|
+
}, [depositQuery.data?.status, disclosure]);
|
|
75
|
+
const depositsCountQuery = useDepositsCountQuery();
|
|
76
|
+
const depositsCount = depositsCountQuery.data ?? 0;
|
|
77
|
+
const paymentSettingsQuery = usePaymentSettingsQuery();
|
|
78
|
+
const paymentSettings = paymentSettingsQuery.data;
|
|
79
|
+
const gatewaySettings = paymentSettings?.libanganDepositGatewaySettings;
|
|
80
|
+
const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
|
|
81
|
+
const minimumAmount = depositsCount <= 0
|
|
82
|
+
? parseDecimal(paymentSettingsQuery.data?.minimumFirstDepositAmount, 0)
|
|
83
|
+
: parseDecimal(gatewaySettings?.minimumAmount, 0);
|
|
84
|
+
const promosQuery = useAvailablePromosQuery();
|
|
85
|
+
const promos = promosQuery.data ?? [];
|
|
86
|
+
const definition = z
|
|
87
|
+
.object({
|
|
88
|
+
amount: z.string().superRefine((val, ctx) => {
|
|
89
|
+
const n = parseDecimal(val, 0);
|
|
90
|
+
if (n < minimumAmount) {
|
|
91
|
+
ctx.addIssue({
|
|
92
|
+
type: 'number',
|
|
93
|
+
code: z.ZodIssueCode.too_small,
|
|
94
|
+
inclusive: true,
|
|
95
|
+
minimum: minimumAmount,
|
|
96
|
+
message: `Minimum amount is ${minimumAmount.toLocaleString()}`,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (n > maximumAmount) {
|
|
100
|
+
ctx.addIssue({
|
|
101
|
+
type: 'number',
|
|
102
|
+
code: z.ZodIssueCode.too_big,
|
|
103
|
+
inclusive: true,
|
|
104
|
+
maximum: maximumAmount,
|
|
105
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}),
|
|
109
|
+
promo: z.string().optional().nullable(),
|
|
110
|
+
})
|
|
111
|
+
.superRefine((value, ctx) => {
|
|
112
|
+
const promo = promos.find((o) => o.id === value.promo);
|
|
113
|
+
const promoMinAmount = parseDecimal(promo?.minimumDepositAmount, 0);
|
|
114
|
+
const promoMaxAmount = parseDecimal(promo?.maximumDepositAmount, 0);
|
|
115
|
+
const amount = parseDecimal(value.amount, 0);
|
|
116
|
+
if (promo && amount < promoMinAmount) {
|
|
117
|
+
ctx.addIssue({
|
|
118
|
+
path: ['amount'],
|
|
119
|
+
code: z.ZodIssueCode.custom,
|
|
120
|
+
message: `Minimum amount for this promo is ${promoMinAmount.toLocaleString()}`,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
if (promo && amount > promoMaxAmount) {
|
|
124
|
+
ctx.addIssue({
|
|
125
|
+
path: ['amount'],
|
|
126
|
+
code: z.ZodIssueCode.custom,
|
|
127
|
+
message: `Maximum amount for this promo is ${promoMaxAmount}`,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
const form = useForm({
|
|
132
|
+
mode: 'all',
|
|
133
|
+
resolver: zodResolver(definition),
|
|
134
|
+
defaultValues: {
|
|
135
|
+
amount: '0',
|
|
136
|
+
promo: globalStore.depositWithdrawal.promo ?? null,
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
useEffect(() => {
|
|
140
|
+
if (minimumAmount) {
|
|
141
|
+
form.reset({
|
|
142
|
+
amount: minimumAmount.toString(),
|
|
143
|
+
promo: form.getValues('promo') ?? null,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}, [form, minimumAmount]);
|
|
147
|
+
return (_jsxs("form", { onSubmit: form.handleSubmit(async (data) => {
|
|
148
|
+
createDepositMutation.reset();
|
|
149
|
+
createDepositMutation.mutate({
|
|
150
|
+
amount: data.amount.toString(),
|
|
151
|
+
promo: data.promo ?? undefined,
|
|
152
|
+
});
|
|
153
|
+
}), 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) => {
|
|
154
|
+
o.field.onChange(details.value);
|
|
155
|
+
}, formatOptions: {
|
|
156
|
+
maximumFractionDigits: 2,
|
|
157
|
+
minimumFractionDigits: 0,
|
|
158
|
+
}, 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) => {
|
|
159
|
+
form.setValue('amount', value.toString(), {
|
|
160
|
+
shouldTouch: true,
|
|
161
|
+
shouldDirty: true,
|
|
162
|
+
shouldValidate: true,
|
|
163
|
+
});
|
|
164
|
+
}, min: minimumAmount, max: maximumAmount, className: "mt-lg" }), _jsx(Controller, { control: form.control, name: "promo", render: (o) => (_jsx(AvailablePromos, { value: o.field.value, onChange: (value) => {
|
|
165
|
+
o.field.onChange(value);
|
|
166
|
+
globalStore.depositWithdrawal.setPromo(null);
|
|
167
|
+
}, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: createDepositMutation.isPending, children: "Deposit" }), _jsxs("p", { className: "text-text-tertiary-600 mt-lg text-xs", children: ["By depositing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: disclosure.open, onOpenChange: (details) => {
|
|
168
|
+
disclosure.setOpen(details.open);
|
|
169
|
+
}, 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, { children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "text-text-brand-primary-600 size-12" })), status === 'success' && (_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "bg-bg-error-secondary text-text-featured-icon-light-error flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Deposit', status === 'success' && 'Deposit Successful', status === 'failed' && 'Deposit Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
|
|
170
|
+
"We're verifying your account and amount. Please hold a moment.", status === 'success' &&
|
|
171
|
+
'Your deposit has been successfully processed.', status === 'failed' &&
|
|
172
|
+
'Something went wrong while processing your deposit. Please try again or contact support.'] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
|
|
173
|
+
api.setOpen(false);
|
|
174
|
+
}, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
|
|
175
|
+
}
|
|
@@ -6,6 +6,7 @@ import { CheckIcon } from '../../icons/CheckIcon.js';
|
|
|
6
6
|
import qrph from '../../images/QRPH.png';
|
|
7
7
|
import gcash from '../../images/gcash.png';
|
|
8
8
|
import instapay from '../../images/instapay.png';
|
|
9
|
+
import libangan from '../../images/libangan.png';
|
|
9
10
|
import maya from '../../images/maya.png';
|
|
10
11
|
import onlineBank from '../../images/online-bank.png';
|
|
11
12
|
import { Checkbox } from '../../ui/Checkbox/index.js';
|
|
@@ -42,6 +43,11 @@ const OPTIONS = [
|
|
|
42
43
|
label: 'Instapay',
|
|
43
44
|
image: instapay,
|
|
44
45
|
},
|
|
46
|
+
{
|
|
47
|
+
value: 'LIBANGAN',
|
|
48
|
+
label: 'Libangan',
|
|
49
|
+
image: libangan,
|
|
50
|
+
},
|
|
45
51
|
];
|
|
46
52
|
export function PaymentMethods(props) {
|
|
47
53
|
const options = props.options?.length
|
|
@@ -57,5 +63,5 @@ export function PaymentMethods(props) {
|
|
|
57
63
|
if (!lastValue)
|
|
58
64
|
return;
|
|
59
65
|
setValue(PaymentMethodDefinition.parse(lastValue));
|
|
60
|
-
}, 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:
|
|
66
|
+
}, 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: twMerge('w-auto', option.value === 'LIBANGAN' ? 'h-[2.5rem]' : 'h-[1.063rem]'), draggable: false }) }), _jsx(Checkbox.Control, { className: "shrink-0", children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.HiddenInput, {})] }, option.value))) })] }));
|
|
61
67
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function VentajaWithdrawal(): import("react/jsx-runtime").JSX.Element;
|