@opexa/portal-components 0.0.405 → 0.0.407
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/useCellxpertCxd.d.ts +7 -0
- package/dist/client/hooks/useCellxpertCxd.js +4 -0
- package/dist/client/hooks/useSignUpMutation.js +3 -2
- package/dist/client/hooks/useUpdateSessionMutation.js +0 -2
- package/dist/client/services/updateSession.d.ts +0 -1
- package/dist/components/Account/Account.lazy.d.ts +8 -0
- package/dist/components/Account/Account.lazy.js +16 -5
- package/dist/components/Bonuses/Bonuses.client.js +3 -3
- package/dist/components/PortalProvider/PortalProvider.js +1 -1
- package/dist/components/PortalProvider/Providers.js +2 -7
- package/dist/components/PortalProvider/SetupCellxpertCxd.js +27 -12
- package/dist/components/Quests/WageringQuest.js +1 -1
- package/dist/components/SignUp/SignUpDefault/SignUpDefaultForm.js +1 -7
- package/dist/components/SignUp/SignUpKYC/SignUpKYCForm.js +1 -3
- package/dist/constants/StorageKey.d.ts +1 -0
- package/dist/constants/StorageKey.js +1 -0
- package/dist/handlers/patchSession.js +0 -1
- package/dist/services/queries.d.ts +1 -1
- package/dist/services/queries.js +1 -1
- package/dist/styles/theme.css +3 -0
- package/dist/types/index.d.ts +0 -2
- package/dist/ui/AlertDialog/AlertDialog.d.ts +121 -121
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +11 -11
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Carousel/Carousel.d.ts +45 -45
- package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/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 +121 -121
- package/dist/ui/Dialog/dialog.recipe.d.ts +11 -11
- 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 +360 -360
- package/dist/ui/Menu/menu.recipe.d.ts +20 -20
- package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
- package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/PinInput/PinInput.d.ts +12 -12
- package/dist/ui/PinInput/pinInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +121 -121
- package/dist/ui/Popover/popover.recipe.d.ts +11 -11
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/Progress/progress.recipe.js +1 -1
- package/dist/ui/QrCode/QrCode.d.ts +25 -25
- package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/dist/ui/Tooltip/Tooltip.d.ts +48 -48
- package/dist/ui/Tooltip/tooltip.recipe.d.ts +8 -8
- package/package.json +1 -1
|
@@ -2,8 +2,9 @@ import { useMutation } from '@tanstack/react-query';
|
|
|
2
2
|
import { registerMemberAccountViaMobile, } from '../../services/account.js';
|
|
3
3
|
import { getSignUpMutationKey } from '../../utils/mutationKeys.js';
|
|
4
4
|
import { getSession } from '../services/getSession.js';
|
|
5
|
+
import { useCellxpertCxd } from './useCellxpertCxd.js';
|
|
5
6
|
export const useSignUpMutation = (config) => {
|
|
6
|
-
const cellxpertCxd =
|
|
7
|
+
const [cellxpertCxd] = useCellxpertCxd();
|
|
7
8
|
return useMutation({
|
|
8
9
|
...config,
|
|
9
10
|
mutationKey: getSignUpMutationKey(),
|
|
@@ -15,7 +16,7 @@ export const useSignUpMutation = (config) => {
|
|
|
15
16
|
btag: session.btag,
|
|
16
17
|
}),
|
|
17
18
|
...(cellxpertCxd && {
|
|
18
|
-
cellxpertCxd,
|
|
19
|
+
cellxpertCxd: cellxpertCxd.value,
|
|
19
20
|
}),
|
|
20
21
|
}, {
|
|
21
22
|
headers: {
|
|
@@ -15,13 +15,11 @@ export const useUpdateSessionMutation = (config) => {
|
|
|
15
15
|
return prev;
|
|
16
16
|
const domain = input.domain ?? prev.domain;
|
|
17
17
|
const btag = input.btag ?? prev.btag;
|
|
18
|
-
const cellxpertCxd = input.cellxpertCxd ?? prev.cellxpertCxd;
|
|
19
18
|
if (prev.status === 'unauthenticated') {
|
|
20
19
|
return {
|
|
21
20
|
status: 'unauthenticated',
|
|
22
21
|
domain,
|
|
23
22
|
btag,
|
|
24
|
-
cellxpertCxd,
|
|
25
23
|
};
|
|
26
24
|
}
|
|
27
25
|
return {
|
|
@@ -2,6 +2,5 @@ import { type HttpRequestOptions } from '../../services/httpRequest';
|
|
|
2
2
|
export interface UpdateSessionInput {
|
|
3
3
|
domain?: string;
|
|
4
4
|
btag?: string;
|
|
5
|
-
cellxpertCxd?: string;
|
|
6
5
|
}
|
|
7
6
|
export declare const updateSession: (input: UpdateSessionInput, options?: HttpRequestOptions) => Promise<boolean>;
|
|
@@ -3,6 +3,14 @@ export interface ClassNameEntries {
|
|
|
3
3
|
walletActions?: string;
|
|
4
4
|
withdrawButton?: string;
|
|
5
5
|
depositButton?: string;
|
|
6
|
+
walletBalanceContainer?: string;
|
|
7
|
+
totalBalanceLabel?: string;
|
|
8
|
+
totalBalanceAmount?: string;
|
|
9
|
+
balanceDetailsContainer?: string;
|
|
10
|
+
depositBalanceLabel?: string;
|
|
11
|
+
depositBalanceAmount?: string;
|
|
12
|
+
bonusBalanceLabel?: string;
|
|
13
|
+
bonusBalanceAmount?: string;
|
|
6
14
|
navItemRoot?: string;
|
|
7
15
|
navItemLink?: string;
|
|
8
16
|
navItemIcon?: string;
|
|
@@ -29,6 +29,7 @@ import { Button } from '../../ui/Button/index.js';
|
|
|
29
29
|
import { Drawer } from '../../ui/Drawer/index.js';
|
|
30
30
|
import { Popover } from '../../ui/Popover/index.js';
|
|
31
31
|
import { Portal } from '../../ui/Portal/index.js';
|
|
32
|
+
import { capitalize } from '../../utils/capitalize.js';
|
|
32
33
|
import { formatNumber } from '../../utils/formatNumber.js';
|
|
33
34
|
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
34
35
|
import { AccountPropsContext, useAccountPropsContext } from './AccountContext.js';
|
|
@@ -80,7 +81,17 @@ export function Account(props) {
|
|
|
80
81
|
function Profile() {
|
|
81
82
|
const accountQuery = useAccountQuery();
|
|
82
83
|
const account = accountQuery.data;
|
|
83
|
-
|
|
84
|
+
const getVerificationColorScheme = (status) => {
|
|
85
|
+
switch (status) {
|
|
86
|
+
case 'VERIFIED':
|
|
87
|
+
return 'success';
|
|
88
|
+
case 'PENDING':
|
|
89
|
+
return 'brand';
|
|
90
|
+
default:
|
|
91
|
+
return 'danger';
|
|
92
|
+
}
|
|
93
|
+
};
|
|
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] }), _jsxs(Badge.Root, { colorScheme: getVerificationColorScheme(account?.verificationStatus), className: "self-start", children: [_jsx(Badge.Indicator, {}), _jsx(Badge.Label, { children: capitalize(account?.verificationStatus || '') })] })] })] })] }));
|
|
84
95
|
}
|
|
85
96
|
function Wallet({ classNames }) {
|
|
86
97
|
const localeInfo = useLocaleInfo();
|
|
@@ -95,13 +106,13 @@ function Wallet({ classNames }) {
|
|
|
95
106
|
const depositBalance = parseDecimal(walletQuery.data?.balance, 0);
|
|
96
107
|
const bonusBalance = parseDecimal(walletQuery.data?.bonus, 0);
|
|
97
108
|
const totalBalance = depositBalance + bonusBalance;
|
|
98
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className:
|
|
109
|
+
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, {
|
|
99
110
|
currency: localeInfo?.currency.code,
|
|
100
111
|
minDecimalPlaces: 2,
|
|
101
|
-
}) }), _jsxs("div", { className:
|
|
112
|
+
}) }), _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, {
|
|
102
113
|
currency: localeInfo?.currency.code,
|
|
103
114
|
minDecimalPlaces: 2,
|
|
104
|
-
}) })] }), _jsxs("div", { children: [_jsx("p", { className:
|
|
115
|
+
}) })] }), _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, {
|
|
105
116
|
currency: localeInfo?.currency.code,
|
|
106
117
|
minDecimalPlaces: 2,
|
|
107
118
|
}) })] })] })] }), ' ', _jsxs("div", { className: twMerge('mt-3 flex gap-lg', classNames.walletActions), children: [_jsx(Button, { size: "xs", variant: "outline", className: classNames.withdrawButton, onClick: () => {
|
|
@@ -116,7 +127,7 @@ function Wallet({ classNames }) {
|
|
|
116
127
|
globalStore.mobileProfile.setOpen(false);
|
|
117
128
|
}, children: "Deposit" })] })] }));
|
|
118
129
|
}
|
|
119
|
-
function Links({ router, classNames }) {
|
|
130
|
+
function Links({ router, classNames, }) {
|
|
120
131
|
const accountProps = useAccountPropsContext();
|
|
121
132
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
122
133
|
account: ctx.account,
|
|
@@ -76,7 +76,7 @@ function Bonus(props) {
|
|
|
76
76
|
const turnoverRequirement = parseDecimal(bonus.turnoverRequirement, 0);
|
|
77
77
|
return (_jsxs("div", { className: "flex flex-col overflow-hidden rounded-2xl border border-border-primary bg-bg-tertiary", children: [_jsxs("div", { className: "relative", children: [promo.banner?.url ? (_jsx(Image, { src: promo.banner.url, alt: "", width: 400, height: 200, className: "h-[11.25rem] w-full object-cover" })) : (_jsx("div", { style: {
|
|
78
78
|
background: 'radial-gradient(75.21% 75.21% at 50% 50%, rgba(249, 163, 8, 0.3) 0%, rgba(0, 0, 0, 0) 100%), var(--color-bg-primary-alt)',
|
|
79
|
-
}, children: _jsx(Image, { src: piggyBank, alt: "", className: "mx-auto h-[11.25rem] w-auto shrink-0 object-cover", draggable: false, width: 600, height: 600 }) })), _jsxs(Badge.Root, { size: "lg", round: false, colorScheme: remainingTime.expired ? 'danger' : 'brand-dark', className: "absolute top-4 right-4", children: [_jsx(Badge.Icon, { children: _jsx(StopWatchIcon, {}) }), _jsx(Badge.Label, { children: remainingTime.expired ? 'Expired' : remainingTime.toString() })] })] }), _jsxs("div", { className: "flex grow flex-col px-xl py-3xl", children: [_jsx("h2", { className: "line-clamp-1 text-center font-semibold text-
|
|
79
|
+
}, children: _jsx(Image, { src: piggyBank, alt: "", className: "mx-auto h-[11.25rem] w-auto shrink-0 object-cover", draggable: false, width: 600, height: 600 }) })), _jsxs(Badge.Root, { size: "lg", round: false, colorScheme: remainingTime.expired ? 'danger' : 'brand-dark', className: "absolute top-4 right-4", children: [_jsx(Badge.Icon, { children: _jsx(StopWatchIcon, {}) }), _jsx(Badge.Label, { children: remainingTime.expired ? 'Expired' : remainingTime.toString() })] })] }), _jsxs("div", { className: "flex grow flex-col px-xl py-3xl", children: [_jsx("h2", { className: "line-clamp-1 text-center font-semibold text-xl", children: promo.name }), _jsx("div", { className: "mt-2 flex items-baseline justify-center gap-2", children: _jsx("p", { className: "font-semibold text-3xl leading-none", children: formatNumber(bonus.balance, {
|
|
80
80
|
currency: localeInfo.currency.code,
|
|
81
81
|
minDecimalPlaces: 2,
|
|
82
82
|
}) }) }), _jsxs("div", { className: "mt-md flex justify-between text-text-primary-brand", children: [_jsxs("p", { children: ["Wagering ", currentTurnoverRequirementContributionPercentage, "%"] }), _jsxs("p", { children: [bonus.currentTurnoverRequirementContribution, "/", turnoverRequirement] })] }), _jsx(Progress.Root, { min: 0, max: 100, value: clamp(currentTurnoverRequirementContributionPercentage, 0, 100), className: "mt-2", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) }), _jsx("div", { className: "grow" }), _jsx(Button, { size: "sm", variant: "outline", className: "mt-6", asChild: true, children: _jsx(Link, { href: `${props.viewDetailsUrl}/${bonus.id}`, children: "See More" }) })] })] }));
|
|
@@ -114,7 +114,7 @@ function CashbackBonus(props) {
|
|
|
114
114
|
belowMinimumCashbackThreshold;
|
|
115
115
|
return (_jsxs("div", { className: "flex flex-col overflow-hidden rounded-2xl border border-border-primary bg-bg-tertiary", children: [cashback.banner?.url ? (_jsx(Image, { src: cashback.banner.url, alt: "", width: 400, height: 200, className: "h-[11.25rem] w-full object-cover" })) : (_jsx("div", { style: {
|
|
116
116
|
background: 'radial-gradient(75.21% 75.21% at 50% 50%, rgba(249, 163, 8, 0.3) 0%, rgba(0, 0, 0, 0) 100%), var(--color-bg-primary-alt)',
|
|
117
|
-
}, children: _jsx(Image, { src: moneyOnHand, alt: "", className: "mx-auto h-[11.25rem] w-auto shrink-0 object-cover", draggable: false, width: 600, height: 600 }) })), _jsxs("div", { className: "flex grow flex-col px-xl py-3xl", children: [_jsx("p", { className:
|
|
117
|
+
}, children: _jsx(Image, { src: moneyOnHand, alt: "", className: "mx-auto h-[11.25rem] w-auto shrink-0 object-cover", draggable: false, width: 600, height: 600 }) })), _jsxs("div", { className: "flex grow flex-col px-xl py-3xl", children: [_jsx("p", { className: 'line-clamp-1 text-center font-semibold text-xl', children: cashback.name }), _jsx("h2", { className: "mt-2 text-center font-semibold text-3xl ", children: formatNumber(currentAccumulatedCashbackAmount, {
|
|
118
118
|
currency: localeInfo.currency.code,
|
|
119
119
|
minDecimalPlaces: 2,
|
|
120
120
|
}) }), _jsx("div", { className: "mt-2 line-clamp-1 text-center text-sm text-text-secondary-700", dangerouslySetInnerHTML: {
|
|
@@ -134,7 +134,7 @@ function SpotBonus() {
|
|
|
134
134
|
})));
|
|
135
135
|
return (_jsxs("div", { className: "flex flex-col overflow-hidden rounded-2xl border border-border-primary bg-bg-tertiary", children: [_jsx("div", { style: {
|
|
136
136
|
background: 'radial-gradient(75.21% 75.21% at 50% 50%, rgba(249, 163, 8, 0.3) 0%, rgba(0, 0, 0, 0) 100%), var(--color-bg-primary-alt)',
|
|
137
|
-
}, children: _jsx(Image, { src: ribbonEnvelope, alt: "", className: "mx-auto h-[11.25rem] w-[80%] object-cover", draggable: false, width: 600, height: 341 }) }), _jsxs("div", { className: "flex grow flex-col px-xl py-3xl", children: [_jsx("p", { className: "text-center font-semibold text-
|
|
137
|
+
}, children: _jsx(Image, { src: ribbonEnvelope, alt: "", className: "mx-auto h-[11.25rem] w-[80%] object-cover", draggable: false, width: 600, height: 341 }) }), _jsxs("div", { className: "flex grow flex-col px-xl py-3xl", children: [_jsx("p", { className: "text-center font-semibold text-xl", children: "Special Rewards" }), _jsx("p", { className: "mt-2 text-center font-semibold text-3xl", children: "Promo Code" }), _jsx("p", { className: "mt-2 text-center text-sm text-text-secondary-700", children: "Have a promo code? Don\u2019t miss out, redeem it now\u00A0and\u00A0enjoy exclusive rewards!" }), _jsx("div", { className: "grow" }), _jsx(Button, { size: "sm", onClick: () => {
|
|
138
138
|
globalStore.spotBonus.setOpen(true);
|
|
139
139
|
}, className: "mt-6", children: "Enter Promo Code" })] })] }));
|
|
140
140
|
}
|
|
@@ -7,13 +7,13 @@ import { prefetchSessionQuery } from '../../server/utils/prefetchSessionQuery.js
|
|
|
7
7
|
import { prefetchWalletQuery } from '../../server/utils/prefetchWalletQuery.js';
|
|
8
8
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
9
9
|
import { FeatureFlag } from './FeatureFlag.js';
|
|
10
|
-
import { SocialAccountLinkObserver } from './SocialAccountLinkObserver.js';
|
|
11
10
|
import { Providers } from './Providers.js';
|
|
12
11
|
import { SessionWatcher } from './SessionWatcher.js';
|
|
13
12
|
import { SetupBtag } from './SetupBtag.js';
|
|
14
13
|
import { SetupCellxpertCxd } from './SetupCellxpertCxd.js';
|
|
15
14
|
import { SetupDomain } from './SetupDomain.js';
|
|
16
15
|
import { Snackbar } from './Snackbar.js';
|
|
16
|
+
import { SocialAccountLinkObserver } from './SocialAccountLinkObserver.js';
|
|
17
17
|
export async function PortalProvider({ recaptchaSiteKey, children, }) {
|
|
18
18
|
const queryClient = getQueryClient();
|
|
19
19
|
await Promise.allSettled([
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { QueryClientProvider } from '@tanstack/react-query';
|
|
4
4
|
import { ReCaptchaProvider } from 'next-recaptcha-v3';
|
|
5
|
-
import dynamic from 'next/dynamic';
|
|
6
5
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
7
|
-
const CXDTokenObserver = dynamic(() => import('./CXDTokenObserver.js').then((m) => m.CXDTokenObserver), {
|
|
8
|
-
ssr: false,
|
|
9
|
-
loading: () => null,
|
|
10
|
-
});
|
|
11
6
|
export function Providers({ recaptchaSiteKey, children, }) {
|
|
12
7
|
const queryClient = getQueryClient();
|
|
13
|
-
return (
|
|
8
|
+
return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(ReCaptchaProvider, { reCaptchaKey: recaptchaSiteKey, children: children }) }));
|
|
14
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { addHours, isAfter, subMinutes } from 'date-fns';
|
|
2
3
|
import { useSearchParams } from 'next/navigation';
|
|
3
4
|
import { useTimeout } from 'usehooks-ts';
|
|
4
5
|
import { z } from 'zod';
|
|
5
|
-
import {
|
|
6
|
-
import { useUpdateSessionMutation } from '../../client/hooks/useUpdateSessionMutation.js';
|
|
6
|
+
import { useCellxpertCxd } from '../../client/hooks/useCellxpertCxd.js';
|
|
7
7
|
const CellxpertCxdSchema = z
|
|
8
8
|
.string()
|
|
9
9
|
.min(200)
|
|
@@ -12,17 +12,32 @@ const CellxpertCxdSchema = z
|
|
|
12
12
|
.nullable()
|
|
13
13
|
.catch(null);
|
|
14
14
|
export function SetupCellxpertCxd() {
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
15
|
+
const searchParams = useSearchParams();
|
|
16
|
+
const value = CellxpertCxdSchema.parse(searchParams.get('cxd'));
|
|
17
|
+
const [cellxpertCxd, setCellxpertCxd] = useCellxpertCxd();
|
|
18
18
|
useTimeout(() => {
|
|
19
|
-
|
|
20
|
-
const newValue = CellxpertCxdSchema.parse(params.get('cxd'));
|
|
21
|
-
if (oldValue === newValue)
|
|
19
|
+
if (!value)
|
|
22
20
|
return;
|
|
23
|
-
if (!
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
if (!cellxpertCxd) {
|
|
22
|
+
return setCellxpertCxd({
|
|
23
|
+
value,
|
|
24
|
+
expires: subMinutes(addHours(new Date(), 6), 1).getTime(),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/* If previous value is expired, override */
|
|
28
|
+
if (isAfter(new Date(), new Date(cellxpertCxd.expires))) {
|
|
29
|
+
return setCellxpertCxd({
|
|
30
|
+
value,
|
|
31
|
+
expires: addHours(new Date(), 6).getTime(),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/* If previous value is not the same as new value, override */
|
|
35
|
+
if (value !== cellxpertCxd.value) {
|
|
36
|
+
return setCellxpertCxd({
|
|
37
|
+
value,
|
|
38
|
+
expires: addHours(new Date(), 6).getTime(),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}, 250);
|
|
27
42
|
return null;
|
|
28
43
|
}
|
|
@@ -20,7 +20,7 @@ export function WageringQuest() {
|
|
|
20
20
|
const localeInfo = useLocaleInfo();
|
|
21
21
|
const { progressPercentage, turnover, targetTurnover, name, description, endDateTime, bonus, status, } = quest;
|
|
22
22
|
const remainingTime = useRemainingTime(endDateTime);
|
|
23
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex h-full w-full flex-col space-y-6 rounded-2xl border border-border-primary bg-bg-tertiary px-4 pt-5 pb-6", children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-start justify-between", children: [_jsx(RemainingTime, {}), _jsx("button", { type: "button", className: "flex size-9 cursor-pointer items-center justify-center rounded-md border border-border-secondary bg-bg-primary", onClick: () => disclosure.setOpen(true), "aria-label": "View Rules", children: _jsx(InfoCircleIcon, { className: "size-5 text-text-disabled" }) })] }), _jsx("p", { className: "font-semibold text-xl", children: name }), _jsx(Prose, { className: "text-wrap font-normal text-sm text-text-secondary-700", dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsxs("div", { className: "group flex items-center justify-between text-text-primary-brand", children: [_jsxs("p", { children: ["Progress ", parseDecimal(progressPercentage, 0).toFixed(2), "%"] }), _jsxs("p", { children: [turnover, _jsxs("span", { className: "text-text-quarterary-brand", children: ["/", targetTurnover, " ", localeInfo.currency.code] })] })] }), _jsx("div", { className: "h-2 w-full overflow-hidden rounded-full bg-bg-primary", children: _jsx("div", { className: "h-full rounded-full bg-utility-brand-600 transition-all duration-300", style: { width: `${progressPercentage}%` } }) })] }), _jsx("div", { className: "flex h-full items-end", children: _jsx("div", { className: "w-full rounded-md border border-bg-primary-hover bg-button-secondary-bg px-3.5 py-2.5 text-center
|
|
23
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex h-full w-full flex-col space-y-6 rounded-2xl border border-border-primary bg-bg-tertiary px-4 pt-5 pb-6", children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-start justify-between", children: [_jsx(RemainingTime, {}), _jsx("button", { type: "button", className: "flex size-9 cursor-pointer items-center justify-center rounded-md border border-border-secondary bg-bg-primary", onClick: () => disclosure.setOpen(true), "aria-label": "View Rules", children: _jsx(InfoCircleIcon, { className: "size-5 text-text-disabled" }) })] }), _jsx("p", { className: "font-semibold text-xl", children: name }), _jsx(Prose, { className: "text-wrap font-normal text-sm text-text-secondary-700", dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsxs("div", { className: "group flex items-center justify-between text-text-primary-brand", children: [_jsxs("p", { children: ["Progress ", parseDecimal(progressPercentage, 0).toFixed(2), "%"] }), _jsxs("p", { children: [turnover, _jsxs("span", { className: "text-text-quarterary-brand", children: ["/", targetTurnover, " ", localeInfo.currency.code] })] })] }), _jsx("div", { className: "h-2 w-full overflow-hidden rounded-full bg-bg-primary", children: _jsx("div", { className: "h-full rounded-full bg-utility-brand-600 transition-all duration-300", style: { width: `${progressPercentage}%` } }) })] }), _jsx("div", { className: "flex h-full items-end", children: _jsx("div", { className: "w-full rounded-md border border-bg-primary-hover bg-button-secondary-bg px-3.5 py-2.5 text-center", children: _jsxs("p", { className: twMerge(remainingTime.expired ||
|
|
24
24
|
status === 'COMPLETED' ||
|
|
25
25
|
status === 'FAILED'
|
|
26
26
|
? 'opacity-50 grayscale'
|
|
@@ -13,14 +13,12 @@ import { z } from 'zod';
|
|
|
13
13
|
import { useShallow } from 'zustand/shallow';
|
|
14
14
|
import { useControllableState } from '../../../client/hooks/useControllableState.js';
|
|
15
15
|
import { useCooldown } from '../../../client/hooks/useCooldown.js';
|
|
16
|
-
import { useFeatureFlag } from '../../../client/hooks/useFeatureFlag.js';
|
|
17
16
|
import { useGlobalStore } from '../../../client/hooks/useGlobalStore.js';
|
|
18
17
|
import { useLocaleInfo } from '../../../client/hooks/useLocaleInfo.js';
|
|
19
18
|
import { useMobileNumberParser } from '../../../client/hooks/useMobileNumberParser.js';
|
|
20
19
|
import { useSendVerificationCodeMutation } from '../../../client/hooks/useSendVerificationCodeMutation.js';
|
|
21
20
|
import { useSignInMutation } from '../../../client/hooks/useSignInMutation.js';
|
|
22
21
|
import { useSignUpMutation } from '../../../client/hooks/useSignUpMutation.js';
|
|
23
|
-
import { useUpdateAccountMutation } from '../../../client/hooks/useUpdateAccountMutation.js';
|
|
24
22
|
import { toaster } from '../../../client/utils/toaster.js';
|
|
25
23
|
import { ArrowLeftIcon } from '../../../icons/ArrowLeftIcon.js';
|
|
26
24
|
import { CalendarIcon } from '../../../icons/CalendarIcon.js';
|
|
@@ -43,7 +41,6 @@ import { createPoll } from '../../../utils/createPoll.js';
|
|
|
43
41
|
import { useSignUpDefaultPropsContext } from './SignUpDefaultContext.js';
|
|
44
42
|
export function SignUpDefaultForm() {
|
|
45
43
|
const signUpProps = useSignUpDefaultPropsContext();
|
|
46
|
-
const { enabled } = useFeatureFlag();
|
|
47
44
|
const branchCollection = createListCollection({
|
|
48
45
|
items: signUpProps.branches ?? [],
|
|
49
46
|
itemToValue: (item) => item.code,
|
|
@@ -59,11 +56,8 @@ export function SignUpDefaultForm() {
|
|
|
59
56
|
responsibleGaming: ctx.responsibleGaming,
|
|
60
57
|
})));
|
|
61
58
|
const search = useSearchParams();
|
|
62
|
-
const signUpMutation = useSignUpMutation(
|
|
63
|
-
meta: { cellxpertCxd: search.get('cxd') },
|
|
64
|
-
});
|
|
59
|
+
const signUpMutation = useSignUpMutation();
|
|
65
60
|
const signInMutation = useSignInMutation();
|
|
66
|
-
const updateAccountMutation = useUpdateAccountMutation();
|
|
67
61
|
const sendVerificationCodeMutation = useSendVerificationCodeMutation();
|
|
68
62
|
const localeInfo = useLocaleInfo();
|
|
69
63
|
const mobileNumberParser = useMobileNumberParser();
|
|
@@ -67,9 +67,7 @@ export function SignUpKYCForm() {
|
|
|
67
67
|
})));
|
|
68
68
|
const dialog = useDialogContext();
|
|
69
69
|
const search = useSearchParams();
|
|
70
|
-
const signUpMutation = useSignUpMutation(
|
|
71
|
-
meta: { cellxpertCxd: search.get('cxd') },
|
|
72
|
-
});
|
|
70
|
+
const signUpMutation = useSignUpMutation();
|
|
73
71
|
const signInMutation = useSignInMutation();
|
|
74
72
|
const updateAccountMutation = useUpdateAccountMutation();
|
|
75
73
|
const sendVerificationCodeMutation = useSendVerificationCodeMutation();
|
|
@@ -3,3 +3,4 @@ export const REFRESH_TOKEN_COOKIE_NAME = 'WebPortalAuthRefreshToken';
|
|
|
3
3
|
export const DOMAIN_COOKIE_NAME = 'WebPortalDomain';
|
|
4
4
|
export const BTAG_COOKIE_NAME = 'WebPortalBtag';
|
|
5
5
|
export const FEATURE_FLAG_LOCAL_STORAGE_KEY = 'WebPortalFeatureFlag';
|
|
6
|
+
export const CXD_STORAGE_KEY = 'WebPortalCellxpertCxd';
|
|
@@ -5,7 +5,6 @@ import { BTAG_COOKIE_NAME, DOMAIN_COOKIE_NAME } from '../constants/index.js';
|
|
|
5
5
|
const UpdateSessionDefinition = z.object({
|
|
6
6
|
domain: z.string().optional().nullable(),
|
|
7
7
|
btag: z.string().optional().nullable(),
|
|
8
|
-
cellxpertCxd: z.string().optional().nullable(),
|
|
9
8
|
});
|
|
10
9
|
export async function patchSession(request) {
|
|
11
10
|
const body = await request.json();
|
|
@@ -67,7 +67,7 @@ export declare const MEMBER = "\n query Member {\n member {\n dateTimeL
|
|
|
67
67
|
/**
|
|
68
68
|
* _aka_ `Query.self`
|
|
69
69
|
*/
|
|
70
|
-
export declare const MEMBER_ACCOUNT = "\n query MemberAccount {\n memberAccount: self {\n ... on MemberAccount {\n id\n name\n status\n realName\n emailAddress\n mobileNumber\n birthDay\n verified\n verificationStatus\n nickName\n validId\n mobileNumberVerified\n mobileNumberVerificationRequired\n transactionPassword\n secretAnswerSubmitted\n dateTimeCreated\n dateTimeLastUpdated\n googleId\n facebookId\n cellxpertDetails {\n cxd\n dateTimeLastUpdated \n
|
|
70
|
+
export declare const MEMBER_ACCOUNT = "\n query MemberAccount {\n memberAccount: self {\n ... on MemberAccount {\n id\n name\n status\n realName\n emailAddress\n mobileNumber\n birthDay\n verified\n verificationStatus\n nickName\n validId\n mobileNumberVerified\n mobileNumberVerificationRequired\n transactionPassword\n secretAnswerSubmitted\n dateTimeCreated\n dateTimeLastUpdated\n googleId\n facebookId\n cellxpertDetails {\n cxd\n dateTimeLastUpdated \n }\n }\n }\n }\n";
|
|
71
71
|
export declare const MEMBER_VERIFICATION = "\n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n query MemberVerification {\n memberAccount: self {\n ... on MemberAccount {\n verification {\n id\n status\n address\n permanentAddress\n sourceOfIncome\n natureOfWork\n nationality\n placeOfBirth\n idFrontImage {\n ...FileFragment\n }\n selfieImage {\n ...FileFragment\n }\n }\n }\n }\n }\n";
|
|
72
72
|
export declare const REGISTER_MEMBER_ACCOUNT = "\n mutation RegisterMemberAccount(\n $input: RegisterMemberAccountInput!\n $referralCode: String\n $verificationCode: String\n $reCAPTCHAResponse: String\n ) {\n registerMemberAccount(\n input: $input\n referralCode: $referralCode\n verificationCode: $verificationCode\n reCAPTCHAResponse: $reCAPTCHAResponse\n ) {\n ... on AccountNameNotAvailableError {\n name: __typename\n message\n }\n ... on InvalidPlatformError {\n name: __typename\n message\n }\n ... on InvalidPlatformError {\n name: __typename\n message\n }\n ... on InvalidReCAPTCHAResponseError {\n name: __typename\n message\n }\n ... on InvalidSMSVerificationCodeError {\n name: __typename\n message\n }\n ... on MinimumAgeRequirementError {\n name: __typename\n message\n }\n ... on MobileNumberNotAvailableError {\n name: __typename\n message\n }\n ... on ReCAPTCHAVerificationFailedError {\n name: __typename\n message\n }\n }\n }\n";
|
|
73
73
|
export declare const REGISTER_MEMBER_ACCOUNT_BY_NAME = "\n mutation RegisterMemberAccountByName(\n $input: RegisterMemberAccountByNameInput!\n $reCAPTCHAResponse: String!\n ) {\n registerMemberAccountByName(\n input: $input\n reCAPTCHAResponse: $reCAPTCHAResponse\n ) {\n ... on AccountNameNotAvailableError {\n name: __typename\n message\n }\n ... on InvalidPlatformError {\n name: __typename\n message\n }\n ... on InvalidReCAPTCHAResponseError {\n name: __typename\n message\n }\n }\n }\n";
|
package/dist/services/queries.js
CHANGED
package/dist/styles/theme.css
CHANGED
|
@@ -271,7 +271,10 @@
|
|
|
271
271
|
--color-border-brand-solid: #ca8504;
|
|
272
272
|
--color-border-dark: #373A41;
|
|
273
273
|
|
|
274
|
+
|
|
274
275
|
--color-border-checkbox-primary: #373a41;
|
|
276
|
+
--color-bg-progress-bar-primary: var(--color-bg-primary);
|
|
277
|
+
|
|
275
278
|
|
|
276
279
|
--font-sans: var(--font-sans);
|
|
277
280
|
--font-mono: var(--font-mono);
|
package/dist/types/index.d.ts
CHANGED
|
@@ -10,13 +10,11 @@ export type Session = {
|
|
|
10
10
|
token: string;
|
|
11
11
|
domain?: string;
|
|
12
12
|
btag?: never;
|
|
13
|
-
cellxpertCxd?: never;
|
|
14
13
|
} | {
|
|
15
14
|
status: 'unauthenticated';
|
|
16
15
|
token?: never;
|
|
17
16
|
domain?: string;
|
|
18
17
|
btag?: string;
|
|
19
|
-
cellxpertCxd?: string;
|
|
20
18
|
};
|
|
21
19
|
/**
|
|
22
20
|
* ------------------------------------------------------------
|