@opexa/portal-components 0.0.842 → 0.0.844
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/useAiOGCashDepositMutation.js +10 -0
- package/dist/client/hooks/useCreateGCashDepositMutation.js +10 -0
- package/dist/client/hooks/useCreateMayaDepositMutation.js +10 -0
- package/dist/client/hooks/useCreateOnlineBankDepositMutation.js +10 -0
- package/dist/client/hooks/useCreateQRPHDepositMutation.js +10 -0
- package/dist/components/DepositWithdrawal/Deposit/AiOGCashDeposit/AiOGCashDeposit.js +9 -4
- package/dist/components/DepositWithdrawal/Deposit/AiOPayMayaDeposit/AiOPayMayaDeposit.js +9 -4
- package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +10 -5
- package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.js +9 -4
- package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +9 -4
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/Failed.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +8 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +4 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.js +8 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/useQRPHDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Confirmed.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Confirmed.js +11 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Failed.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Failed.js +11 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Form.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Form.js +126 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/GeneratingQrCode.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/GeneratingQrCode.js +10 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QRPHDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QRPHDeposit.js +12 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QRPHDepositContext.d.ts +17 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QRPHDepositContext.js +2 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QrCodeGenerated.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QrCodeGenerated.js +41 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/useQRPHDeposit.d.ts +13 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/useQRPHDeposit.js +91 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/PaymentMethods.js +20 -10
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayGCashWithdrawal/InstapayGcashWithdrawal.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayGCashWithdrawal/InstapayGcashWithdrawal.js +143 -0
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayPaymayaWithdrawal/InstapayPaymayaWithdrawal.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayPaymayaWithdrawal/InstapayPaymayaWithdrawal.js +143 -0
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js +2 -1
- package/dist/components/DepositWithdrawal/Withdrawal/Withdrawal.js +13 -1
- package/dist/components/DepositWithdrawal/utils.d.ts +1 -1
- package/dist/components/DepositWithdrawal/utils.js +3 -0
- package/dist/components/DigitainLauncher/Loading.js +1 -1
- package/dist/components/Disclaimer/ResponsibleGaming.d.ts +10 -0
- package/dist/components/Disclaimer/ResponsibleGaming.js +13 -0
- package/dist/components/Disclaimer/TermsOfUse.d.ts +11 -0
- package/dist/components/Disclaimer/TermsOfUse.js +13 -0
- package/dist/components/FeatureFlag/FeatureFlag.d.ts +1 -0
- package/dist/components/FeatureFlag/FeatureFlag.js +29 -0
- package/dist/components/FeatureFlag/index.d.ts +1 -0
- package/dist/components/FeatureFlag/index.js +1 -0
- package/dist/components/Jackpots/Jackpots.module.css +221 -221
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
- package/dist/components/KYC/AutoOpen.d.ts +1 -0
- package/dist/components/KYC/AutoOpen.js +40 -0
- package/dist/components/KYC/BasicInformation.js +1 -1
- package/dist/components/KYC/CaptureIdDocument.d.ts +1 -0
- package/dist/components/KYC/CaptureIdDocument.js +219 -0
- package/dist/components/KYC/CaptureSelfie.d.ts +1 -0
- package/dist/components/KYC/CaptureSelfie.js +285 -0
- package/dist/components/KYC/DisplayImage.d.ts +5 -0
- package/dist/components/KYC/DisplayImage.js +8 -0
- package/dist/components/KYC/FileUpload.d.ts +10 -0
- package/dist/components/KYC/FileUpload.js +72 -0
- package/dist/components/KYC/IdentityVerification.js +1 -1
- package/dist/components/KYC/KYC.lazy.js +1 -1
- package/dist/components/KYC/KYCDefault/KYCVerificationStatus.lazy.js +2 -2
- package/dist/components/KYC/KYCVerificationStatus.lazy.js +8 -5
- package/dist/components/KYC/NoCameraError.d.ts +7 -0
- package/dist/components/KYC/NoCameraError.js +6 -0
- package/dist/components/KYC/PersonOverlayDesktop.d.ts +7 -0
- package/dist/components/KYC/PersonOverlayDesktop.js +9 -0
- package/dist/components/KYC/PersonalInformation.js +1 -1
- package/dist/components/KYC/backup/Header.d.ts +1 -0
- package/dist/components/KYC/backup/Header.js +8 -0
- package/dist/components/KYC/backup/Indicator.d.ts +1 -0
- package/dist/components/KYC/backup/Indicator.js +9 -0
- package/dist/components/KYC/backup/KYC.d.ts +1 -0
- package/dist/components/KYC/backup/KYC.js +14 -0
- package/dist/components/KYC/backup/KYC.lazy.d.ts +1 -0
- package/dist/components/KYC/backup/KYC.lazy.js +26 -0
- package/dist/components/KYC/backup/KYCContext.d.ts +6 -0
- package/dist/components/KYC/backup/KYCContext.js +2 -0
- package/dist/components/KYC/backup/Step1.d.ts +1 -0
- package/dist/components/KYC/backup/Step1.js +13 -0
- package/dist/components/KYC/backup/Step2.d.ts +1 -0
- package/dist/components/KYC/backup/Step2.js +13 -0
- package/dist/components/KYC/backup/Step3.d.ts +1 -0
- package/dist/components/KYC/backup/Step3.js +13 -0
- package/dist/components/KYC/backup/Step4.d.ts +1 -0
- package/dist/components/KYC/backup/Step4.js +7 -0
- package/dist/components/KYC/backup/useKYC.d.ts +10 -0
- package/dist/components/KYC/backup/useKYC.js +8 -0
- package/dist/components/KYC/loadModels.d.ts +1 -0
- package/dist/components/KYC/loadModels.js +9 -0
- package/dist/components/KYC/utils.d.ts +9 -0
- package/dist/components/KYC/utils.js +79 -0
- package/dist/components/Messages/Message.d.ts +1 -0
- package/dist/components/Messages/Message.js +35 -0
- package/dist/components/Messages/MessageContext.d.ts +6 -0
- package/dist/components/Messages/MessageContext.js +2 -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 +19 -0
- package/dist/components/PortalProvider/CXDTokenObserver.js +11 -11
- 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 +78 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +8 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +9 -0
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +4 -0
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +4 -0
- package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +4 -0
- package/dist/components/Quests/WageringQuest/WageringQuest.js +20 -0
- package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +9 -0
- package/dist/components/Quests/WageringQuest/WageringQuestModal.js +9 -0
- package/dist/components/SignUp/SignUp.lazy.d.ts +12 -0
- package/dist/components/SignUp/SignUp.lazy.js +18 -0
- package/dist/components/SignUp/SignUpContext.d.ts +6 -0
- package/dist/components/SignUp/SignUpContext.js +2 -0
- package/dist/components/SignUp/SignUpDefault/SignUp.lazy.d.ts +17 -0
- package/dist/components/SignUp/SignUpDefault/SignUp.lazy.js +18 -0
- package/dist/components/SignUp/SignUpDefault/SignUpContext.d.ts +6 -0
- package/dist/components/SignUp/SignUpDefault/SignUpContext.js +2 -0
- package/dist/components/SignUp/SignUpDefault/SignUpForm.d.ts +1 -0
- package/dist/components/SignUp/SignUpDefault/SignUpForm.js +310 -0
- package/dist/components/SignUp/SignUpForm.d.ts +1 -0
- package/dist/components/SignUp/SignUpForm.js +284 -0
- package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.d.ts +1 -0
- package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.js +198 -0
- package/dist/components/SignUp/SignUpKYC/CaptureSelfie.d.ts +1 -0
- package/dist/components/SignUp/SignUpKYC/CaptureSelfie.js +251 -0
- package/dist/components/SignUp/SignUpKYC/ImageUploader.d.ts +10 -0
- package/dist/components/SignUp/SignUpKYC/ImageUploader.js +42 -0
- package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.d.ts +7 -0
- package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.js +9 -0
- package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.d.ts +1 -0
- package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.js +464 -0
- package/dist/components/SignUp/SignUpKYC/useImageUploader.d.ts +11 -0
- package/dist/components/SignUp/SignUpKYC/useImageUploader.js +20 -0
- package/dist/components/SignUp/SignUpKYC/utils.d.ts +9 -0
- package/dist/components/SignUp/SignUpKYC/utils.js +79 -0
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.d.ts +1 -0
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.js +198 -0
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.d.ts +1 -0
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.js +251 -0
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.d.ts +10 -0
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.js +41 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.d.ts +1 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.js +429 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.d.ts +13 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.js +26 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.d.ts +7 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.js +2 -0
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.d.ts +11 -0
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.js +20 -0
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
- package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
- package/dist/components/shared/IdDocumentField.client.d.ts +25 -0
- package/dist/components/shared/IdDocumentField.client.js +204 -0
- package/dist/components/shared/IdDocumentField.d.ts +2 -0
- package/dist/components/shared/IdDocumentField.js +11 -0
- package/dist/components/shared/SelfieField.client.d.ts +20 -0
- package/dist/components/shared/SelfieField.client.js +327 -0
- package/dist/components/shared/SelfieField.d.ts +2 -0
- package/dist/components/shared/SelfieField.js +11 -0
- package/dist/constants/BranchCode.d.ts +4 -0
- package/dist/constants/BranchCode.js +42 -0
- package/dist/handlers/postTransformIdFrontImage.d.ts +3 -0
- package/dist/handlers/postTransformIdFrontImage.js +67 -0
- package/dist/handlers/postTransformSelfieImage.d.ts +3 -0
- package/dist/handlers/postTransformSelfieImage.js +71 -0
- package/dist/handlers.d.ts +43 -0
- package/dist/handlers.js +297 -0
- package/dist/icons/BellRingIcon.d.ts +2 -0
- package/dist/icons/BellRingIcon.js +4 -0
- package/dist/services/queries.js +3153 -3153
- package/dist/styles/theme.css +776 -776
- package/dist/ui/AlertDialog/AlertDialog.d.ts +55 -55
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +5 -5
- package/dist/ui/Badge/Badge.d.ts +12 -12
- 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.d.ts +45 -45
- package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Dialog/Dialog.d.ts +33 -33
- package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Field/Field.d.ts +21 -21
- package/dist/ui/Field/field.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +252 -252
- package/dist/ui/Menu/menu.recipe.d.ts +14 -14
- package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
- package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/PinInput/PinInput.d.ts +12 -12
- package/dist/ui/PinInput/pinInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +55 -55
- package/dist/ui/Popover/popover.recipe.d.ts +5 -5
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/QrCode/QrCode.d.ts +25 -25
- package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/utils/dataUrlToBlob.d.ts +1 -0
- package/dist/utils/dataUrlToBlob.js +11 -0
- package/dist/utils/gamesAvailable3pmTo3am.d.ts +1 -0
- package/dist/utils/gamesAvailable3pmTo3am.js +1 -0
- package/dist/utils/getGameName.d.ts +1 -0
- package/dist/utils/getGameName.js +6 -0
- package/dist/utils/isBetween3amAnd3pm.d.ts +1 -0
- package/dist/utils/isBetween3amAnd3pm.js +5 -0
- package/dist/utils/resizeImageSize.d.ts +2 -0
- package/dist/utils/resizeImageSize.js +11 -0
- package/package.json +177 -177
- package/dist/components/Banner/Banner.client.d.ts +0 -12
- package/dist/components/Banner/Banner.client.js +0 -49
- package/dist/components/PortalProvider/AndroidOnlyComponents.d.ts +0 -1
- package/dist/components/PortalProvider/AndroidOnlyComponents.js +0 -12
|
@@ -0,0 +1,143 @@
|
|
|
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 { useForm } from 'react-hook-form';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { useShallow } from 'zustand/shallow';
|
|
8
|
+
import { useAccountQuery } from '../../../../client/hooks/useAccountQuery.js';
|
|
9
|
+
import { useCreateInstapayWithdrawalMutation } from '../../../../client/hooks/useCreateInstapayWithdrawalMutation.js';
|
|
10
|
+
import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
|
|
11
|
+
import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
|
|
12
|
+
import { useWalletQuery } from '../../../../client/hooks/useWalletQuery.js';
|
|
13
|
+
import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
|
|
14
|
+
import { EyeIcon } from '../../../../icons/EyeIcon.js';
|
|
15
|
+
import { EyeOffIcon } from '../../../../icons/EyeOffIcon.js';
|
|
16
|
+
import { SpinnerIcon } from '../../../../icons/SpinnerIcon.js';
|
|
17
|
+
import { XIcon } from '../../../../icons/XIcon.js';
|
|
18
|
+
import { AlertDialog } from '../../../../ui/AlertDialog/index.js';
|
|
19
|
+
import { Button } from '../../../../ui/Button/index.js';
|
|
20
|
+
import { Field } from '../../../../ui/Field/index.js';
|
|
21
|
+
import { PasswordInput } from '../../../../ui/PasswordInput/index.js';
|
|
22
|
+
import { Portal } from '../../../../ui/Portal/index.js';
|
|
23
|
+
import { parseDecimal } from '../../../../utils/parseDecimal.js';
|
|
24
|
+
import { AmountChoices } from '../../AmountChoices.js';
|
|
25
|
+
import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
|
|
26
|
+
import { explainError } from '../../utils.js';
|
|
27
|
+
import { ActiveTurnoverRequirement } from '../ActiveTurnoverRequirement.js';
|
|
28
|
+
import { RequireFirstDeposit } from '../RequireFirstDeposit.js';
|
|
29
|
+
import { TransactionPasswordNotSet } from '../TransactionPasswordNotSet.js';
|
|
30
|
+
export function InstapayPaymayaWithdrawal() {
|
|
31
|
+
const depositWithdrawalProps = useDepositWithdrawalPropsContext();
|
|
32
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
33
|
+
depositWithdrawal: ctx.depositWithdrawal,
|
|
34
|
+
hasPendingBonus: ctx.pendingBonus,
|
|
35
|
+
})));
|
|
36
|
+
const [status, setStatus] = useState('waiting');
|
|
37
|
+
const createWithdrawalMutation = useCreateInstapayWithdrawalMutation({
|
|
38
|
+
onMutate() {
|
|
39
|
+
setStatus('processing');
|
|
40
|
+
},
|
|
41
|
+
onSuccess() {
|
|
42
|
+
form.reset();
|
|
43
|
+
setStatus('success');
|
|
44
|
+
},
|
|
45
|
+
onError() {
|
|
46
|
+
setStatus('failed');
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
const accountQuery = useAccountQuery();
|
|
50
|
+
const walletQuery = useWalletQuery();
|
|
51
|
+
const turnoverRequirement = parseDecimal(walletQuery.data?.turnoverRequirement, 0);
|
|
52
|
+
const paymentSettingsQuery = usePaymentSettingsQuery();
|
|
53
|
+
const paymentSettings = paymentSettingsQuery.data;
|
|
54
|
+
const gatewaySettings = paymentSettings?.instapayWithdrawalGatewaySettings;
|
|
55
|
+
const minimumAmount = parseDecimal(gatewaySettings?.minimumAmount, 0);
|
|
56
|
+
const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
|
|
57
|
+
const definition = z.object({
|
|
58
|
+
amount: z.string().superRefine((val, ctx) => {
|
|
59
|
+
const n = parseDecimal(val, 0);
|
|
60
|
+
if (val.includes('.')) {
|
|
61
|
+
ctx.addIssue({
|
|
62
|
+
code: z.ZodIssueCode.custom,
|
|
63
|
+
message: 'Amount must be a whole number',
|
|
64
|
+
});
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (n < minimumAmount) {
|
|
68
|
+
ctx.addIssue({
|
|
69
|
+
type: 'number',
|
|
70
|
+
code: z.ZodIssueCode.too_small,
|
|
71
|
+
inclusive: true,
|
|
72
|
+
minimum: minimumAmount,
|
|
73
|
+
message: `Please enter ${minimumAmount.toLocaleString()} or more to proceed with your deposit.`,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
if (n > maximumAmount) {
|
|
77
|
+
ctx.addIssue({
|
|
78
|
+
type: 'number',
|
|
79
|
+
code: z.ZodIssueCode.too_big,
|
|
80
|
+
inclusive: true,
|
|
81
|
+
maximum: maximumAmount,
|
|
82
|
+
message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}),
|
|
86
|
+
password: z
|
|
87
|
+
.string()
|
|
88
|
+
.min(8, 'Password must be 8 or more characters')
|
|
89
|
+
.max(64, 'Password must be not be more than 64 characters'),
|
|
90
|
+
accountNumber: z.string().min(1).trim(),
|
|
91
|
+
accountName: z
|
|
92
|
+
.string({ required_error: 'Account name is required' })
|
|
93
|
+
.min(4, 'Account name must be at least 4 characters'),
|
|
94
|
+
});
|
|
95
|
+
const form = useForm({
|
|
96
|
+
mode: 'all',
|
|
97
|
+
resolver: zodResolver(definition),
|
|
98
|
+
defaultValues: {
|
|
99
|
+
amount: '0',
|
|
100
|
+
password: '',
|
|
101
|
+
accountNumber: '',
|
|
102
|
+
accountName: accountQuery.data?.realName ?? '',
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
if (minimumAmount) {
|
|
107
|
+
form.reset({
|
|
108
|
+
amount: minimumAmount.toString(),
|
|
109
|
+
password: '',
|
|
110
|
+
accountNumber: '',
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}, [form, minimumAmount]);
|
|
114
|
+
const handleSubmit = form.handleSubmit(async (data) => {
|
|
115
|
+
if (globalStore.hasPendingBonus.shouldShowWarning) {
|
|
116
|
+
globalStore.hasPendingBonus.setOpen(true);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
createWithdrawalMutation.mutate({
|
|
120
|
+
amount: data.amount,
|
|
121
|
+
transactionPassword: data.password,
|
|
122
|
+
accountNumber: data.accountNumber,
|
|
123
|
+
accountName: data.accountName,
|
|
124
|
+
bankCode: "BNKMYA",
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
return (_jsxs("form", { onSubmit: handleSubmit, noValidate: true, autoComplete: "off", id: "hook-form", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.accountNumber, children: [_jsx(Field.Label, { children: "Phone Number" }), _jsx(Field.Input, { ...form.register('accountNumber') }), _jsx(Field.ErrorText, { children: form.formState.errors.accountNumber?.message })] }), _jsxs(Field.Root, { invalid: !!form.formState.errors.accountName, className: "mt-3xl", children: [_jsx(Field.Label, { children: "Account name" }), _jsx(Field.Input, { ...form.register('accountName') }), _jsx(Field.ErrorText, { children: form.formState.errors.accountName?.message })] }), _jsxs(Field.Root, { invalid: !!form.formState.errors.amount, className: "mt-3xl", children: [_jsx(Field.Label, { children: "Enter amount you want to withdraw" }), _jsx(Field.Input, { type: "number", ...form.register('amount') }), _jsx(Field.ErrorText, { children: form.formState.errors.amount?.message })] }), _jsx(AmountChoices, { value: parseDecimal(form.watch('amount').trim().replace(/,/g, ''), 0), onChange: (value) => {
|
|
128
|
+
form.setValue('amount', value.toString(), {
|
|
129
|
+
shouldTouch: true,
|
|
130
|
+
shouldDirty: true,
|
|
131
|
+
shouldValidate: true,
|
|
132
|
+
});
|
|
133
|
+
}, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Transaction Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter password", ...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 })] }), _jsx(TransactionPasswordNotSet, {}), _jsx(ActiveTurnoverRequirement, {}), _jsx(RequireFirstDeposit, {}), _jsx(Button, { type: "submit", className: "mt-6", disabled: createWithdrawalMutation.isPending || turnoverRequirement > 0, children: "Withdraw" }), depositWithdrawalProps.hasPrivacyPolicyAndTermsOfUse && (_jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["Upon withdrawing, 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: status !== 'waiting', onOpenChange: (details) => {
|
|
134
|
+
if (!details.open) {
|
|
135
|
+
setStatus('waiting');
|
|
136
|
+
}
|
|
137
|
+
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { disabled: status === 'processing', children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "size-12 text-text-brand-primary-600" })), status === 'success' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-success-secondary text-text-featured-icon-light-success", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-error-secondary text-text-featured-icon-light-error", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Withdraw', status === 'success' && 'Withdrawal Submitted', status === 'failed' && 'Withdraw Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
|
|
138
|
+
"We're verifying your account and amount. Please hold a moment.", status === 'success' &&
|
|
139
|
+
'Your withdrawal request has been submitted successfully and is awaiting confirmation. You won’t have to wait long — once approved, the funds will be credited to your account.', status === 'failed' &&
|
|
140
|
+
explainError(createWithdrawalMutation.error?.name)] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
|
|
141
|
+
api.setOpen(false);
|
|
142
|
+
}, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
|
|
143
|
+
}
|
package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js
CHANGED
|
@@ -41,7 +41,8 @@ const sortBanksWithPriority = (banks) => {
|
|
|
41
41
|
const bIndex = priorityBankCodes.indexOf(b.code);
|
|
42
42
|
return aIndex - bIndex;
|
|
43
43
|
});
|
|
44
|
-
|
|
44
|
+
const sortedOtherBanks = otherBanks.sort((a, b) => a.name.localeCompare(b.name));
|
|
45
|
+
return [...sortedPriorityBanks, ...sortedOtherBanks];
|
|
45
46
|
};
|
|
46
47
|
export function InstapayWithdrawal() {
|
|
47
48
|
const depositWithdrawalProps = useDepositWithdrawalPropsContext();
|
|
@@ -17,6 +17,8 @@ import { useDepositWithdrawalPropsContext } from '../DepositWithdrawalContext.js
|
|
|
17
17
|
import { PaymentMethods } from '../PaymentMethods.js';
|
|
18
18
|
import { GCashStandardCashInWithdrawal } from './GCashStandardCashInWithdrawal/GCashStandardCashInWithdrawal.js';
|
|
19
19
|
import { GCashWithdrawal } from './GCashWithdrawal/GCashWithdrawal.js';
|
|
20
|
+
import { InstapayGCashWithdrawal } from './InstapayGCashWithdrawal/InstapayGcashWithdrawal.js';
|
|
21
|
+
import { InstapayPaymayaWithdrawal } from './InstapayPaymayaWithdrawal/InstapayPaymayaWithdrawal.js';
|
|
20
22
|
import { InstapayWithdrawal } from './InstapayWithdrawal/InstapayWithdrawal.js';
|
|
21
23
|
import { MayaAppWithdrawal } from './MayaAppWithdrawal/MayaAppWithdrawal.js';
|
|
22
24
|
import { MayaWithdrawal } from './MayaWithdrawal/MayaWithdrawal.js';
|
|
@@ -48,6 +50,16 @@ export function Withdrawal() {
|
|
|
48
50
|
condition: () => paymentSettings?.gcashWithdrawalGatewaySettings?.[enabledKey] ||
|
|
49
51
|
false,
|
|
50
52
|
},
|
|
53
|
+
{
|
|
54
|
+
method: 'INSTAPAY_GCASH',
|
|
55
|
+
condition: () => paymentSettings?.instapayWithdrawalGatewaySettings?.[enabledKey] ||
|
|
56
|
+
false,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
method: 'INSTAPAY_PAYMAYA',
|
|
60
|
+
condition: () => paymentSettings?.instapayWithdrawalGatewaySettings?.[enabledKey] ||
|
|
61
|
+
false,
|
|
62
|
+
},
|
|
51
63
|
{
|
|
52
64
|
method: 'MAYA',
|
|
53
65
|
condition: () => paymentSettings?.mayaWithdrawalGatewaySettings?.[enabledKey] || false,
|
|
@@ -108,7 +120,7 @@ export function Withdrawal() {
|
|
|
108
120
|
if (enabledPaymentMethods.length <= 0) {
|
|
109
121
|
return _jsx(NoAvailablePaymentMethods, {});
|
|
110
122
|
}
|
|
111
|
-
return (_jsxs(_Fragment, { children: [_jsx(PaymentMethods, { value: paymentMethod, onChange: setPaymentMethod, options: enabledPaymentMethods }), paymentMethod === 'GCASH' && _jsx(GCashWithdrawal, {}), paymentMethod === 'MAYA' && _jsx(MayaWithdrawal, {}), paymentMethod === 'MAYA_APP' && _jsx(MayaAppWithdrawal, {}), paymentMethod === 'INSTAPAY' && _jsx(InstapayWithdrawal, {}), paymentMethod === 'VENTAJA_DISBURSEMENT' && _jsx(VentajaWithdrawal, {}), paymentMethod === 'PISO_PAY' && _jsx(PisoPayWithdrawal, {}), paymentMethod === 'GCASH_STANDARD_CASH_IN' && (_jsx(GCashStandardCashInWithdrawal, {}))] }));
|
|
123
|
+
return (_jsxs(_Fragment, { children: [_jsx(PaymentMethods, { value: paymentMethod, onChange: setPaymentMethod, options: enabledPaymentMethods }), paymentMethod === 'GCASH' && _jsx(GCashWithdrawal, {}), paymentMethod === 'MAYA' && _jsx(MayaWithdrawal, {}), paymentMethod === 'MAYA_APP' && _jsx(MayaAppWithdrawal, {}), paymentMethod === 'INSTAPAY' && _jsx(InstapayWithdrawal, {}), paymentMethod === 'INSTAPAY_GCASH' && _jsx(InstapayGCashWithdrawal, {}), paymentMethod === 'INSTAPAY_PAYMAYA' && _jsx(InstapayPaymayaWithdrawal, {}), paymentMethod === 'VENTAJA_DISBURSEMENT' && _jsx(VentajaWithdrawal, {}), paymentMethod === 'PISO_PAY' && _jsx(PisoPayWithdrawal, {}), paymentMethod === 'GCASH_STANDARD_CASH_IN' && (_jsx(GCashStandardCashInWithdrawal, {}))] }));
|
|
112
124
|
}
|
|
113
125
|
function AccountVerificationRequired() {
|
|
114
126
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { KnownDepositError, KnownWithdrawalError, WithdrawalError } from '../../types';
|
|
3
|
-
export declare const PaymentMethodDefinition: z.ZodEnum<["GCASH", "GCASH_STANDARD_CASH_IN", "MAYA_APP", "MAYA", "ONLINE_BANK", "QRPH", "INSTAPAY", "LIBANGAN_PAY_IN", "VENTAJA_DISBURSEMENT", "PISO_PAY", "AIO_GCASH", "AIO_PAY_MAYA", "AIO_GRAB_PAY", "AIO_PALAWAN_PAY", "GCASH_WEBPAY", "MAYA_WEBPAY"]>;
|
|
3
|
+
export declare const PaymentMethodDefinition: z.ZodEnum<["GCASH", "GCASH_STANDARD_CASH_IN", "MAYA_APP", "MAYA", "ONLINE_BANK", "QRPH", "INSTAPAY", "LIBANGAN_PAY_IN", "VENTAJA_DISBURSEMENT", "PISO_PAY", "AIO_GCASH", "AIO_PAY_MAYA", "AIO_GRAB_PAY", "AIO_PALAWAN_PAY", "GCASH_WEBPAY", "MAYA_WEBPAY", "INSTAPAY_GCASH", "INSTAPAY_PAYMAYA"]>;
|
|
4
4
|
export type PaymentMethod = z.infer<typeof PaymentMethodDefinition>;
|
|
5
5
|
export type DepositWithdrawalErrors = KnownDepositError | KnownWithdrawalError | WithdrawalError | string;
|
|
6
6
|
export declare function explainError(error?: DepositWithdrawalErrors): string;
|
|
@@ -16,6 +16,8 @@ export const PaymentMethodDefinition = z.enum([
|
|
|
16
16
|
'AIO_PALAWAN_PAY',
|
|
17
17
|
'GCASH_WEBPAY',
|
|
18
18
|
'MAYA_WEBPAY',
|
|
19
|
+
'INSTAPAY_GCASH',
|
|
20
|
+
'INSTAPAY_PAYMAYA',
|
|
19
21
|
]);
|
|
20
22
|
const errorMap = {
|
|
21
23
|
DAILY_PURCHASE_OR_DEPOSIT_LIMIT_EXCEEDED: 'You have exceeded your daily purchase or deposit limit. Please try again tomorrow.',
|
|
@@ -43,6 +45,7 @@ const errorMap = {
|
|
|
43
45
|
WithdrawalDailyLimitExceededError: 'You have exceeded your daily withdrawal limit. Please try again tomorrow.',
|
|
44
46
|
MinimumFirstDepositAmountNotMetError: 'The minimum first deposit amount is not met. Please enter a valid amount.',
|
|
45
47
|
FirstDepositRequiredError: 'First deposit is required before making a withdrawal.',
|
|
48
|
+
SYSTEM_ERROR: 'A system error occurred. Please try again.',
|
|
46
49
|
};
|
|
47
50
|
export function explainError(error) {
|
|
48
51
|
if (error && errorMap[error]) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
export function Loading() {
|
|
4
|
-
return (_jsx("div", { className: "flex h-[calc(100vh-400px)] w-full items-center justify-center px-4", children: _jsxs("div", { className: "flex flex-col items-center space-y-4", children: [_jsx("div", { className: "h-10 w-10 animate-spin rounded-full border-4 border-
|
|
4
|
+
return (_jsx("div", { className: "flex h-[calc(100vh-400px)] w-full items-center justify-center px-4", children: _jsxs("div", { className: "flex flex-col items-center space-y-4", children: [_jsx("div", { className: "border-blue-500 h-10 w-10 animate-spin rounded-full border-4 border-t-transparent" }), _jsx("p", { className: "text-gray-700 text-lg font-medium", children: "Loading Sports Book\u2026" })] }) }));
|
|
5
5
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ImageProps } from 'next/image';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export interface ResponsibleGamingProps {
|
|
4
|
+
responsibleGamingContent: string | ReactNode;
|
|
5
|
+
logo: ImageProps['src'];
|
|
6
|
+
open: boolean;
|
|
7
|
+
onCloseAction: () => void;
|
|
8
|
+
responsibleGamingLogo?: ImageProps['src'];
|
|
9
|
+
}
|
|
10
|
+
export declare function ResponsibleGaming({ logo, open, responsibleGamingContent, onCloseAction, ...props }: ResponsibleGamingProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Image, {} from 'next/image';
|
|
4
|
+
import pagcorLogo from '../../images/pagcor.png';
|
|
5
|
+
import responsibleGamingLogo from '../../images/responsible-gaming.png';
|
|
6
|
+
import { Button } from '../../ui/Button/index.js';
|
|
7
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
8
|
+
import { Portal } from '../../ui/Portal/index.js';
|
|
9
|
+
export function ResponsibleGaming({ logo, open, responsibleGamingContent, onCloseAction, ...props }) {
|
|
10
|
+
return (_jsx(Dialog.Root, { open: open, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "z-popover" }), _jsx(Dialog.Positioner, { className: "z-popover", children: _jsxs(Dialog.Content, { className: "flex h-full w-full flex-col items-start overflow-y-auto p-3xl lg:mx-auto lg:h-auto lg:w-[400px] lg:rounded-xl", children: [_jsx(Image, { src: logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsxs("div", { className: "w-full grow", children: [_jsx(Dialog.Title, { className: "text-brand-400 mt-3xl text-center text-lg font-semibold", children: "Responsible Gaming" }), _jsx(Dialog.Description, { className: "leading-2xl mt-xs text-sm", children: responsibleGamingContent }), _jsxs("div", { className: "mt-5 flex items-center justify-center gap-3xl", children: [_jsx(Image, { src: pagcorLogo, alt: "", height: 75, width: 88, className: "h-[88px] w-auto shrink-0", draggable: false }), _jsx(Image, { src: props.responsibleGamingLogo ?? responsibleGamingLogo, alt: "", height: 62, width: 186, className: "h-[62px] w-auto shrink-0", draggable: false })] })] }), _jsx("div", { className: "w-full", children: _jsx(Button, { type: "button", className: "mt-3", onClick: () => {
|
|
11
|
+
onCloseAction();
|
|
12
|
+
}, children: "I Agree" }) })] }) })] }) }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ImageProps } from 'next/image';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export interface TermsOfUseProps {
|
|
4
|
+
logo: ImageProps['src'];
|
|
5
|
+
open: boolean;
|
|
6
|
+
onCloseAction: () => void;
|
|
7
|
+
termsOfUseContent: string | ReactNode;
|
|
8
|
+
siteName: string;
|
|
9
|
+
responsibleGamingLogo?: ImageProps['src'];
|
|
10
|
+
}
|
|
11
|
+
export declare function TermsOfUse({ logo, open, onCloseAction, siteName, termsOfUseContent, ...props }: TermsOfUseProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Image, {} from 'next/image';
|
|
4
|
+
import pagcorLogo from '../../images/pagcor.png';
|
|
5
|
+
import responsibleGamingLogo from '../../images/responsible-gaming.png';
|
|
6
|
+
import { Button } from '../../ui/Button/index.js';
|
|
7
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
8
|
+
import { Portal } from '../../ui/Portal/index.js';
|
|
9
|
+
export function TermsOfUse({ logo, open, onCloseAction, siteName, termsOfUseContent, ...props }) {
|
|
10
|
+
return (_jsx(Dialog.Root, { open: open, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "z-popover" }), _jsx(Dialog.Positioner, { className: "z-popover", children: _jsxs(Dialog.Content, { className: "flex h-full w-full flex-col items-start overflow-y-auto p-3xl lg:mx-auto lg:h-auto lg:w-[400px] lg:rounded-xl", children: [_jsx(Image, { src: logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsxs("div", { className: "w-full grow", children: [_jsxs(Dialog.Title, { className: "text-brand-400 mt-3xl text-center text-lg font-semibold", children: [siteName, " Terms of Use"] }), _jsx(Dialog.Description, { className: "leading-2xl mt-xs text-sm", children: termsOfUseContent }), _jsxs("div", { className: "mt-5 flex items-center justify-center gap-3xl", children: [_jsx(Image, { src: pagcorLogo, alt: "", height: 75, width: 88, className: "h-[88px] w-auto shrink-0", draggable: false }), _jsx(Image, { src: props.responsibleGamingLogo ?? responsibleGamingLogo, alt: "", height: 62, width: 186, className: "h-[62px] w-auto shrink-0", draggable: false })] })] }), _jsx("div", { className: "w-full", children: _jsx(Button, { type: "button", className: "mt-3", onClick: () => {
|
|
11
|
+
onCloseAction();
|
|
12
|
+
}, children: "I Agree" }) })] }) })] }) }));
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function FeatureFlag(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useRouter, useSearchParams } from 'next/navigation';
|
|
4
|
+
import { useEffect } from 'react';
|
|
5
|
+
import { FEATURE_FLAG_KEY, useFeatureFlag, } from '../../client/hooks/useFeatureFlag.js';
|
|
6
|
+
export function FeatureFlag() {
|
|
7
|
+
const { featureFlagEnabled, setFeatureFlagEnabled } = useFeatureFlag();
|
|
8
|
+
const searchParams = useSearchParams();
|
|
9
|
+
const router = useRouter();
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const futureFlagParam = searchParams.get('future');
|
|
12
|
+
if (futureFlagParam !== null) {
|
|
13
|
+
const isEnabled = futureFlagParam === 'true';
|
|
14
|
+
setFeatureFlagEnabled(isEnabled);
|
|
15
|
+
localStorage.setItem(FEATURE_FLAG_KEY, isEnabled.toString());
|
|
16
|
+
}
|
|
17
|
+
}, [searchParams, setFeatureFlagEnabled]);
|
|
18
|
+
function disableFeatureFlag() {
|
|
19
|
+
setFeatureFlagEnabled(false);
|
|
20
|
+
localStorage.removeItem(FEATURE_FLAG_KEY);
|
|
21
|
+
const params = new URLSearchParams(searchParams.toString());
|
|
22
|
+
params.delete('future');
|
|
23
|
+
router.replace(`?${params.toString()}`, { scroll: false });
|
|
24
|
+
}
|
|
25
|
+
if (!featureFlagEnabled) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return (_jsx("div", { className: "fixed bottom-3 flex w-full flex-col items-center justify-center", children: _jsxs("div", { className: "bg-black/70 p-1", children: ["Experimental features are enabled.", ' ', _jsxs("button", { onClick: () => disableFeatureFlag(), className: "cursor-pointer underline", children: [' ', "Disable"] })] }) }));
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FeatureFlag';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FeatureFlag.js';
|