@opexa/portal-components 0.0.1082 → 0.0.1084
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 +2 -0
- package/dist/client/hooks/useGlobalStore.js +6 -0
- package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.d.ts +3 -0
- package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.js +2 -2
- package/dist/components/DepositWithdrawal/DepositWithdrawalTrigger.d.ts +2 -1
- package/dist/components/DepositWithdrawal/DepositWithdrawalTrigger.js +2 -2
- package/dist/components/KYC/KYCDefault/PersonalInformation.js +7 -0
- package/dist/components/Messages/MessagesPopup.js +4 -2
- package/dist/components/SignUp/SignUpDefault/SignUpDefaultForm.js +2 -0
- package/package.json +1 -1
|
@@ -94,6 +94,8 @@ export interface GlobalStore {
|
|
|
94
94
|
bankInformationDetails: PopupStore;
|
|
95
95
|
isNonRegulated: boolean;
|
|
96
96
|
setIsNonRegulated: (isNonRegulated: boolean) => void;
|
|
97
|
+
firstTimeSignUp: boolean;
|
|
98
|
+
setFirstTimeSignUp: (firstTimeSignUp: boolean) => void;
|
|
97
99
|
reset: () => void;
|
|
98
100
|
}
|
|
99
101
|
export declare const useGlobalStore: import("zustand").UseBoundStore<Omit<Omit<import("zustand").StoreApi<GlobalStore>, "setState" | "devtools"> & {
|
|
@@ -509,6 +509,11 @@ export const useGlobalStore = create()(devtools(subscribeWithSelector((set) => (
|
|
|
509
509
|
...state,
|
|
510
510
|
isNonRegulated,
|
|
511
511
|
})),
|
|
512
|
+
firstTimeSignUp: false,
|
|
513
|
+
setFirstTimeSignUp: (firstTimeSignUp) => set((state) => ({
|
|
514
|
+
...state,
|
|
515
|
+
firstTimeSignUp,
|
|
516
|
+
})),
|
|
512
517
|
reset: () => {
|
|
513
518
|
set((state) => ({
|
|
514
519
|
...state,
|
|
@@ -608,6 +613,7 @@ export const useGlobalStore = create()(devtools(subscribeWithSelector((set) => (
|
|
|
608
613
|
open: false,
|
|
609
614
|
'~touched': false,
|
|
610
615
|
},
|
|
616
|
+
firstTimeSignUp: false,
|
|
611
617
|
}));
|
|
612
618
|
},
|
|
613
619
|
}))));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
1
2
|
import { type BypassDomainConfig } from '../../client/hooks/useBypassKycChecker';
|
|
2
3
|
import type { PaymentMethod } from './utils';
|
|
3
4
|
export interface DepositWithdrawalProps {
|
|
@@ -25,5 +26,7 @@ export interface DepositWithdrawalProps {
|
|
|
25
26
|
* "/hello/:id/world"
|
|
26
27
|
*/
|
|
27
28
|
depositSuccessPageUrl?: string;
|
|
29
|
+
/** @default "Convenience Fee may apply" */
|
|
30
|
+
note?: ReactNode;
|
|
28
31
|
}
|
|
29
32
|
export declare function DepositWithdrawal(props: DepositWithdrawalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -21,7 +21,7 @@ import { HasPendingBonuses } from './HasPendingBonuses.js';
|
|
|
21
21
|
import { Withdrawal } from './Withdrawal/Withdrawal.js';
|
|
22
22
|
export function DepositWithdrawal(props) {
|
|
23
23
|
const bypassDepositKycCheck = useBypassKycChecker(props.bypassDomains) || props.bypassDepositKycCheck;
|
|
24
|
-
const { hasPrivacyPolicyAndTermsOfUse = true, isOfWinSite = false, ...restProps } = props;
|
|
24
|
+
const { hasPrivacyPolicyAndTermsOfUse = true, isOfWinSite = false, note = null, ...restProps } = props;
|
|
25
25
|
const mergedProps = {
|
|
26
26
|
...restProps,
|
|
27
27
|
hasPrivacyPolicyAndTermsOfUse,
|
|
@@ -67,5 +67,5 @@ export function DepositWithdrawal(props) {
|
|
|
67
67
|
currency: localeInfo.currency.code,
|
|
68
68
|
minDecimalPlaces: 2,
|
|
69
69
|
truncate: false
|
|
70
|
-
}) }), _jsxs(Tabs.Root, { value: globalStore.depositWithdrawal.tab, onValueChange: handleTabChange, lazyMount: true, unmountOnExit: true, className: "mt-3xl space-y-4xl", children: [_jsxs(Tabs.List, { className: "w-full", children: [_jsx(Tabs.Trigger, { value: "DEPOSIT", className: "grow", children: "Deposit" }), _jsx(Tabs.Trigger, { value: "WITHDRAWAL", className: "grow", children: "Withdrawal" }), _jsx(Tabs.Indicator, {})] }), _jsx(Tabs.Content, { value: "DEPOSIT", className: "space-y-3xl", children: _jsx(Deposit, {}) }), _jsx(Tabs.Content, { value: "WITHDRAWAL", className: "space-y-3xl", children: _jsx(Withdrawal, {}) })] })] })] }) })] }) }) }), _jsx(HasPendingBonuses, {})] }));
|
|
70
|
+
}) }), note ? (_jsx("p", { className: "text-center text-xs text-text-secondary-700", children: note })) : null, _jsxs(Tabs.Root, { value: globalStore.depositWithdrawal.tab, onValueChange: handleTabChange, lazyMount: true, unmountOnExit: true, className: "mt-3xl space-y-4xl", children: [_jsxs(Tabs.List, { className: "w-full", children: [_jsx(Tabs.Trigger, { value: "DEPOSIT", className: "grow", children: "Deposit" }), _jsx(Tabs.Trigger, { value: "WITHDRAWAL", className: "grow", children: "Withdrawal" }), _jsx(Tabs.Indicator, {})] }), _jsx(Tabs.Content, { value: "DEPOSIT", className: "space-y-3xl", children: _jsx(Deposit, {}) }), _jsx(Tabs.Content, { value: "WITHDRAWAL", className: "space-y-3xl", children: _jsx(Withdrawal, {}) })] })] })] }) })] }) }) }), _jsx(HasPendingBonuses, {})] }));
|
|
71
71
|
}
|
|
@@ -2,5 +2,6 @@ import type { ComponentPropsWithRef } from 'react';
|
|
|
2
2
|
export interface DepositWithdrawalTriggerProps extends ComponentPropsWithRef<'button'> {
|
|
3
3
|
asChild?: boolean;
|
|
4
4
|
colorScheme?: 'primary' | 'dark';
|
|
5
|
+
label?: string;
|
|
5
6
|
}
|
|
6
|
-
export declare function DepositWithdrawalTrigger({ asChild, children, colorScheme, ...props }: DepositWithdrawalTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function DepositWithdrawalTrigger({ asChild, children, colorScheme, label, ...props }: DepositWithdrawalTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,7 +10,7 @@ import { useSessionQuery } from '../../client/hooks/useSessionQuery.js';
|
|
|
10
10
|
import { useWalletQuery } from '../../client/hooks/useWalletQuery.js';
|
|
11
11
|
import { formatNumber } from '../../utils/formatNumber.js';
|
|
12
12
|
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
13
|
-
export function DepositWithdrawalTrigger({ asChild, children, colorScheme = 'primary', ...props }) {
|
|
13
|
+
export function DepositWithdrawalTrigger({ asChild, children, colorScheme = 'primary', label = 'Deposit', ...props }) {
|
|
14
14
|
const sessionQuery = useSessionQuery();
|
|
15
15
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
16
16
|
depositWithdrawal: ctx.depositWithdrawal,
|
|
@@ -38,5 +38,5 @@ export function DepositWithdrawalTrigger({ asChild, children, colorScheme = 'pri
|
|
|
38
38
|
currency: localeInfo.currency.code,
|
|
39
39
|
minDecimalPlaces: 2,
|
|
40
40
|
truncate: false
|
|
41
|
-
}) }), _jsx("div", { className: "flex h-10 items-center gap-1.5 rounded-r-md bg-button-primary-bg px-3.5 font-semibold text-button-primary-fg text-sm", children:
|
|
41
|
+
}) }), _jsx("div", { className: "flex h-10 items-center gap-1.5 rounded-r-md bg-button-primary-bg px-3.5 font-semibold text-button-primary-fg text-sm", children: label })] })) }));
|
|
42
42
|
}
|
|
@@ -111,6 +111,9 @@ export function PersonalInformation() {
|
|
|
111
111
|
kyc: ctx.kyc,
|
|
112
112
|
kycReminder: ctx.kycReminder,
|
|
113
113
|
kycAccountVerificationRequired: ctx.kycAccountVerificationRequired,
|
|
114
|
+
disclaimer: ctx.disclaimer,
|
|
115
|
+
firstTimeSignUp: ctx.firstTimeSignUp,
|
|
116
|
+
setFirstTimeSignUp: ctx.setFirstTimeSignUp,
|
|
114
117
|
})));
|
|
115
118
|
const memberVerificationQuery = useMemberVerificationQuery();
|
|
116
119
|
const memberVerificationId = memberVerificationQuery.data?.id;
|
|
@@ -158,6 +161,10 @@ export function PersonalInformation() {
|
|
|
158
161
|
if (accountQuery.data?.status === 'VERIFICATION_LOCKED') {
|
|
159
162
|
globalStore.kycReminder.setOpen(true);
|
|
160
163
|
}
|
|
164
|
+
if (globalStore.firstTimeSignUp) {
|
|
165
|
+
globalStore.disclaimer.setOpen(true);
|
|
166
|
+
globalStore.setFirstTimeSignUp(false);
|
|
167
|
+
}
|
|
161
168
|
toaster.success({
|
|
162
169
|
title: 'Success',
|
|
163
170
|
description: 'Personal information has been set successfully.',
|
|
@@ -38,6 +38,7 @@ export function MessagesPopup() {
|
|
|
38
38
|
responsibleGamingReminder: ctx.responsibleGamingReminder,
|
|
39
39
|
signIn: ctx.signIn,
|
|
40
40
|
signUp: ctx.signUp,
|
|
41
|
+
disclaimer: ctx.disclaimer,
|
|
41
42
|
})));
|
|
42
43
|
const markMessageAsReadMutation = useMarkMessageAsReadMutation();
|
|
43
44
|
const accountQuery = useAccountQuery();
|
|
@@ -86,8 +87,9 @@ export function MessagesPopup() {
|
|
|
86
87
|
!globalStore.account__mobile.open &&
|
|
87
88
|
!globalStore.kyc.open &&
|
|
88
89
|
!globalStore.kycReminder.open &&
|
|
89
|
-
!globalStore.responsibleGamingReminder.open
|
|
90
|
-
|
|
90
|
+
!globalStore.responsibleGamingReminder.open &&
|
|
91
|
+
!globalStore.disclaimer.open,
|
|
92
|
+
refetchInterval: disclosure.open ? undefined : 2000 * 10,
|
|
91
93
|
});
|
|
92
94
|
const messages = messagesQuery.data?.pages.flatMap((page) => page.edges
|
|
93
95
|
.filter((edge) => globalStore.gameLaunch.details.status === 'PLAYING'
|
|
@@ -61,6 +61,7 @@ export function SignUpDefaultForm() {
|
|
|
61
61
|
responsibleGaming: ctx.responsibleGaming,
|
|
62
62
|
kyc: ctx.kyc,
|
|
63
63
|
termsOfUse: ctx.termsOfUse,
|
|
64
|
+
setFirstTimeSignUp: ctx.setFirstTimeSignUp,
|
|
64
65
|
})));
|
|
65
66
|
const search = useSearchParams();
|
|
66
67
|
const signUpMutation = useSignUpMutation();
|
|
@@ -338,6 +339,7 @@ export function SignUpDefaultForm() {
|
|
|
338
339
|
return;
|
|
339
340
|
}
|
|
340
341
|
globalStore.signUp.setOpen(false);
|
|
342
|
+
globalStore.setFirstTimeSignUp(true);
|
|
341
343
|
step1Form.reset();
|
|
342
344
|
step2Form.reset();
|
|
343
345
|
setStep(1);
|