@opexa/portal-components 0.0.611 → 0.0.613
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 +1 -0
- package/dist/client/hooks/useGlobalStore.js +13 -0
- package/dist/components/Account/Account.lazy.js +2 -39
- package/dist/components/Account/Wallet.d.ts +17 -0
- package/dist/components/Account/Wallet.example.d.ts +33 -0
- package/dist/components/Account/Wallet.example.js +36 -0
- package/dist/components/Account/Wallet.js +44 -0
- package/dist/components/Account/index.d.ts +1 -0
- package/dist/components/Account/index.js +1 -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 +184 -184
- 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/KYCReminder.lazy.js +1 -1
- package/dist/components/KYC/KYCVerificationStatus.lazy.js +2 -2
- 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/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/services/queries.js +2758 -2758
- package/dist/services/trigger.d.ts +2 -2
- package/dist/services/trigger.js +1 -1
- 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
- package/dist/components/AccountInfo/GoogleDisconnect.d.ts +0 -7
- package/dist/components/AccountInfo/GoogleDisconnect.js +0 -11
- package/dist/icons/LinkBrokenIcon.d.ts +0 -2
- package/dist/icons/LinkBrokenIcon.js +0 -4
|
@@ -88,6 +88,7 @@ export interface GlobalStore {
|
|
|
88
88
|
responsibleGamingReminder: ResponsibleGamingReminderStore;
|
|
89
89
|
pendingBonus: HasPendingBonusStore;
|
|
90
90
|
kycVerificationStatus: PopupStore;
|
|
91
|
+
bankInformationDetails: PopupStore;
|
|
91
92
|
}
|
|
92
93
|
export declare const useGlobalStore: import("zustand").UseBoundStore<Omit<Omit<import("zustand").StoreApi<GlobalStore>, "setState" | "devtools"> & {
|
|
93
94
|
setState(partial: GlobalStore | Partial<GlobalStore> | ((state: GlobalStore) => GlobalStore | Partial<GlobalStore>), replace?: false | undefined, action?: (string | {
|
|
@@ -431,6 +431,19 @@ export const useGlobalStore = create()(devtools(subscribeWithSelector((set) => (
|
|
|
431
431
|
},
|
|
432
432
|
'~touched': false,
|
|
433
433
|
},
|
|
434
|
+
bankInformationDetails: {
|
|
435
|
+
open: false,
|
|
436
|
+
setOpen(open) {
|
|
437
|
+
set((prev) => ({
|
|
438
|
+
bankInformationDetails: {
|
|
439
|
+
...prev.bankInformationDetails,
|
|
440
|
+
open,
|
|
441
|
+
'~touched': true,
|
|
442
|
+
},
|
|
443
|
+
}));
|
|
444
|
+
},
|
|
445
|
+
'~touched': false,
|
|
446
|
+
},
|
|
434
447
|
pendingBonus: {
|
|
435
448
|
open: false,
|
|
436
449
|
setOpen(open) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { isString } from 'lodash-es';
|
|
4
4
|
import Image from 'next/image';
|
|
5
5
|
import Link from 'next/link';
|
|
@@ -10,12 +10,10 @@ import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
|
|
|
10
10
|
import { useBonusesCountQuery } from '../../client/hooks/useBonusesCountQuery.js';
|
|
11
11
|
import { useCashbackBonusesCountQuery } from '../../client/hooks/useCashbackBonusesCountQuery.js';
|
|
12
12
|
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
13
|
-
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
14
13
|
import { useMayaAuth } from '../../client/hooks/useMayaAuth.js';
|
|
15
14
|
import { useProfileCompletionQuery } from '../../client/hooks/useProfileCompletionQuery.js';
|
|
16
15
|
import { useSignOutMutation } from '../../client/hooks/useSignOutMutation.js';
|
|
17
16
|
import { useUnreadMessagesCountQuery } from '../../client/hooks/useUnreadMessagesCountQuery.js';
|
|
18
|
-
import { useWalletQuery } from '../../client/hooks/useWalletQuery.js';
|
|
19
17
|
import { AlertCircleIcon } from '../../icons/AlertCircleIcon.js';
|
|
20
18
|
import { Bell01Icon } from '../../icons/Bell01Icon.js';
|
|
21
19
|
import { ChevronRightIcon } from '../../icons/ChevronRightIcon.js';
|
|
@@ -26,15 +24,14 @@ import { Logout01Icon } from '../../icons/Logout01Icon.js';
|
|
|
26
24
|
import { Settings02Icon } from '../../icons/Settings02Icon.js';
|
|
27
25
|
import avatarPlaceholder from '../../images/placeholder-avatar.png';
|
|
28
26
|
import { Badge } from '../../ui/Badge/index.js';
|
|
29
|
-
import { Button } from '../../ui/Button/index.js';
|
|
30
27
|
import { Drawer } from '../../ui/Drawer/index.js';
|
|
31
28
|
import { Popover } from '../../ui/Popover/index.js';
|
|
32
29
|
import { Portal } from '../../ui/Portal/index.js';
|
|
33
30
|
import { capitalize } from '../../utils/capitalize.js';
|
|
34
|
-
import { formatNumber } from '../../utils/formatNumber.js';
|
|
35
31
|
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
36
32
|
import { AccountPropsContext, useAccountPropsContext } from './AccountContext.js';
|
|
37
33
|
import { accountRecipe } from './account.recipe.js';
|
|
34
|
+
import { Wallet } from './Wallet.js';
|
|
38
35
|
const defaultAccountProps = {
|
|
39
36
|
offsetTop: '0px',
|
|
40
37
|
rewardsUrl: '/rewards',
|
|
@@ -96,40 +93,6 @@ function Profile() {
|
|
|
96
93
|
};
|
|
97
94
|
return (_jsxs("div", { className: "flex shrink-0 items-center gap-lg", children: [_jsx(Image, { src: avatarPlaceholder, alt: "", width: 48, height: 48, className: "size-12" }), _jsxs("div", { className: "grow", children: [_jsx("p", { className: "font-semibold text-text-secondary-700 leading-tight", children: account?.name }), _jsxs("div", { className: "flex", children: [_jsxs("p", { className: "grow items-center text-text-tertiary-600 leading-tight", children: ["ID: ", account?.id] }), accountProps.shouldShowAccountStatus && (_jsxs(Badge.Root, { colorScheme: getVerificationColorScheme(account?.verificationStatus), className: "self-start", children: [_jsx(Badge.Indicator, {}), _jsx(Badge.Label, { children: capitalize(account?.verificationStatus || '') })] }))] })] })] }));
|
|
98
95
|
}
|
|
99
|
-
function Wallet({ classNames }) {
|
|
100
|
-
const localeInfo = useLocaleInfo();
|
|
101
|
-
const walletQuery = useWalletQuery({
|
|
102
|
-
refetchInterval: 1000,
|
|
103
|
-
});
|
|
104
|
-
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
105
|
-
profile: ctx.account,
|
|
106
|
-
mobileProfile: ctx.account__mobile,
|
|
107
|
-
depositWithdrawal: ctx.depositWithdrawal,
|
|
108
|
-
})));
|
|
109
|
-
const depositBalance = parseDecimal(walletQuery.data?.balance, 0);
|
|
110
|
-
const bonusBalance = parseDecimal(walletQuery.data?.bonus, 0);
|
|
111
|
-
const totalBalance = depositBalance + bonusBalance;
|
|
112
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: twMerge('mt-3 rounded-xl border border-border-primary bg-bg-tertiary p-xl', classNames.walletBalanceContainer), children: [_jsx("div", { className: twMerge('text-sm text-text-secondary-700', classNames.totalBalanceLabel), children: "Total Balance" }), _jsx("div", { className: twMerge('font-bold text-3xl', classNames.totalBalanceAmount), children: formatNumber(totalBalance, {
|
|
113
|
-
currency: localeInfo?.currency.code,
|
|
114
|
-
minDecimalPlaces: 2,
|
|
115
|
-
}) }), _jsxs("div", { className: twMerge('mt-1.5 flex gap-7xl', classNames.balanceDetailsContainer), children: [_jsxs("div", { children: [_jsx("p", { className: twMerge('text-2xs text-text-secondary-700', classNames.depositBalanceLabel), children: "Deposit Balance" }), _jsx("p", { className: twMerge('text-medium text-text-primary-brand', classNames.depositBalanceAmount), children: formatNumber(depositBalance, {
|
|
116
|
-
currency: localeInfo?.currency.code,
|
|
117
|
-
minDecimalPlaces: 2,
|
|
118
|
-
}) })] }), _jsxs("div", { children: [_jsx("p", { className: twMerge('text-2xs text-text-secondary-700', classNames.bonusBalanceLabel), children: "Bonus Balance" }), _jsx("p", { className: twMerge('text-medium text-text-primary-brand', classNames.bonusBalanceAmount), children: formatNumber(bonusBalance, {
|
|
119
|
-
currency: localeInfo?.currency.code,
|
|
120
|
-
minDecimalPlaces: 2,
|
|
121
|
-
}) })] })] })] }), ' ', _jsxs("div", { className: twMerge('mt-3 flex gap-lg', classNames.walletActions), children: [_jsx(Button, { size: "xs", variant: "outline", className: classNames.withdrawButton, onClick: () => {
|
|
122
|
-
globalStore.depositWithdrawal.setOpen(true);
|
|
123
|
-
globalStore.depositWithdrawal.setTab('WITHDRAWAL');
|
|
124
|
-
globalStore.profile.setOpen(false);
|
|
125
|
-
globalStore.mobileProfile.setOpen(false);
|
|
126
|
-
}, children: "Withdraw" }), _jsx(Button, { size: "xs", className: classNames.depositButton, onClick: () => {
|
|
127
|
-
globalStore.depositWithdrawal.setOpen(true);
|
|
128
|
-
globalStore.depositWithdrawal.setTab('DEPOSIT');
|
|
129
|
-
globalStore.profile.setOpen(false);
|
|
130
|
-
globalStore.mobileProfile.setOpen(false);
|
|
131
|
-
}, children: "Deposit" })] })] }));
|
|
132
|
-
}
|
|
133
96
|
function Links({ router, classNames, }) {
|
|
134
97
|
const accountProps = useAccountPropsContext();
|
|
135
98
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface WalletClassNames {
|
|
2
|
+
walletActions?: string;
|
|
3
|
+
withdrawButton?: string;
|
|
4
|
+
depositButton?: string;
|
|
5
|
+
walletBalanceContainer?: string;
|
|
6
|
+
totalBalanceLabel?: string;
|
|
7
|
+
totalBalanceAmount?: string;
|
|
8
|
+
balanceDetailsContainer?: string;
|
|
9
|
+
depositBalanceLabel?: string;
|
|
10
|
+
depositBalanceAmount?: string;
|
|
11
|
+
bonusBalanceLabel?: string;
|
|
12
|
+
bonusBalanceAmount?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface WalletProps {
|
|
15
|
+
classNames?: WalletClassNames;
|
|
16
|
+
}
|
|
17
|
+
export declare function Wallet({ classNames }: WalletProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example usage of the Wallet component
|
|
3
|
+
*
|
|
4
|
+
* Import the Wallet component:
|
|
5
|
+
* ```tsx
|
|
6
|
+
* import { Wallet } from '@opexa/portal-components/Account/Wallet';
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* Basic usage:
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Wallet />
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* With custom class names:
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <Wallet
|
|
17
|
+
* classNames={{
|
|
18
|
+
* walletBalanceContainer: "custom-balance-container",
|
|
19
|
+
* totalBalanceAmount: "custom-total-amount",
|
|
20
|
+
* depositButton: "custom-deposit-btn",
|
|
21
|
+
* withdrawButton: "custom-withdraw-btn"
|
|
22
|
+
* }}
|
|
23
|
+
* />
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* The Wallet component includes:
|
|
27
|
+
* - Total balance display
|
|
28
|
+
* - Deposit and bonus balance breakdown
|
|
29
|
+
* - Deposit and Withdraw buttons
|
|
30
|
+
* - Automatic wallet data fetching with 1-second refresh interval
|
|
31
|
+
* - Integration with global store for deposit/withdrawal modals
|
|
32
|
+
*/
|
|
33
|
+
export declare const WalletExample: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Example usage of the Wallet component
|
|
4
|
+
*
|
|
5
|
+
* Import the Wallet component:
|
|
6
|
+
* ```tsx
|
|
7
|
+
* import { Wallet } from '@opexa/portal-components/Account/Wallet';
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* Basic usage:
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <Wallet />
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* With custom class names:
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <Wallet
|
|
18
|
+
* classNames={{
|
|
19
|
+
* walletBalanceContainer: "custom-balance-container",
|
|
20
|
+
* totalBalanceAmount: "custom-total-amount",
|
|
21
|
+
* depositButton: "custom-deposit-btn",
|
|
22
|
+
* withdrawButton: "custom-withdraw-btn"
|
|
23
|
+
* }}
|
|
24
|
+
* />
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* The Wallet component includes:
|
|
28
|
+
* - Total balance display
|
|
29
|
+
* - Deposit and bonus balance breakdown
|
|
30
|
+
* - Deposit and Withdraw buttons
|
|
31
|
+
* - Automatic wallet data fetching with 1-second refresh interval
|
|
32
|
+
* - Integration with global store for deposit/withdrawal modals
|
|
33
|
+
*/
|
|
34
|
+
export const WalletExample = () => {
|
|
35
|
+
return (_jsxs("div", { className: "p-4", children: [_jsx("h2", { className: 'mb-4 font-bold text-xl', children: "Wallet Component Example" }), _jsx("p", { className: 'mb-4 text-gray-600', children: "The Wallet component is now available as a standalone component that you can use anywhere in your application." }), _jsxs("div", { className: 'rounded-lg bg-gray-100 p-4', children: [_jsx("h3", { className: 'mb-2 font-semibold', children: "Import:" }), _jsxs("code", { className: 'block rounded bg-white p-2 text-sm', children: ["import ", `{ Wallet }`, " from '@opexa/portal-components/Account/Wallet';"] })] }), _jsxs("div", { className: 'mt-4 rounded-lg bg-gray-100 p-4', children: [_jsx("h3", { className: 'mb-2 font-semibold', children: "Usage:" }), _jsx("code", { className: 'block rounded bg-white p-2 text-sm', children: `<Wallet classNames={{ walletActions: "custom-actions" }} />` })] })] }));
|
|
36
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { useShallow } from 'zustand/shallow';
|
|
5
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
6
|
+
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
7
|
+
import { useWalletQuery } from '../../client/hooks/useWalletQuery.js';
|
|
8
|
+
import { Button } from '../../ui/Button/index.js';
|
|
9
|
+
import { formatNumber } from '../../utils/formatNumber.js';
|
|
10
|
+
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
11
|
+
export function Wallet({ classNames = {} }) {
|
|
12
|
+
const localeInfo = useLocaleInfo();
|
|
13
|
+
const walletQuery = useWalletQuery({
|
|
14
|
+
refetchInterval: 1000,
|
|
15
|
+
});
|
|
16
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
17
|
+
profile: ctx.account,
|
|
18
|
+
mobileProfile: ctx.account__mobile,
|
|
19
|
+
depositWithdrawal: ctx.depositWithdrawal,
|
|
20
|
+
})));
|
|
21
|
+
const depositBalance = parseDecimal(walletQuery.data?.balance, 0);
|
|
22
|
+
const bonusBalance = parseDecimal(walletQuery.data?.bonus, 0);
|
|
23
|
+
const totalBalance = depositBalance + bonusBalance;
|
|
24
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: twMerge('mt-3 rounded-xl border border-border-primary bg-bg-tertiary p-xl', classNames.walletBalanceContainer), children: [_jsx("div", { className: twMerge('text-sm text-text-secondary-700', classNames.totalBalanceLabel), children: "Total Balance" }), _jsx("div", { className: twMerge('font-bold text-3xl', classNames.totalBalanceAmount), children: formatNumber(totalBalance, {
|
|
25
|
+
currency: localeInfo?.currency.code,
|
|
26
|
+
minDecimalPlaces: 2,
|
|
27
|
+
}) }), _jsxs("div", { className: twMerge('mt-1.5 flex gap-7xl', classNames.balanceDetailsContainer), children: [_jsxs("div", { children: [_jsx("p", { className: twMerge('text-2xs text-text-secondary-700', classNames.depositBalanceLabel), children: "Deposit Balance" }), _jsx("p", { className: twMerge('text-medium text-text-primary-brand', classNames.depositBalanceAmount), children: formatNumber(depositBalance, {
|
|
28
|
+
currency: localeInfo?.currency.code,
|
|
29
|
+
minDecimalPlaces: 2,
|
|
30
|
+
}) })] }), _jsxs("div", { children: [_jsx("p", { className: twMerge('text-2xs text-text-secondary-700', classNames.bonusBalanceLabel), children: "Bonus Balance" }), _jsx("p", { className: twMerge('text-medium text-text-primary-brand', classNames.bonusBalanceAmount), children: formatNumber(bonusBalance, {
|
|
31
|
+
currency: localeInfo?.currency.code,
|
|
32
|
+
minDecimalPlaces: 2,
|
|
33
|
+
}) })] })] })] }), _jsxs("div", { className: twMerge('mt-3 flex gap-lg', classNames.walletActions), children: [_jsx(Button, { size: "xs", variant: "outline", className: classNames.withdrawButton, onClick: () => {
|
|
34
|
+
globalStore.depositWithdrawal.setOpen(true);
|
|
35
|
+
globalStore.depositWithdrawal.setTab('WITHDRAWAL');
|
|
36
|
+
globalStore.profile.setOpen(false);
|
|
37
|
+
globalStore.mobileProfile.setOpen(false);
|
|
38
|
+
}, children: "Withdraw" }), _jsx(Button, { size: "xs", className: classNames.depositButton, onClick: () => {
|
|
39
|
+
globalStore.depositWithdrawal.setOpen(true);
|
|
40
|
+
globalStore.depositWithdrawal.setTab('DEPOSIT');
|
|
41
|
+
globalStore.profile.setOpen(false);
|
|
42
|
+
globalStore.mobileProfile.setOpen(false);
|
|
43
|
+
}, children: "Deposit" })] })] }));
|
|
44
|
+
}
|
|
@@ -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';
|