@opexa/portal-components 0.0.277 → 0.0.279
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/useGlobalStore.d.ts +16 -6
- package/dist/client/hooks/useGlobalStore.js +99 -0
- package/dist/client/hooks/useJackpotsQuery.js +1 -1
- package/dist/components/BetRecords/BetRecords.client.js +76 -38
- package/dist/components/Bonus/Bonus.client.js +1 -1
- package/dist/components/Bonuses/ClaimSpotBonus.lazy.js +6 -2
- package/dist/components/Cashback/Cashback.client.js +1 -1
- package/dist/components/CustomPromo/CustomPromo.js +1 -1
- package/dist/components/Disclaimer/Disclaimer.d.ts +3 -14
- package/dist/components/Disclaimer/Disclaimer.js +14 -5
- package/dist/components/Disclaimer/DisclaimerV1.d.ts +1 -1
- package/dist/components/Disclaimer/DisclaimerV1.js +1 -1
- package/dist/components/Disclaimer/DisclaimerV2.d.ts +3 -7
- package/dist/components/Disclaimer/DisclaimerV2.js +23 -51
- package/dist/components/Disclaimer/useDisclaimer.js +1 -1
- package/dist/components/GameLaunch/GameLaunch.lazy.js +1 -1
- package/dist/components/GamesSearch/GamesSearch.js +1 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.js +12 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.js +12 -1
- package/dist/components/KYC/utils.js +18 -18
- package/dist/components/News/News.js +1 -1
- package/dist/components/PortalProvider/FeatureFlag.js +1 -1
- package/dist/components/Promo/Promo.client.js +1 -1
- package/dist/components/ResponsibleGaming/ResponsibleGaming.d.ts +3 -0
- package/dist/components/ResponsibleGaming/ResponsibleGaming.js +14 -0
- package/dist/components/ResponsibleGaming/ResponsibleGaming.lazy.d.ts +8 -0
- package/dist/components/ResponsibleGaming/ResponsibleGaming.lazy.js +35 -0
- package/dist/components/ResponsibleGaming/index.d.ts +1 -0
- package/dist/components/ResponsibleGaming/index.js +1 -0
- package/dist/components/Search/Search.lazy.js +1 -1
- package/dist/components/SignIn/MobileNumberSignIn.js +32 -26
- package/dist/components/SignIn/NameAndPasswordSignIn.js +31 -26
- package/dist/components/SignIn/SignIn.lazy.d.ts +4 -7
- package/dist/components/SignIn/SignIn.lazy.js +1 -0
- package/dist/components/SignUp/SignUp.d.ts +3 -3
- package/dist/components/SignUp/SignUp.js +7 -4
- package/dist/components/SignUp/SignUpDefault/SignUpDefault.lazy.d.ts +14 -0
- package/dist/components/SignUp/SignUpDefault/SignUpDefault.lazy.js +18 -0
- package/dist/components/SignUp/SignUpDefault/SignUpDefaultContext.d.ts +6 -0
- package/dist/components/SignUp/SignUpDefault/SignUpDefaultContext.js +2 -0
- package/dist/components/SignUp/SignUpDefault/SignUpDefaultForm.d.ts +1 -0
- package/dist/components/SignUp/{SignUpForm.js → SignUpDefault/SignUpDefaultForm.js} +88 -57
- package/dist/components/SignUp/SignUpDefault/SignUpForm.js +3 -7
- package/dist/components/SignUp/SignUpKYC/SignUpKYC.lazy.d.ts +5 -8
- package/dist/components/SignUp/SignUpKYC/SignUpKYCForm.js +37 -31
- package/dist/components/SignUp/SignUpKYC/utils.js +18 -18
- package/dist/components/TermsAndConditions/TermsAndConditions.d.ts +2 -0
- package/dist/components/TermsAndConditions/TermsAndConditions.js +14 -0
- package/dist/components/TermsAndConditions/TermsAndConditions.lazy.d.ts +9 -0
- package/dist/components/TermsAndConditions/TermsAndConditions.lazy.js +35 -0
- package/dist/components/TermsAndConditions/index.d.ts +1 -0
- package/dist/components/TermsAndConditions/index.js +1 -0
- package/dist/components/TermsOfUse/TermsOfUse.d.ts +3 -0
- package/dist/components/TermsOfUse/TermsOfUse.js +14 -0
- package/dist/components/TermsOfUse/TermsOfUse.lazy.d.ts +9 -0
- package/dist/components/TermsOfUse/TermsOfUse.lazy.js +35 -0
- package/dist/components/TermsOfUse/index.d.ts +1 -0
- package/dist/components/TermsOfUse/index.js +1 -0
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
- package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
- package/dist/components/TransactionRecords/TableFilters.js +72 -32
- package/dist/handlers/postTransformIdFrontImage.d.ts +3 -0
- package/dist/handlers/postTransformIdFrontImage.js +82 -0
- package/dist/handlers/postTransformSelfieImage.d.ts +3 -0
- package/dist/handlers/postTransformSelfieImage.js +82 -0
- package/dist/next.config.js +1 -0
- package/dist/services/queries.js +2570 -2570
- package/dist/styles/theme.css +695 -695
- package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
- 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/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
- 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 +88 -88
- package/dist/ui/Dialog/dialog.recipe.d.ts +8 -8
- 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 +306 -306
- package/dist/ui/Menu/menu.recipe.d.ts +17 -17
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +88 -88
- package/dist/ui/Popover/popover.recipe.d.ts +8 -8
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- 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/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/package.json +163 -163
- package/dist/client/hooks/index.d.ts +0 -65
- package/dist/client/hooks/index.js +0 -65
- package/dist/client/services/index.d.ts +0 -4
- package/dist/client/services/index.js +0 -4
- package/dist/client/utils/index.d.ts +0 -3
- package/dist/client/utils/index.js +0 -3
- package/dist/components/CashbackBonus/CashbackBonus.client.d.ts +0 -2
- package/dist/components/CashbackBonus/CashbackBonus.client.js +0 -9
- package/dist/components/CashbackBonus/CashbackBonus.d.ts +0 -10
- package/dist/components/CashbackBonus/CashbackBonus.js +0 -5
- package/dist/components/CashbackBonus/index.d.ts +0 -1
- package/dist/components/CashbackBonus/index.js +0 -1
- package/dist/components/Empty.d.ts +0 -9
- package/dist/components/Empty.js +0 -7
- package/dist/components/FeatureFlag/FeatureFlag.d.ts +0 -1
- package/dist/components/FeatureFlag/FeatureFlag.js +0 -29
- package/dist/components/FeatureFlag/index.d.ts +0 -1
- package/dist/components/FeatureFlag/index.js +0 -1
- package/dist/components/Games/GameContext.d.ts +0 -2
- package/dist/components/Games/GameContext.js +0 -2
- package/dist/components/InfiniteScroll.d.ts +0 -10
- package/dist/components/InfiniteScroll.js +0 -25
- package/dist/components/JackpotCounter/JackpotCounter.client.d.ts +0 -2
- package/dist/components/JackpotCounter/JackpotCounter.client.js +0 -66
- package/dist/components/JackpotCounter/JackpotCounter.d.ts +0 -17
- package/dist/components/JackpotCounter/JackpotCounter.js +0 -21
- package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +0 -18
- package/dist/components/JackpotCounter/JackpotCounterItem.js +0 -109
- package/dist/components/JackpotCounter/JackpotCounterItem.module.css +0 -184
- package/dist/components/JackpotCounter/index.d.ts +0 -1
- package/dist/components/JackpotCounter/index.js +0 -1
- package/dist/components/Jackpots/JackpotDesktop.d.ts +0 -1
- package/dist/components/Jackpots/JackpotDesktop.js +0 -45
- package/dist/components/Jackpots/JackpotGameProviders.d.ts +0 -5
- package/dist/components/Jackpots/JackpotGameProviders.js +0 -41
- package/dist/components/Jackpots/JackpotItemDesktop.d.ts +0 -9
- package/dist/components/Jackpots/JackpotItemDesktop.js +0 -43
- package/dist/components/Jackpots/JackpotItemMobile.d.ts +0 -9
- package/dist/components/Jackpots/JackpotItemMobile.js +0 -44
- package/dist/components/Jackpots/JackpotMobile.d.ts +0 -1
- package/dist/components/Jackpots/JackpotMobile.js +0 -46
- package/dist/components/Jackpots/JackpotRules.d.ts +0 -5
- package/dist/components/Jackpots/JackpotRules.js +0 -11
- package/dist/components/Jackpots/Jackpots.client.d.ts +0 -2
- package/dist/components/Jackpots/Jackpots.client.js +0 -29
- package/dist/components/Jackpots/JackpotsContext.d.ts +0 -4
- package/dist/components/Jackpots/JackpotsContext.js +0 -3
- package/dist/components/Jackpots/useJackpotData.d.ts +0 -14
- package/dist/components/Jackpots/useJackpotData.js +0 -93
- package/dist/components/Jackpots/useJackpotItemData.d.ts +0 -20
- package/dist/components/Jackpots/useJackpotItemData.js +0 -87
- package/dist/components/KYC/AutoOpen.d.ts +0 -1
- package/dist/components/KYC/AutoOpen.js +0 -45
- package/dist/components/KYC/Header.d.ts +0 -1
- package/dist/components/KYC/Header.js +0 -8
- package/dist/components/KYC/Step1.d.ts +0 -1
- package/dist/components/KYC/Step1.js +0 -13
- package/dist/components/KYC/Step2.d.ts +0 -1
- package/dist/components/KYC/Step2.js +0 -13
- package/dist/components/KYC/Step3.d.ts +0 -1
- package/dist/components/KYC/Step3.js +0 -13
- package/dist/components/KYC/Step4.d.ts +0 -1
- package/dist/components/KYC/Step4.js +0 -7
- package/dist/components/KYC/backup/Header.d.ts +0 -1
- package/dist/components/KYC/backup/Header.js +0 -8
- package/dist/components/KYC/backup/Indicator.d.ts +0 -1
- package/dist/components/KYC/backup/Indicator.js +0 -9
- package/dist/components/KYC/backup/KYC.d.ts +0 -1
- package/dist/components/KYC/backup/KYC.js +0 -14
- package/dist/components/KYC/backup/KYC.lazy.d.ts +0 -1
- package/dist/components/KYC/backup/KYC.lazy.js +0 -26
- package/dist/components/KYC/backup/KYCContext.d.ts +0 -6
- package/dist/components/KYC/backup/KYCContext.js +0 -2
- package/dist/components/KYC/backup/Step1.d.ts +0 -1
- package/dist/components/KYC/backup/Step1.js +0 -13
- package/dist/components/KYC/backup/Step2.d.ts +0 -1
- package/dist/components/KYC/backup/Step2.js +0 -13
- package/dist/components/KYC/backup/Step3.d.ts +0 -1
- package/dist/components/KYC/backup/Step3.js +0 -13
- package/dist/components/KYC/backup/Step4.d.ts +0 -1
- package/dist/components/KYC/backup/Step4.js +0 -7
- package/dist/components/KYC/backup/useKYC.d.ts +0 -10
- package/dist/components/KYC/backup/useKYC.js +0 -8
- package/dist/components/KYC/loadModels.d.ts +0 -1
- package/dist/components/KYC/loadModels.js +0 -9
- package/dist/components/Messages/Message.d.ts +0 -1
- package/dist/components/Messages/Message.js +0 -34
- package/dist/components/Messages/MessageContext.d.ts +0 -6
- package/dist/components/Messages/MessageContext.js +0 -2
- package/dist/components/Messages/MessageItem.d.ts +0 -4
- package/dist/components/Messages/MessageItem.js +0 -34
- package/dist/components/Messages/MessagePopup.d.ts +0 -1
- package/dist/components/Messages/MessagePopup.js +0 -19
- package/dist/components/Messages/MessageTrigger.d.ts +0 -8
- package/dist/components/Messages/MessageTrigger.js +0 -19
- package/dist/components/Promo/PromoContent.d.ts +0 -2
- package/dist/components/Promo/PromoContent.js +0 -9
- package/dist/components/Promos/PromoCarousel.d.ts +0 -2
- package/dist/components/Promos/PromoCarousel.js +0 -41
- package/dist/components/Promos/PromoGrid.d.ts +0 -2
- package/dist/components/Promos/PromoGrid.js +0 -12
- package/dist/components/Promos/PromoItem.d.ts +0 -7
- package/dist/components/Promos/PromoItem.js +0 -10
- package/dist/components/Quests/CountdownTimer.d.ts +0 -15
- package/dist/components/Quests/CountdownTimer.js +0 -33
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +0 -4
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +0 -78
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +0 -8
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +0 -9
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +0 -4
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +0 -4
- package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +0 -4
- package/dist/components/Quests/WageringQuest/WageringQuest.js +0 -20
- package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +0 -9
- package/dist/components/Quests/WageringQuest/WageringQuestModal.js +0 -9
- package/dist/components/SignUp/SignUp.lazy.d.ts +0 -12
- package/dist/components/SignUp/SignUp.lazy.js +0 -18
- package/dist/components/SignUp/SignUpContext.d.ts +0 -6
- package/dist/components/SignUp/SignUpContext.js +0 -2
- package/dist/components/SignUp/SignUpForm.d.ts +0 -1
- package/dist/components/TournamentCounter/TournamentCounter.client.d.ts +0 -2
- package/dist/components/TournamentCounter/TournamentCounter.client.js +0 -50
- package/dist/components/TournamentCounter/TournamentCounter.d.ts +0 -8
- package/dist/components/TournamentCounter/TournamentCounter.js +0 -21
- package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +0 -8
- package/dist/components/TournamentCounter/TournamentCounterItem.js +0 -106
- package/dist/components/TournamentCounter/index.d.ts +0 -1
- package/dist/components/TournamentCounter/index.js +0 -1
- package/dist/components/Tournaments/TournamentDesktop.d.ts +0 -1
- package/dist/components/Tournaments/TournamentDesktop.js +0 -57
- package/dist/components/Tournaments/TournamentGameProviders.d.ts +0 -5
- package/dist/components/Tournaments/TournamentGameProviders.js +0 -38
- package/dist/components/Tournaments/TournamentItemDesktop.d.ts +0 -7
- package/dist/components/Tournaments/TournamentItemDesktop.js +0 -56
- package/dist/components/Tournaments/TournamentItemMobile.d.ts +0 -7
- package/dist/components/Tournaments/TournamentItemMobile.js +0 -54
- package/dist/components/Tournaments/TournamentMobile.d.ts +0 -1
- package/dist/components/Tournaments/TournamentMobile.js +0 -55
- package/dist/components/Tournaments/TournamentRules.d.ts +0 -5
- package/dist/components/Tournaments/TournamentRules.js +0 -11
- package/dist/components/Tournaments/Tournaments.client.d.ts +0 -2
- package/dist/components/Tournaments/Tournaments.client.js +0 -20
- package/dist/components/Tournaments/TournamentsContext.d.ts +0 -4
- package/dist/components/Tournaments/TournamentsContext.js +0 -3
- package/dist/components/Tournaments/useTournamentData.d.ts +0 -10
- package/dist/components/Tournaments/useTournamentData.js +0 -72
- package/dist/components/Tournaments/useTournamentItemData.d.ts +0 -16
- package/dist/components/Tournaments/useTournamentItemData.js +0 -64
- package/dist/components/index.d.ts +0 -33
- package/dist/components/index.js +0 -33
- package/dist/components/shared/IdDocumentField.client.d.ts +0 -25
- package/dist/components/shared/IdDocumentField.client.js +0 -204
- package/dist/components/shared/IdDocumentField.d.ts +0 -2
- package/dist/components/shared/IdDocumentField.js +0 -11
- package/dist/components/shared/SelfieField.client.d.ts +0 -20
- package/dist/components/shared/SelfieField.client.js +0 -327
- package/dist/components/shared/SelfieField.d.ts +0 -2
- package/dist/components/shared/SelfieField.js +0 -11
- package/dist/constants/BranchCode.d.ts +0 -4
- package/dist/constants/BranchCode.js +0 -42
- package/dist/constants/endpoints.d.ts +0 -10
- package/dist/constants/endpoints.js +0 -41
- package/dist/constants/envVars.d.ts +0 -5
- package/dist/constants/envVars.js +0 -28
- package/dist/constants/gameProviders.d.ts +0 -76
- package/dist/constants/gameProviders.js +0 -361
- package/dist/constants/gameTypes.d.ts +0 -3
- package/dist/constants/gameTypes.js +0 -64
- package/dist/constants/headerKeys.d.ts +0 -2
- package/dist/constants/headerKeys.js +0 -2
- package/dist/constants/secretQuestions.d.ts +0 -3
- package/dist/constants/secretQuestions.js +0 -24
- package/dist/constants/storageKeys.d.ts +0 -2
- package/dist/constants/storageKeys.js +0 -2
- package/dist/handlers.d.ts +0 -43
- package/dist/handlers.js +0 -297
- package/dist/icons/BellRingIcon.d.ts +0 -2
- package/dist/icons/BellRingIcon.js +0 -4
- package/dist/icons/index.d.ts +0 -65
- package/dist/icons/index.js +0 -65
- package/dist/images/hacksaw-gaming.png +0 -0
- package/dist/server/services/index.d.ts +0 -4
- package/dist/server/services/index.js +0 -4
- package/dist/server/utils/index.d.ts +0 -29
- package/dist/server/utils/index.js +0 -29
- package/dist/ui/Presence.d.ts +0 -2
- package/dist/ui/Presence.js +0 -7
- package/dist/ui/Prose.d.ts +0 -2
- package/dist/ui/Prose.js +0 -5
- package/dist/ui/index.d.ts +0 -26
- package/dist/ui/index.js +0 -26
- package/dist/utils/createErrorFromCode.d.ts +0 -2
- package/dist/utils/createErrorFromCode.js +0 -11
- package/dist/utils/dataUrlToBlob.d.ts +0 -1
- package/dist/utils/dataUrlToBlob.js +0 -11
- package/dist/utils/index.d.ts +0 -17
- package/dist/utils/index.js +0 -17
- package/dist/utils/isMobile.d.ts +0 -5
- package/dist/utils/isMobile.js +0 -9
- package/dist/utils/resizeImageSize.d.ts +0 -1
- package/dist/utils/resizeImageSize.js +0 -6
|
@@ -6,8 +6,8 @@ import { zodResolver } from '@hookform/resolvers/zod';
|
|
|
6
6
|
import { ObjectId } from '@opexa/object-id';
|
|
7
7
|
import { differenceInYears, format } from 'date-fns';
|
|
8
8
|
import Image from 'next/image';
|
|
9
|
-
import { useSearchParams } from 'next/navigation';
|
|
10
|
-
import {
|
|
9
|
+
import { useRouter, useSearchParams } from 'next/navigation';
|
|
10
|
+
import { useRef, useState } from 'react';
|
|
11
11
|
import { Controller, useForm } from 'react-hook-form';
|
|
12
12
|
import { twMerge } from 'tailwind-merge';
|
|
13
13
|
import { z } from 'zod';
|
|
@@ -48,8 +48,6 @@ import { Select } from '../../../ui/Select/index.js';
|
|
|
48
48
|
import { createPoll } from '../../../utils/createPoll.js';
|
|
49
49
|
import { getQueryClient } from '../../../utils/getQueryClient.js';
|
|
50
50
|
import { getMemberVerificationQueryKey } from '../../../utils/queryKeys.js';
|
|
51
|
-
import { ResponsibleGaming } from '../../Disclaimer/ResponsibleGaming.js';
|
|
52
|
-
import { TermsOfUse } from '../../Disclaimer/TermsOfUse.js';
|
|
53
51
|
import { IdFrontImageField } from './IdFrontImageField/index.js';
|
|
54
52
|
import { SelfieImageField } from './SelfieImageField/index.js';
|
|
55
53
|
import { useSignUpKYCPropsContext } from './SignUpKYCContext.js';
|
|
@@ -60,19 +58,23 @@ export function SignUpKYCForm() {
|
|
|
60
58
|
itemToValue: (item) => item.code,
|
|
61
59
|
itemToString: (item) => `${item.code} - ${item.name}`,
|
|
62
60
|
});
|
|
61
|
+
const router = useRouter();
|
|
63
62
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
63
|
+
signIn: ctx.signIn,
|
|
64
|
+
signUp: ctx.signUp,
|
|
64
65
|
kycReminder: ctx.kycReminder,
|
|
66
|
+
termsAndConditions: ctx.termsAndConditions,
|
|
67
|
+
responsibleGaming: ctx.responsibleGaming,
|
|
65
68
|
})));
|
|
66
|
-
const [step, setStep] = useState(1);
|
|
67
69
|
const dialog = useDialogContext();
|
|
68
70
|
const search = useSearchParams();
|
|
69
|
-
const signInStore = useGlobalStore(useShallow((ctx) => ctx.signIn));
|
|
70
71
|
const signUpMutation = useSignUpMutation();
|
|
71
72
|
const signInMutation = useSignInMutation();
|
|
72
73
|
const updateAccountMutation = useUpdateAccountMutation();
|
|
73
74
|
const sendVerificationCodeMutation = useSendVerificationCodeMutation();
|
|
74
75
|
const localeInfo = useLocaleInfo();
|
|
75
76
|
const mobileNumberParser = useMobileNumberParser();
|
|
77
|
+
const [step, setStep] = useState(1);
|
|
76
78
|
const fileSchema = z
|
|
77
79
|
.instanceof(File)
|
|
78
80
|
.nullable()
|
|
@@ -170,9 +172,12 @@ export function SignUpKYCForm() {
|
|
|
170
172
|
middleName: '',
|
|
171
173
|
lastName: '',
|
|
172
174
|
branchCode: props?.branches?.[0]?.code ?? BRANCHES[0].code,
|
|
173
|
-
termsAccepted: false,
|
|
174
175
|
frontImage: undefined,
|
|
175
176
|
selfieImage: undefined,
|
|
177
|
+
termsAccepted: globalStore.responsibleGaming.accepted &&
|
|
178
|
+
globalStore.termsAndConditions.accepted
|
|
179
|
+
? true
|
|
180
|
+
: false,
|
|
176
181
|
},
|
|
177
182
|
});
|
|
178
183
|
const step2Form = useForm({
|
|
@@ -188,8 +193,6 @@ export function SignUpKYCForm() {
|
|
|
188
193
|
const form2Ref = useRef(null);
|
|
189
194
|
const birthDay = step1Form.watch('birthDay');
|
|
190
195
|
const branchCode = step1Form.watch('branchCode', '');
|
|
191
|
-
const [isTermsOfUseOpen, setTermsOfUseOpen] = useState(false);
|
|
192
|
-
const [isResponsibleGamingOpen, setResponsibleGamingOpen] = useState(false);
|
|
193
196
|
const { mutateAsync: createMemberVerification } = useCreateMemberVerificationMutation({
|
|
194
197
|
onError: (error) => {
|
|
195
198
|
toaster.error({
|
|
@@ -220,20 +223,7 @@ export function SignUpKYCForm() {
|
|
|
220
223
|
const memberVerification = useMemberVerificationQuery();
|
|
221
224
|
const memberId = memberVerification.data?.id;
|
|
222
225
|
const { mutate: uploadImageFile } = useUploadImageFileMutation();
|
|
223
|
-
|
|
224
|
-
const [isResponsibleGamingAccepted, setIsResponsibleGamingAccepted] = useState(false);
|
|
225
|
-
useEffect(() => {
|
|
226
|
-
if (isTermsOfUseAccepted && isResponsibleGamingAccepted) {
|
|
227
|
-
step1Form.setValue('termsAccepted', true);
|
|
228
|
-
}
|
|
229
|
-
}, [isResponsibleGamingAccepted, isTermsOfUseAccepted, step1Form]);
|
|
230
|
-
return (_jsxs(_Fragment, { children: [_jsx(TermsOfUse, { termsOfUseContent: props.termsOfUseContent ?? 'Terms of Use content', siteName: props.siteName ?? 'Site', logo: props.logo, open: isTermsOfUseOpen, onCloseAction: () => {
|
|
231
|
-
setIsTermsOfUseAccepted(true);
|
|
232
|
-
setTermsOfUseOpen(false);
|
|
233
|
-
}, responsibleGamingLogo: props.responsibleGamingLogo }), _jsx(ResponsibleGaming, { responsibleGamingContent: props.responsibleGamingContent ?? 'Responsible Gaming content', logo: props.logo, open: isResponsibleGamingOpen, onCloseAction: () => {
|
|
234
|
-
setIsResponsibleGamingAccepted(true);
|
|
235
|
-
setResponsibleGamingOpen(false);
|
|
236
|
-
}, responsibleGamingLogo: props.responsibleGamingLogo }), step === 1 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Create an account" }), _jsx("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: "Register instantly and start playing!" }), _jsxs("form", { className: "mt-3xl", autoComplete: "off", onSubmit: step1Form.handleSubmit(async (data) => {
|
|
226
|
+
return (_jsxs(_Fragment, { children: [step === 1 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Create an account" }), _jsx("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: "Register instantly and start playing!" }), _jsxs("form", { className: "mt-3xl", autoComplete: "off", onSubmit: step1Form.handleSubmit(async (data) => {
|
|
237
227
|
try {
|
|
238
228
|
await sendVerificationCodeMutation.mutateAsync({
|
|
239
229
|
channel: 'SMS',
|
|
@@ -288,18 +278,34 @@ export function SignUpKYCForm() {
|
|
|
288
278
|
message: error.message,
|
|
289
279
|
});
|
|
290
280
|
} }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsxs("div", { className: "mt-xl text-center text-sm", children: ["Prohibition to play in open and public places", _jsxs("div", { className: "mt-5 flex items-center justify-center gap-3xl", children: [_jsx("div", { className: "flex size-5xl items-center justify-center overflow-hidden rounded-full bg-white", children: _jsx(Image, { src: pagcorLogo, alt: "", draggable: false, height: 62, width: 186, className: "h-9.5 w-auto object-contain" }) }), _jsx(Image, { src: responsibleGamingLogo, alt: "", height: 62, width: 186, className: "h-10 w-auto", draggable: false })] })] }), _jsx(Controller, { control: step1Form.control, name: "termsAccepted", render: (o) => (_jsxs(Field.Root, { className: "mt-2xl", invalid: o.fieldState.invalid, children: [_jsxs(Checkbox.Root, { checked: o.field.value, onCheckedChange: (details) => {
|
|
281
|
+
if (details.checked === 'indeterminate')
|
|
282
|
+
return;
|
|
291
283
|
o.field.onChange(details.checked);
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
setIsResponsibleGamingAccepted(false);
|
|
295
|
-
}
|
|
284
|
+
globalStore.termsAndConditions.setAccepted(details.checked);
|
|
285
|
+
globalStore.responsibleGaming.setAccepted(details.checked);
|
|
296
286
|
}, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["I am at least 21 years of age and I have read and accept the", ' ', _jsx("button", { type: "button", className: "text-brand-400 underline underline-offset-2", onClick: () => {
|
|
297
|
-
|
|
287
|
+
if (props.termsAndConditionsUrl) {
|
|
288
|
+
globalStore.signUp.setOpen(false);
|
|
289
|
+
router.push(props.termsAndConditionsUrl);
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
globalStore.termsAndConditions.setOpen(true);
|
|
293
|
+
globalStore.termsAndConditions.setNext('SIGN_UP');
|
|
294
|
+
globalStore.signUp.setOpen(false);
|
|
295
|
+
}
|
|
298
296
|
}, children: "Terms and Conditions" }), ' ', "and", ' ', _jsx("button", { type: "button", className: "text-brand-400 underline underline-offset-2", onClick: () => {
|
|
299
|
-
|
|
297
|
+
if (props.responsibleGamingUrl) {
|
|
298
|
+
globalStore.signUp.setOpen(false);
|
|
299
|
+
router.push(props.responsibleGamingUrl);
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
globalStore.responsibleGaming.setOpen(true);
|
|
303
|
+
globalStore.responsibleGaming.setNext('SIGN_UP');
|
|
304
|
+
globalStore.signUp.setOpen(false);
|
|
305
|
+
}
|
|
300
306
|
}, children: "Responsible Gaming" }), ' ', "guidelines."] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Create Account" })] }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-tertiary-600", children: "Already have an account?" }), _jsx("button", { type: "submit", className: "text-button-tertiary-fg font-semibold", onClick: () => {
|
|
301
307
|
dialog.setOpen(false);
|
|
302
|
-
|
|
308
|
+
globalStore.signIn.setOpen(true);
|
|
303
309
|
}, children: "Log In" })] })] })), step === 2 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Check your Phone" }), _jsxs("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: ["We\u2019ve sent a verification code to your mobile number", ' ', _jsx("span", { className: "font-semibold", children: mobileNumberParser.format(step1Form.getValues('mobileNumber')) }), ' ', "via text"] }), _jsxs("form", { ref: form2Ref, className: "mt-5", onSubmit: step2Form.handleSubmit(async ({ verificationCode }) => {
|
|
304
310
|
const id = ObjectId.generate(ObjectType.MemberAccount).toString();
|
|
305
311
|
const { mobileNumber } = step1Form.getValues();
|
|
@@ -331,7 +337,7 @@ export function SignUpKYCForm() {
|
|
|
331
337
|
});
|
|
332
338
|
const ok = await pollLogin();
|
|
333
339
|
if (!ok) {
|
|
334
|
-
|
|
340
|
+
globalStore.signIn.setOpen(true);
|
|
335
341
|
}
|
|
336
342
|
else {
|
|
337
343
|
const pollUpdateAccount = createPoll(async () => {
|
|
@@ -50,24 +50,24 @@ export function validateFile(file) {
|
|
|
50
50
|
return 'Unsupported file';
|
|
51
51
|
}
|
|
52
52
|
export function showPermissionInstructions() {
|
|
53
|
-
const instructions = `
|
|
54
|
-
Camera access is blocked. To enable camera access:
|
|
55
|
-
|
|
56
|
-
Chrome/Edge:
|
|
57
|
-
1. Click the camera icon in the address bar
|
|
58
|
-
2. Select "Always allow" and click "Done"
|
|
59
|
-
3. Or go to Settings > Privacy and security > Site settings > Camera
|
|
60
|
-
|
|
61
|
-
Firefox:
|
|
62
|
-
1. Click the shield icon in the address bar
|
|
63
|
-
2. Click on "Camera blocked"
|
|
64
|
-
3. Select "Allow" and refresh the page
|
|
65
|
-
|
|
66
|
-
Safari:
|
|
67
|
-
1. Go to Safari > Settings > Websites > Camera
|
|
68
|
-
2. Find this website and change to "Allow"
|
|
69
|
-
|
|
70
|
-
After changing permissions, please refresh the page and try again.
|
|
53
|
+
const instructions = `
|
|
54
|
+
Camera access is blocked. To enable camera access:
|
|
55
|
+
|
|
56
|
+
Chrome/Edge:
|
|
57
|
+
1. Click the camera icon in the address bar
|
|
58
|
+
2. Select "Always allow" and click "Done"
|
|
59
|
+
3. Or go to Settings > Privacy and security > Site settings > Camera
|
|
60
|
+
|
|
61
|
+
Firefox:
|
|
62
|
+
1. Click the shield icon in the address bar
|
|
63
|
+
2. Click on "Camera blocked"
|
|
64
|
+
3. Select "Allow" and refresh the page
|
|
65
|
+
|
|
66
|
+
Safari:
|
|
67
|
+
1. Go to Safari > Settings > Websites > Camera
|
|
68
|
+
2. Find this website and change to "Allow"
|
|
69
|
+
|
|
70
|
+
After changing permissions, please refresh the page and try again.
|
|
71
71
|
`;
|
|
72
72
|
alert(instructions);
|
|
73
73
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import dynamic from 'next/dynamic';
|
|
4
|
+
import { useShallow } from 'zustand/shallow';
|
|
5
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
6
|
+
const Component = dynamic(() => import('./TermsAndConditions.lazy.js').then((m) => m.TermsAndConditions), {
|
|
7
|
+
ssr: false,
|
|
8
|
+
loading: () => null,
|
|
9
|
+
});
|
|
10
|
+
export function TermsAndConditions(props) {
|
|
11
|
+
const touched = useGlobalStore(useShallow((ctx) => ctx.termsAndConditions['~touched']));
|
|
12
|
+
if (touched)
|
|
13
|
+
return _jsx(Component, { ...props });
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ImageProps } from 'next/image';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export interface TermsAndConditionsProps {
|
|
4
|
+
logo: ImageProps['src'];
|
|
5
|
+
content: string | ReactNode;
|
|
6
|
+
siteName: string;
|
|
7
|
+
responsibleGamingLogo?: ImageProps['src'];
|
|
8
|
+
}
|
|
9
|
+
export declare function TermsAndConditions({ logo, siteName, content, ...props }: TermsAndConditionsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Image, {} from 'next/image';
|
|
3
|
+
import { useShallow } from 'zustand/shallow';
|
|
4
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
5
|
+
import pagcorLogo from '../../images/pagcor.png';
|
|
6
|
+
import responsibleGamingLogo from '../../images/responsible-gaming.png';
|
|
7
|
+
import { Button } from '../../ui/Button/index.js';
|
|
8
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
9
|
+
import { Portal } from '../../ui/Portal/index.js';
|
|
10
|
+
export function TermsAndConditions({ logo, siteName, content, ...props }) {
|
|
11
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
12
|
+
signIn: ctx.signIn,
|
|
13
|
+
signUp: ctx.signUp,
|
|
14
|
+
disclaimer: ctx.disclaimer,
|
|
15
|
+
termsAndConditions: ctx.termsAndConditions,
|
|
16
|
+
})));
|
|
17
|
+
return (_jsx(Dialog.Root, { open: globalStore.termsAndConditions.open, onOpenChange: (details) => {
|
|
18
|
+
globalStore.termsAndConditions.setOpen(details.open);
|
|
19
|
+
if (!details.open)
|
|
20
|
+
globalStore.termsAndConditions.setAccepted(true);
|
|
21
|
+
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: () => {
|
|
22
|
+
if (globalStore.termsAndConditions.next === 'SIGN_IN') {
|
|
23
|
+
globalStore.signIn.setOpen(true);
|
|
24
|
+
}
|
|
25
|
+
if (globalStore.termsAndConditions.next === 'SIGN_UP') {
|
|
26
|
+
globalStore.signUp.setOpen(true);
|
|
27
|
+
}
|
|
28
|
+
if (globalStore.termsAndConditions.next === 'DISCLAIMER') {
|
|
29
|
+
globalStore.disclaimer.setOpen(true);
|
|
30
|
+
}
|
|
31
|
+
globalStore.termsAndConditions.setNext(null);
|
|
32
|
+
}, 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: content }), _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(Dialog.Context, { children: (api) => (_jsx(Button, { type: "button", className: "mt-3", onClick: () => {
|
|
33
|
+
api.setOpen(false);
|
|
34
|
+
}, children: "I Agree" })) })] }) })] }) }));
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TermsAndConditions';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TermsAndConditions.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import dynamic from 'next/dynamic';
|
|
4
|
+
import { useShallow } from 'zustand/shallow';
|
|
5
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
6
|
+
const Component = dynamic(() => import('./TermsOfUse.lazy.js').then((m) => m.TermsOfUse), {
|
|
7
|
+
ssr: false,
|
|
8
|
+
loading: () => null,
|
|
9
|
+
});
|
|
10
|
+
export function TermsOfUse(props) {
|
|
11
|
+
const touched = useGlobalStore(useShallow((ctx) => ctx.termsOfUse['~touched']));
|
|
12
|
+
if (touched)
|
|
13
|
+
return _jsx(Component, { ...props });
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ImageProps } from 'next/image';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export interface TermsOfUseProps {
|
|
4
|
+
logo: ImageProps['src'];
|
|
5
|
+
content: string | ReactNode;
|
|
6
|
+
siteName: string;
|
|
7
|
+
responsibleGamingLogo?: ImageProps['src'];
|
|
8
|
+
}
|
|
9
|
+
export declare function TermsOfUse({ logo, siteName, content, ...props }: TermsOfUseProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Image, {} from 'next/image';
|
|
3
|
+
import { useShallow } from 'zustand/shallow';
|
|
4
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
5
|
+
import pagcorLogo from '../../images/pagcor.png';
|
|
6
|
+
import responsibleGamingLogo from '../../images/responsible-gaming.png';
|
|
7
|
+
import { Button } from '../../ui/Button/index.js';
|
|
8
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
9
|
+
import { Portal } from '../../ui/Portal/index.js';
|
|
10
|
+
export function TermsOfUse({ logo, siteName, content, ...props }) {
|
|
11
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
12
|
+
signIn: ctx.signIn,
|
|
13
|
+
signUp: ctx.signUp,
|
|
14
|
+
disclaimer: ctx.disclaimer,
|
|
15
|
+
termsOfUse: ctx.termsOfUse,
|
|
16
|
+
})));
|
|
17
|
+
return (_jsx(Dialog.Root, { open: globalStore.termsOfUse.open, onOpenChange: (details) => {
|
|
18
|
+
globalStore.termsOfUse.setOpen(details.open);
|
|
19
|
+
if (!details.open)
|
|
20
|
+
globalStore.termsOfUse.setAccepted(true);
|
|
21
|
+
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: () => {
|
|
22
|
+
if (globalStore.termsOfUse.next === 'SIGN_IN') {
|
|
23
|
+
globalStore.signIn.setOpen(true);
|
|
24
|
+
}
|
|
25
|
+
if (globalStore.termsOfUse.next === 'SIGN_UP') {
|
|
26
|
+
globalStore.signUp.setOpen(true);
|
|
27
|
+
}
|
|
28
|
+
if (globalStore.termsOfUse.next === 'DISCLAIMER') {
|
|
29
|
+
globalStore.disclaimer.setOpen(true);
|
|
30
|
+
}
|
|
31
|
+
globalStore.termsOfUse.setNext(null);
|
|
32
|
+
}, 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: content }), _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(Dialog.Context, { children: (api) => (_jsx(Button, { type: "button", className: "mt-3", onClick: () => {
|
|
33
|
+
api.setOpen(false);
|
|
34
|
+
}, children: "I Agree" })) })] }) })] }) }));
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TermsOfUse';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TermsOfUse.js';
|