@opexa/portal-components 0.0.601 → 0.0.603
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/useAvailableQuestsQuery.js +0 -1
- package/dist/client/hooks/useGlobalStore.d.ts +1 -0
- package/dist/client/hooks/useGlobalStore.js +13 -0
- package/dist/client/hooks/useJackpotPayoutsQuery.js +0 -1
- package/dist/client/hooks/useJackpotsQuery.js +0 -1
- package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +21 -5
- package/dist/components/DepositWithdrawal/Deposit/LibanganDeposit/LibanganDeposit.js +22 -6
- package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.js +20 -4
- package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +21 -5
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.js +26 -4
- package/dist/components/DepositWithdrawal/Deposit/PisoPayDeposit/PisoPayDeposit.js +29 -13
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.js +26 -4
- package/dist/components/DigitainLauncher/Loading.d.ts +1 -0
- package/dist/components/DigitainLauncher/Loading.js +5 -0
- 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/GameLaunch/GameLaunchTrigger.js +15 -8
- package/dist/components/Jackpots/Jackpots.module.css +184 -184
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.js +7 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.js +1 -0
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsList/JackpotsList.js +7 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.js +1 -1
- package/dist/components/KYC/AutoOpen.d.ts +1 -0
- package/dist/components/KYC/AutoOpen.js +40 -0
- package/dist/components/KYC/BasicInformation.d.ts +1 -0
- package/dist/components/KYC/BasicInformation.js +101 -0
- 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.d.ts +1 -0
- package/dist/components/KYC/IdentityVerification.js +120 -0
- package/dist/components/KYC/Indicator.d.ts +1 -0
- package/dist/components/KYC/Indicator.js +8 -0
- package/dist/components/KYC/KYC.lazy.d.ts +6 -0
- package/dist/components/KYC/KYC.lazy.js +45 -0
- package/dist/components/KYC/KYCContext.d.ts +6 -0
- package/dist/components/KYC/KYCContext.js +2 -0
- package/dist/components/KYC/KYCDefault/KYCVerificationStatus.d.ts +1 -0
- package/dist/components/KYC/KYCDefault/KYCVerificationStatus.js +10 -0
- package/dist/components/KYC/KYCDefault/KYCVerificationStatus.lazy.d.ts +1 -0
- package/dist/components/KYC/KYCDefault/KYCVerificationStatus.lazy.js +33 -0
- 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.d.ts +1 -0
- package/dist/components/KYC/PersonalInformation.js +122 -0
- 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/useKYC.d.ts +25 -0
- package/dist/components/KYC/useKYC.js +38 -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.d.ts +1 -0
- package/dist/components/PortalProvider/CXDTokenObserver.js +30 -0
- package/dist/components/Quests/CountdownTimer.d.ts +15 -0
- package/dist/components/Quests/CountdownTimer.js +33 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +4 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +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/SignIn/utils.d.ts +8 -0
- package/dist/components/SignIn/utils.js +26 -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/constants/Branches.d.ts +2 -0
- package/dist/constants/Branches.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/images/kyc-verification-status/alert-icon.png +0 -0
- package/dist/images/kyc-verification-status/bell-icon.png +0 -0
- package/dist/images/responsible-gaming-yellow.png +0 -0
- package/dist/services/queries.d.ts +1 -1
- package/dist/services/queries.js +2758 -2757
- package/dist/styles/theme.css +762 -762
- package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +4 -0
- package/dist/third-parties/FacebookPixel/FacebookPixel.js +4 -0
- package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
- package/dist/third-parties/FacebookPixel/api.js +1 -0
- package/dist/third-parties/FacebookPixel/index.d.ts +1 -0
- package/dist/third-parties/FacebookPixel/index.js +1 -0
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +4 -0
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +4 -0
- package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
- package/dist/third-parties/GoogleRecaptcha/api.js +1 -0
- package/dist/third-parties/GoogleRecaptcha/index.d.ts +1 -0
- package/dist/third-parties/GoogleRecaptcha/index.js +1 -0
- package/dist/third-parties/index.d.ts +2 -0
- package/dist/third-parties/index.js +2 -0
- 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 +99 -99
- package/dist/ui/Carousel/carousel.recipe.d.ts +11 -11
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.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/Menu/Menu.d.ts +252 -252
- package/dist/ui/Menu/menu.recipe.d.ts +14 -14
- 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/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/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.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 +163 -163
|
@@ -14,7 +14,6 @@ export const useAvailableQuestsQuery = (config) => {
|
|
|
14
14
|
? false
|
|
15
15
|
: sessionQuery.data?.status === 'authenticated',
|
|
16
16
|
queryKey: getAvailableQuestsQueryKey(),
|
|
17
|
-
refetchInterval: 5000,
|
|
18
17
|
queryFn: async ({ signal }) => {
|
|
19
18
|
const session = await queryClient.fetchQuery({
|
|
20
19
|
queryKey: getSessionQueryKey(),
|
|
@@ -87,6 +87,7 @@ export interface GlobalStore {
|
|
|
87
87
|
onboarding: OnboardingStore;
|
|
88
88
|
responsibleGamingReminder: ResponsibleGamingReminderStore;
|
|
89
89
|
pendingBonus: HasPendingBonusStore;
|
|
90
|
+
kycVerificationStatus: PopupStore;
|
|
90
91
|
}
|
|
91
92
|
export declare const useGlobalStore: import("zustand").UseBoundStore<Omit<Omit<import("zustand").StoreApi<GlobalStore>, "setState" | "devtools"> & {
|
|
92
93
|
setState(partial: GlobalStore | Partial<GlobalStore> | ((state: GlobalStore) => GlobalStore | Partial<GlobalStore>), replace?: false | undefined, action?: (string | {
|
|
@@ -27,6 +27,19 @@ export const useGlobalStore = create()(devtools(subscribeWithSelector((set) => (
|
|
|
27
27
|
},
|
|
28
28
|
'~touched': false,
|
|
29
29
|
},
|
|
30
|
+
kycVerificationStatus: {
|
|
31
|
+
open: false,
|
|
32
|
+
setOpen(open) {
|
|
33
|
+
set((prev) => ({
|
|
34
|
+
kycVerificationStatus: {
|
|
35
|
+
...prev.kycVerificationStatus,
|
|
36
|
+
open,
|
|
37
|
+
'~touched': true,
|
|
38
|
+
},
|
|
39
|
+
}));
|
|
40
|
+
},
|
|
41
|
+
'~touched': false,
|
|
42
|
+
},
|
|
30
43
|
disclaimer: {
|
|
31
44
|
open: false,
|
|
32
45
|
setOpen(open) {
|
|
@@ -6,7 +6,6 @@ export const useJackpotPayoutsQuery = (input, config) => {
|
|
|
6
6
|
refetchOnMount: false,
|
|
7
7
|
refetchOnReconnect: false,
|
|
8
8
|
refetchOnWindowFocus: false,
|
|
9
|
-
refetchInterval: 10000, // 10 seconds
|
|
10
9
|
...config,
|
|
11
10
|
queryKey: getJackpotPayoutsQueryKey(input),
|
|
12
11
|
queryFn: ({ pageParam, signal }) => {
|
|
@@ -6,7 +6,6 @@ export const useJackpotsQuery = (input, config) => {
|
|
|
6
6
|
refetchOnMount: false,
|
|
7
7
|
refetchOnReconnect: false,
|
|
8
8
|
refetchOnWindowFocus: false,
|
|
9
|
-
refetchInterval: 10000, // 10 seconds
|
|
10
9
|
...config,
|
|
11
10
|
queryKey: getJackpotsQueryKey(input),
|
|
12
11
|
queryFn: ({ pageParam, signal }) => {
|
|
@@ -11,7 +11,9 @@ import { useCreateGCashDepositMutation } from '../../../../client/hooks/useCreat
|
|
|
11
11
|
import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
|
|
12
12
|
import { useDepositsCountQuery } from '../../../../client/hooks/useDepositsCountQuery.js';
|
|
13
13
|
import { useDisclosure } from '../../../../client/hooks/useDisclosure.js';
|
|
14
|
+
import { useFeatureFlag } from '../../../../client/hooks/useFeatureFlag.js';
|
|
14
15
|
import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
|
|
16
|
+
import { useMemberVerificationQuery } from '../../../../client/hooks/useMemberVerificationQuery.js';
|
|
15
17
|
import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
|
|
16
18
|
import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
|
|
17
19
|
import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
|
|
@@ -28,11 +30,15 @@ import { AmountChoices } from '../../AmountChoices.js';
|
|
|
28
30
|
import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
|
|
29
31
|
import { AvailablePromos } from '../AvailablePromos.js';
|
|
30
32
|
export function GCashDeposit() {
|
|
33
|
+
const { enabled } = useFeatureFlag();
|
|
31
34
|
const depositWithdrawalProps = useDepositWithdrawalPropsContext();
|
|
32
35
|
const disclosure = useDisclosure();
|
|
33
36
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
34
37
|
depositWithdrawal: ctx.depositWithdrawal,
|
|
38
|
+
kycVerificationStatus: ctx.kycVerificationStatus,
|
|
35
39
|
})));
|
|
40
|
+
const verificationQuery = useMemberVerificationQuery();
|
|
41
|
+
const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
|
|
36
42
|
const [status, setStatus] = useState('waiting');
|
|
37
43
|
const createDepositMutation = useCreateGCashDepositMutation({
|
|
38
44
|
onMutate() {
|
|
@@ -145,11 +151,21 @@ export function GCashDeposit() {
|
|
|
145
151
|
}
|
|
146
152
|
}, [form, minimumAmount]);
|
|
147
153
|
return (_jsxs("form", { onSubmit: form.handleSubmit(async (data) => {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
154
|
+
//handle new kyc process
|
|
155
|
+
if (enabled &&
|
|
156
|
+
(verificationStatus === 'PENDING' ||
|
|
157
|
+
verificationStatus === 'UNVERIFIED' ||
|
|
158
|
+
verificationStatus === 'REJECTED')) {
|
|
159
|
+
globalStore.kycVerificationStatus.setOpen(true);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
createDepositMutation.reset();
|
|
164
|
+
createDepositMutation.mutate({
|
|
165
|
+
amount: data.amount.toString(),
|
|
166
|
+
promo: data.promo ?? undefined,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
153
169
|
}), 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
170
|
o.field.onChange(details.value);
|
|
155
171
|
}, formatOptions: {
|
|
@@ -11,7 +11,9 @@ import { useCreateLibanganDepositMutation } from '../../../../client/hooks/useCr
|
|
|
11
11
|
import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
|
|
12
12
|
import { useDepositsCountQuery } from '../../../../client/hooks/useDepositsCountQuery.js';
|
|
13
13
|
import { useDisclosure } from '../../../../client/hooks/useDisclosure.js';
|
|
14
|
+
import { useFeatureFlag } from '../../../../client/hooks/useFeatureFlag.js';
|
|
14
15
|
import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
|
|
16
|
+
import { useMemberVerificationQuery } from '../../../../client/hooks/useMemberVerificationQuery.js';
|
|
15
17
|
import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
|
|
16
18
|
import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
|
|
17
19
|
import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
|
|
@@ -28,11 +30,15 @@ import { AmountChoices } from '../../AmountChoices.js';
|
|
|
28
30
|
import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
|
|
29
31
|
import { AvailablePromos } from '../AvailablePromos.js';
|
|
30
32
|
export function LibanganDeposit() {
|
|
33
|
+
const { enabled } = useFeatureFlag();
|
|
31
34
|
const depositWithdrawalProps = useDepositWithdrawalPropsContext();
|
|
32
35
|
const disclosure = useDisclosure();
|
|
33
36
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
34
37
|
depositWithdrawal: ctx.depositWithdrawal,
|
|
38
|
+
kycVerificationStatus: ctx.kycVerificationStatus,
|
|
35
39
|
})));
|
|
40
|
+
const verificationQuery = useMemberVerificationQuery();
|
|
41
|
+
const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
|
|
36
42
|
const [status, setStatus] = useState('waiting');
|
|
37
43
|
const createDepositMutation = useCreateLibanganDepositMutation({
|
|
38
44
|
onMutate() {
|
|
@@ -145,12 +151,22 @@ export function LibanganDeposit() {
|
|
|
145
151
|
}
|
|
146
152
|
}, [form, minimumAmount]);
|
|
147
153
|
return (_jsxs("form", { onSubmit: form.handleSubmit(async (data) => {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
+
//handle new kyc process
|
|
155
|
+
if (enabled &&
|
|
156
|
+
(verificationStatus === 'PENDING' ||
|
|
157
|
+
verificationStatus === 'UNVERIFIED' ||
|
|
158
|
+
verificationStatus === 'REJECTED')) {
|
|
159
|
+
globalStore.kycVerificationStatus.setOpen(true);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
createDepositMutation.reset();
|
|
164
|
+
createDepositMutation.mutate({
|
|
165
|
+
amount: data.amount.toString(),
|
|
166
|
+
promo: data.promo ?? undefined,
|
|
167
|
+
redirectUrl: depositWithdrawalProps.libanganRedirectionUrl,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
154
170
|
}), 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) => {
|
|
155
171
|
o.field.onChange(details.value);
|
|
156
172
|
}, formatOptions: {
|
|
@@ -8,7 +8,9 @@ import { useShallow } from 'zustand/shallow';
|
|
|
8
8
|
import { useAvailablePromosQuery } from '../../../../client/hooks/useAvailablePromosQuery.js';
|
|
9
9
|
import { useCreateMayaAppDepositMutation } from '../../../../client/hooks/useCreateMayaAppDepositMutation.js';
|
|
10
10
|
import { useDepositsCountQuery } from '../../../../client/hooks/useDepositsCountQuery.js';
|
|
11
|
+
import { useFeatureFlag } from '../../../../client/hooks/useFeatureFlag.js';
|
|
11
12
|
import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
|
|
13
|
+
import { useMemberVerificationQuery } from '../../../../client/hooks/useMemberVerificationQuery.js';
|
|
12
14
|
import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
|
|
13
15
|
import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
|
|
14
16
|
import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
|
|
@@ -25,10 +27,14 @@ import { AmountChoices } from '../../AmountChoices.js';
|
|
|
25
27
|
import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
|
|
26
28
|
import { AvailablePromos } from '../AvailablePromos.js';
|
|
27
29
|
export function MayaAppDeposit() {
|
|
30
|
+
const { enabled } = useFeatureFlag();
|
|
28
31
|
const depositWithdrawalProps = useDepositWithdrawalPropsContext();
|
|
29
32
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
30
33
|
depositWithdrawal: ctx.depositWithdrawal,
|
|
34
|
+
kycVerificationStatus: ctx.kycVerificationStatus,
|
|
31
35
|
})));
|
|
36
|
+
const verificationQuery = useMemberVerificationQuery();
|
|
37
|
+
const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
|
|
32
38
|
const [status, setStatus] = useState('waiting');
|
|
33
39
|
const createDepositMutation = useCreateMayaAppDepositMutation({
|
|
34
40
|
onMutate() {
|
|
@@ -115,10 +121,20 @@ export function MayaAppDeposit() {
|
|
|
115
121
|
}
|
|
116
122
|
}, [form, minimumAmount]);
|
|
117
123
|
const handleSubmit = form.handleSubmit(async (data) => {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
124
|
+
//handle new kyc process
|
|
125
|
+
if (enabled &&
|
|
126
|
+
(verificationStatus === 'PENDING' ||
|
|
127
|
+
verificationStatus === 'UNVERIFIED' ||
|
|
128
|
+
verificationStatus === 'REJECTED')) {
|
|
129
|
+
globalStore.kycVerificationStatus.setOpen(true);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
createDepositMutation.mutate({
|
|
134
|
+
amount: data.amount.toString(),
|
|
135
|
+
promo: data.promo ?? undefined,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
122
138
|
});
|
|
123
139
|
return (_jsxs("form", { onSubmit: handleSubmit, noValidate: true, children: [_jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
|
|
124
140
|
o.field.onChange(details.value);
|
|
@@ -11,7 +11,9 @@ import { useCreateMayaDepositMutation } from '../../../../client/hooks/useCreate
|
|
|
11
11
|
import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
|
|
12
12
|
import { useDepositsCountQuery } from '../../../../client/hooks/useDepositsCountQuery.js';
|
|
13
13
|
import { useDisclosure } from '../../../../client/hooks/useDisclosure.js';
|
|
14
|
+
import { useFeatureFlag } from '../../../../client/hooks/useFeatureFlag.js';
|
|
14
15
|
import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
|
|
16
|
+
import { useMemberVerificationQuery } from '../../../../client/hooks/useMemberVerificationQuery.js';
|
|
15
17
|
import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
|
|
16
18
|
import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
|
|
17
19
|
import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
|
|
@@ -28,11 +30,15 @@ import { AmountChoices } from '../../AmountChoices.js';
|
|
|
28
30
|
import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
|
|
29
31
|
import { AvailablePromos } from '../AvailablePromos.js';
|
|
30
32
|
export function MayaDeposit() {
|
|
33
|
+
const { enabled } = useFeatureFlag();
|
|
31
34
|
const depositWithdrawalProps = useDepositWithdrawalPropsContext();
|
|
32
35
|
const disclosure = useDisclosure();
|
|
33
36
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
34
37
|
depositWithdrawal: ctx.depositWithdrawal,
|
|
38
|
+
kycVerificationStatus: ctx.kycVerificationStatus,
|
|
35
39
|
})));
|
|
40
|
+
const verificationQuery = useMemberVerificationQuery();
|
|
41
|
+
const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
|
|
36
42
|
const [status, setStatus] = useState('waiting');
|
|
37
43
|
const createDepositMutation = useCreateMayaDepositMutation({
|
|
38
44
|
onMutate() {
|
|
@@ -145,11 +151,21 @@ export function MayaDeposit() {
|
|
|
145
151
|
}
|
|
146
152
|
}, [form, minimumAmount]);
|
|
147
153
|
return (_jsxs("form", { onSubmit: form.handleSubmit(async (data) => {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
154
|
+
//handle new kyc process
|
|
155
|
+
if (enabled &&
|
|
156
|
+
(verificationStatus === 'PENDING' ||
|
|
157
|
+
verificationStatus === 'UNVERIFIED' ||
|
|
158
|
+
verificationStatus === 'REJECTED')) {
|
|
159
|
+
globalStore.kycVerificationStatus.setOpen(true);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
createDepositMutation.reset();
|
|
164
|
+
createDepositMutation.mutate({
|
|
165
|
+
amount: data.amount.toString(),
|
|
166
|
+
promo: data.promo ?? undefined,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
153
169
|
}), 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
170
|
o.field.onChange(details.value);
|
|
155
171
|
}, formatOptions: {
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
|
+
import { useShallow } from 'zustand/shallow';
|
|
3
4
|
import { useCreateOnlineBankDepositMutation } from '../../../../client/hooks/useCreateOnlineBankDepositMutation.js';
|
|
4
5
|
import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
|
|
6
|
+
import { useFeatureFlag } from '../../../../client/hooks/useFeatureFlag.js';
|
|
7
|
+
import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
|
|
8
|
+
import { useMemberVerificationQuery } from '../../../../client/hooks/useMemberVerificationQuery.js';
|
|
5
9
|
export function useOnlineBankDeposit() {
|
|
10
|
+
const { enabled } = useFeatureFlag();
|
|
11
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
12
|
+
kycVerificationStatus: ctx.kycVerificationStatus,
|
|
13
|
+
})));
|
|
14
|
+
const verificationQuery = useMemberVerificationQuery();
|
|
15
|
+
const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
|
|
6
16
|
const [deposit, setDeposit] = useState(null);
|
|
7
17
|
const [status, setStatus] = useState('waiting');
|
|
8
18
|
const view = status === 'verification-failed' ||
|
|
@@ -24,10 +34,22 @@ export function useOnlineBankDeposit() {
|
|
|
24
34
|
setStatus('failed');
|
|
25
35
|
},
|
|
26
36
|
});
|
|
27
|
-
const generateVCA = (input) =>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
const generateVCA = (input) => {
|
|
38
|
+
//handle new kyc process
|
|
39
|
+
if (enabled &&
|
|
40
|
+
(verificationStatus === 'PENDING' ||
|
|
41
|
+
verificationStatus === 'UNVERIFIED' ||
|
|
42
|
+
verificationStatus === 'REJECTED')) {
|
|
43
|
+
globalStore.kycVerificationStatus.setOpen(true);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
mutation.mutate({
|
|
48
|
+
amount: input.amount,
|
|
49
|
+
promo: input.promo ?? undefined,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
};
|
|
31
53
|
const query = useDepositQuery(deposit?.id, {
|
|
32
54
|
enabled: !!deposit,
|
|
33
55
|
refetchInterval: 5000,
|
|
@@ -12,7 +12,9 @@ import { useCreatePisoPayDepositMutation } from '../../../../client/hooks/useCre
|
|
|
12
12
|
import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
|
|
13
13
|
import { useDepositsCountQuery } from '../../../../client/hooks/useDepositsCountQuery.js';
|
|
14
14
|
import { useDisclosure } from '../../../../client/hooks/useDisclosure.js';
|
|
15
|
+
import { useFeatureFlag } from '../../../../client/hooks/useFeatureFlag.js';
|
|
15
16
|
import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
|
|
17
|
+
import { useMemberVerificationQuery } from '../../../../client/hooks/useMemberVerificationQuery.js';
|
|
16
18
|
import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
|
|
17
19
|
import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
|
|
18
20
|
import { SpinnerIcon } from '../../../../icons/SpinnerIcon.js';
|
|
@@ -27,11 +29,15 @@ import { AmountChoices } from '../../AmountChoices.js';
|
|
|
27
29
|
import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
|
|
28
30
|
import { AvailablePromos } from '../AvailablePromos.js';
|
|
29
31
|
export function PisoPayDeposit() {
|
|
32
|
+
const { enabled } = useFeatureFlag();
|
|
30
33
|
const depositWithdrawalProps = useDepositWithdrawalPropsContext();
|
|
31
34
|
const disclosure = useDisclosure();
|
|
32
35
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
33
36
|
depositWithdrawal: ctx.depositWithdrawal,
|
|
37
|
+
kycVerificationStatus: ctx.kycVerificationStatus,
|
|
34
38
|
})));
|
|
39
|
+
const verificationQuery = useMemberVerificationQuery();
|
|
40
|
+
const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
|
|
35
41
|
const [status, setStatus] = useState('waiting');
|
|
36
42
|
const createDepositMutation = useCreatePisoPayDepositMutation({
|
|
37
43
|
onMutate() {
|
|
@@ -151,19 +157,29 @@ export function PisoPayDeposit() {
|
|
|
151
157
|
}
|
|
152
158
|
}, [form, minimumAmount]);
|
|
153
159
|
return (_jsxs("form", { onSubmit: form.handleSubmit(async (data) => {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
160
|
+
//handle new kyc process
|
|
161
|
+
if (enabled &&
|
|
162
|
+
(verificationStatus === 'PENDING' ||
|
|
163
|
+
verificationStatus === 'UNVERIFIED' ||
|
|
164
|
+
verificationStatus === 'REJECTED')) {
|
|
165
|
+
globalStore.kycVerificationStatus.setOpen(true);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
const id = ObjectId.generate(ObjectType.Deposit).toString();
|
|
170
|
+
const domain = window.location.hostname === 'localhost'
|
|
171
|
+
? 'https://opexa.io'
|
|
172
|
+
: window.location.origin;
|
|
173
|
+
createDepositMutation.reset();
|
|
174
|
+
createDepositMutation.mutate({
|
|
175
|
+
id,
|
|
176
|
+
amount: data.amount.toString(),
|
|
177
|
+
redirectionUrl: `${domain}`,
|
|
178
|
+
...(data.promo && {
|
|
179
|
+
promo: data.promo,
|
|
180
|
+
}),
|
|
181
|
+
});
|
|
182
|
+
}
|
|
167
183
|
}), noValidate: true, children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, className: "mt-3xl", children: [_jsx(Field.Label, { children: "Enter the amount you want to deposit" }), _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) => {
|
|
168
184
|
form.setValue('amount', value.toString(), {
|
|
169
185
|
shouldTouch: true,
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
|
+
import { useShallow } from 'zustand/shallow';
|
|
3
4
|
import { useCreateQRPHDepositMutation } from '../../../../client/hooks/useCreateQRPHDepositMutation.js';
|
|
4
5
|
import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
|
|
6
|
+
import { useFeatureFlag } from '../../../../client/hooks/useFeatureFlag.js';
|
|
7
|
+
import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
|
|
8
|
+
import { useMemberVerificationQuery } from '../../../../client/hooks/useMemberVerificationQuery.js';
|
|
5
9
|
export function useQRPHDeposit() {
|
|
10
|
+
const { enabled } = useFeatureFlag();
|
|
11
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
12
|
+
kycVerificationStatus: ctx.kycVerificationStatus,
|
|
13
|
+
})));
|
|
6
14
|
const [deposit, setDeposit] = useState(null);
|
|
15
|
+
const verificationQuery = useMemberVerificationQuery();
|
|
16
|
+
const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
|
|
7
17
|
const [status, setStatus] = useState('waiting');
|
|
8
18
|
const view = status === 'verification-failed' ||
|
|
9
19
|
status === 'verification-waiting' ||
|
|
@@ -24,10 +34,22 @@ export function useQRPHDeposit() {
|
|
|
24
34
|
setStatus('failed');
|
|
25
35
|
},
|
|
26
36
|
});
|
|
27
|
-
const generateQRCode = (input) =>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
const generateQRCode = (input) => {
|
|
38
|
+
//handle new kyc process
|
|
39
|
+
if (enabled &&
|
|
40
|
+
(verificationStatus === 'PENDING' ||
|
|
41
|
+
verificationStatus === 'UNVERIFIED' ||
|
|
42
|
+
verificationStatus === 'REJECTED')) {
|
|
43
|
+
globalStore.kycVerificationStatus.setOpen(true);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
mutation.mutate({
|
|
48
|
+
amount: input.amount,
|
|
49
|
+
promo: input.promo ?? undefined,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
};
|
|
31
53
|
const query = useDepositQuery(deposit?.id, {
|
|
32
54
|
enabled: !!deposit,
|
|
33
55
|
refetchInterval: 5000,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Loading(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
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: "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
|
+
}
|
|
@@ -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';
|
|
@@ -2,35 +2,34 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { ark } from '@ark-ui/react/factory';
|
|
4
4
|
import { useShallow } from 'zustand/shallow';
|
|
5
|
-
import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
|
|
6
5
|
import { useCreateGameSessionMutation } from '../../client/hooks/useCreateGameSessionMutation.js';
|
|
7
6
|
import { useFeatureFlag } from '../../client/hooks/useFeatureFlag.js';
|
|
8
7
|
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
8
|
+
import { useMemberVerificationQuery } from '../../client/hooks/useMemberVerificationQuery.js';
|
|
9
9
|
import { useSessionQuery } from '../../client/hooks/useSessionQuery.js';
|
|
10
10
|
import { toaster } from '../../client/utils/toaster.js';
|
|
11
11
|
export function GameLaunchTrigger(props) {
|
|
12
12
|
const featureFlag = useFeatureFlag();
|
|
13
13
|
const sessionQuery = useSessionQuery();
|
|
14
|
-
const
|
|
14
|
+
const verificationQuery = useMemberVerificationQuery();
|
|
15
15
|
const createGameSessionMutation = useCreateGameSessionMutation();
|
|
16
16
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
17
17
|
signIn: ctx.signIn,
|
|
18
18
|
gameLaunch: ctx.gameLaunch,
|
|
19
|
+
kycVerificationStatus: ctx.kycVerificationStatus,
|
|
19
20
|
})));
|
|
21
|
+
const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
|
|
20
22
|
const currentHour = new Date().getHours();
|
|
21
23
|
const between3amAnd3pm = currentHour >= 15 || currentHour < 3;
|
|
22
24
|
const unavailable = !between3amAnd3pm &&
|
|
23
25
|
['Hwd1wEWHU6Gvfwecuh', 'HwdcKd7wDpwSPHGksq'].includes('reference' in props.game ? props.game.reference : props.game.id);
|
|
24
|
-
const locked = featureFlag.enabled && accountQuery.data?.status === 'VERIFICATION_LOCKED';
|
|
25
26
|
const disabled = sessionQuery.data?.status === 'unauthenticated'
|
|
26
27
|
? false
|
|
27
|
-
:
|
|
28
|
+
: unavailable
|
|
28
29
|
? true
|
|
29
|
-
:
|
|
30
|
+
: globalStore.gameLaunch.details.status !== 'WAITING'
|
|
30
31
|
? true
|
|
31
|
-
:
|
|
32
|
-
? true
|
|
33
|
-
: props.disabled;
|
|
32
|
+
: props.disabled;
|
|
34
33
|
return (_jsx(ark.button, { type: "button", "aria-label": `Play ${props.game.name}`, "data-state": sessionQuery.data?.status === 'unauthenticated'
|
|
35
34
|
? globalStore.signIn.open
|
|
36
35
|
? 'open'
|
|
@@ -43,6 +42,14 @@ export function GameLaunchTrigger(props) {
|
|
|
43
42
|
globalStore.signIn.setOpen(true);
|
|
44
43
|
return;
|
|
45
44
|
}
|
|
45
|
+
//handle new kyc process to play only on verified members only
|
|
46
|
+
if (featureFlag.enabled &&
|
|
47
|
+
(verificationStatus === 'PENDING' ||
|
|
48
|
+
verificationStatus === 'REJECTED' ||
|
|
49
|
+
verificationStatus === 'UNVERIFIED')) {
|
|
50
|
+
globalStore.kycVerificationStatus.setOpen(true);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
46
53
|
globalStore.gameLaunch.setDetails({
|
|
47
54
|
game: props.game,
|
|
48
55
|
status: 'LOADING',
|