@opexa/portal-components 0.0.38 → 0.0.41
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 -2
- package/dist/client/hooks/useGlobalStore.js +19 -36
- package/dist/components/Account/Account.d.ts +1 -7
- package/dist/components/Account/Account.js +15 -40
- package/dist/components/AccountInfo/AccountInfo.js +20 -3
- package/dist/components/AccountSecurity/AccountSecurity.js +14 -6
- package/dist/components/AccountVerification/AccountVerification.js +5 -32
- package/dist/components/AccountVerification/AccountVerificationContext.d.ts +14 -0
- package/dist/components/AccountVerification/AccountVerificationContext.js +27 -0
- package/dist/components/AccountVerification/VerificationCapture.d.ts +1 -1
- package/dist/components/AccountVerification/VerificationCapture.js +16 -45
- package/dist/components/AccountVerification/VerificationComplete.d.ts +1 -0
- package/dist/components/AccountVerification/VerificationComplete.js +9 -0
- package/dist/components/AccountVerification/VerificationDetails.d.ts +1 -0
- package/dist/components/AccountVerification/VerificationDetails.js +38 -0
- package/dist/components/DepositWithdrawal/AmountChoices.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/AvailablePromos.js +21 -16
- package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +4 -23
- package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.js +4 -23
- package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +4 -23
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.js +5 -24
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.js +4 -23
- package/dist/components/DepositWithdrawal/DepositWithdrawal.js +3 -3
- package/dist/components/DepositWithdrawal/PaymentMethods.js +2 -2
- package/dist/components/DepositWithdrawal/Withdrawal/Withdrawal.js +27 -20
- package/dist/components/GameLaunch/GameLaunch.js +33 -57
- package/dist/components/KYC/KYC.d.ts +1 -0
- package/dist/components/KYC/KYC.js +3 -0
- package/dist/components/KYC/index.d.ts +1 -0
- package/dist/components/KYC/index.js +1 -0
- package/dist/components/Messages/MessageItem.js +12 -7
- package/dist/components/Messages/MessagePopup.js +8 -7
- package/dist/components/PortalProvider/PortalProvider.d.ts +2 -2
- package/dist/components/PortalProvider/PortalProvider.js +8 -5
- package/dist/components/PortalProvider/Providers.d.ts +4 -0
- package/dist/components/PortalProvider/Providers.js +12 -0
- package/dist/components/PortalProvider/Snackbar.d.ts +1 -0
- package/dist/components/PortalProvider/Snackbar.js +21 -0
- package/dist/components/PortalProvider/WebVitals.d.ts +1 -0
- package/dist/components/PortalProvider/WebVitals.js +8 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/images/gift.png +0 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/ui/AlertDialog/AlertDialog.d.ts +154 -154
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +14 -14
- package/dist/ui/AlertDialog/alertDialog.recipe.js +4 -4
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Button/button.recipe.js +1 -1
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Checkbox/checkbox.recipe.js +2 -2
- 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 +196 -196
- package/dist/ui/Combobox/combobox.recipe.d.ts +14 -14
- package/dist/ui/DatePicker/DatePicker.d.ts +192 -192
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +8 -8
- 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/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/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.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 +7 -6
|
@@ -1,34 +1,18 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { Dialog, Portal
|
|
4
|
-
import { useRef } from 'react';
|
|
3
|
+
import { Dialog, Portal } from '@ark-ui/react';
|
|
5
4
|
import { twMerge } from 'tailwind-merge';
|
|
6
5
|
import { useShallow } from 'zustand/shallow';
|
|
7
6
|
import { useDisclosure, useEndGameSessionMutation, useFavoriteGamesQuery, useGlobalStore, useMarkGameAsFavoriteMutation, useUnmarkGameAsFavoriteMutation, } from '../../client/hooks/index.js';
|
|
8
|
-
import { AlertCircleIcon, ChevronLeftIcon, CoinsHandIcon, Expand03Icon, SpinnerIcon, Star01Icon, XIcon, } from '../../icons/index.js';
|
|
9
|
-
import { AlertDialog, Button, IconButton } from '../../ui/index.js';
|
|
7
|
+
import { AlertCircleIcon, ChevronDownIcon, ChevronLeftIcon, CoinsHandIcon, Expand03Icon, SpinnerIcon, Star01Icon, XIcon, } from '../../icons/index.js';
|
|
8
|
+
import { AlertDialog, Button, IconButton, Presence } from '../../ui/index.js';
|
|
10
9
|
export function GameLaunch() {
|
|
11
|
-
const ref = useRef(null);
|
|
12
|
-
const maximizeDisclosure = useDisclosure({
|
|
13
|
-
defaultOpen: true,
|
|
14
|
-
onOpenChange(open) {
|
|
15
|
-
if (!open) {
|
|
16
|
-
setTimeout(() => {
|
|
17
|
-
ref.current?.scrollIntoView({
|
|
18
|
-
behavior: 'smooth',
|
|
19
|
-
block: 'start',
|
|
20
|
-
inline: 'start',
|
|
21
|
-
});
|
|
22
|
-
}, 25);
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
const cancelDisclosure = useDisclosure();
|
|
27
|
-
const endGameSessionMutation = useEndGameSessionMutation();
|
|
28
10
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
29
11
|
gameLaunch: ctx.gameLaunch,
|
|
30
12
|
depositWithdrawal: ctx.depositWithdrawal,
|
|
31
13
|
})));
|
|
14
|
+
const maximizeDisclosure = useDisclosure({ defaultOpen: true });
|
|
15
|
+
const cancelDisclosure = useDisclosure();
|
|
32
16
|
async function endGameSession() {
|
|
33
17
|
if (globalStore.gameLaunch.details.status === 'PLAYING') {
|
|
34
18
|
await endGameSessionMutation.mutateAsync({
|
|
@@ -45,6 +29,7 @@ export function GameLaunch() {
|
|
|
45
29
|
}
|
|
46
30
|
const favoriteGamesQuery = useFavoriteGamesQuery();
|
|
47
31
|
const favoriteGames = favoriteGamesQuery.data ?? [];
|
|
32
|
+
const endGameSessionMutation = useEndGameSessionMutation();
|
|
48
33
|
const markGameAsFavoriteMutation = useMarkGameAsFavoriteMutation();
|
|
49
34
|
const unmarkGameAsFavoriteMutation = useUnmarkGameAsFavoriteMutation();
|
|
50
35
|
const markedAsFavorite = favoriteGames.some((favoriteGame) => {
|
|
@@ -54,43 +39,34 @@ export function GameLaunch() {
|
|
|
54
39
|
? favoriteGame.id === globalStore.gameLaunch.details.game.reference
|
|
55
40
|
: favoriteGame.id === globalStore.gameLaunch.details.game.id;
|
|
56
41
|
});
|
|
57
|
-
return (_jsxs(_Fragment, { children: [
|
|
58
|
-
!
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
endGameSession();
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
cancelDisclosure.setOpen(true);
|
|
87
|
-
}, disabled: globalStore.gameLaunch.details.status === 'LOADING', title: "Quit", "aria-label": "Quit Game", children: _jsx(ChevronLeftIcon, { className: "size-5" }) }), _jsx("div", { className: "grow" }), _jsx(IconButton, { size: "xs", variant: "outline", children: _jsx(Star01Icon, { className: twMerge('size-5', markedAsFavorite
|
|
88
|
-
? 'text-yellow-400 fill-yellow-400'
|
|
89
|
-
: 'text-inherit') }) }), _jsx(IconButton, { size: "xs", variant: "outline", onClick: () => maximizeDisclosure.setOpen(false), title: "Minimize", "aria-label": "Minimize", children: _jsx(Expand03Icon, { className: "size-5" }) }), _jsx(IconButton, { size: "xs", fullWidth: false, onClick: () => {
|
|
90
|
-
globalStore.depositWithdrawal.setOpen(true);
|
|
91
|
-
}, children: _jsx(CoinsHandIcon, { className: "size-5" }) })] }), _jsxs("section", { className: "grow", children: [globalStore.gameLaunch.details.status === 'LOADING' && (_jsx("div", { className: "flex size-full items-center justify-center", children: _jsx(SpinnerIcon, { className: "size-8" }) })), globalStore.gameLaunch.details.status === 'FAILED' && (_jsx("div", {})), globalStore.gameLaunch.details.status === 'PLAYING' && (_jsx("iframe", { src: globalStore.gameLaunch.details.session.launchUrl ?? '', className: "size-full" }))] })] }) }) }) }), _jsx(AlertDialog.Root, { role: "alertdialog", open: cancelDisclosure.open, onOpenChange: (details) => {
|
|
42
|
+
return (_jsxs(_Fragment, { children: [_jsx(Dialog.Root, { open: globalStore.gameLaunch.details.status !== 'WAITING' &&
|
|
43
|
+
!cancelDisclosure.open, lazyMount: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsx(Portal, { children: _jsx(Dialog.Positioner, { className: "z-dialog fixed inset-0", children: _jsxs(Dialog.Content, { className: "ui-open:animate-dialog-in ui-closed:animate-dialog-out bg-bg-primary-alt relative size-full", children: [_jsx(Presence, { asChild: true, lazyMount: true, unmountOnExit: true, present: !maximizeDisclosure.open, children: _jsxs("section", { className: "ui-open:animate-slide-in-down ui-closed:animate-slide-out-down bg-bg-primary-alt z-1 absolute left-0 top-0 flex h-[3.25rem] w-full items-center gap-2 px-4 py-2", children: [_jsx(IconButton, { size: "xs", variant: "outline", onClick: () => {
|
|
44
|
+
if (globalStore.gameLaunch.details.status !== 'PLAYING') {
|
|
45
|
+
endGameSession();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
cancelDisclosure.setOpen(true);
|
|
49
|
+
}, disabled: globalStore.gameLaunch.details.status === 'LOADING', children: _jsx(ChevronLeftIcon, { className: "size-5" }) }), _jsx("div", { className: "grow" }), _jsx(IconButton, { size: "xs", variant: "outline", disabled: unmarkGameAsFavoriteMutation.isPending ||
|
|
50
|
+
markGameAsFavoriteMutation.isPending, onClick: () => {
|
|
51
|
+
if (!globalStore.gameLaunch.details.game)
|
|
52
|
+
return;
|
|
53
|
+
if (markedAsFavorite) {
|
|
54
|
+
unmarkGameAsFavoriteMutation.mutate('reference' in globalStore.gameLaunch.details.game
|
|
55
|
+
? globalStore.gameLaunch.details.game.reference
|
|
56
|
+
: globalStore.gameLaunch.details.game.id);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
markGameAsFavoriteMutation.mutate('reference' in globalStore.gameLaunch.details.game
|
|
60
|
+
? globalStore.gameLaunch.details.game.reference
|
|
61
|
+
: globalStore.gameLaunch.details.game.id);
|
|
62
|
+
}
|
|
63
|
+
}, children: _jsx(Star01Icon, { className: twMerge('size-5', markedAsFavorite
|
|
64
|
+
? 'text-yellow-400 fill-yellow-400'
|
|
65
|
+
: 'text-inherit') }) }), _jsx(IconButton, { size: "xs", variant: "outline", onClick: () => maximizeDisclosure.setOpen(true), children: _jsx(Expand03Icon, { className: "size-5" }) }), _jsx(IconButton, { size: "xs", fullWidth: false, onClick: () => {
|
|
66
|
+
globalStore.depositWithdrawal.setOpen(true);
|
|
67
|
+
}, children: _jsx(CoinsHandIcon, { className: "size-5" }) })] }) }), _jsx(Presence, { asChild: true, lazyMount: true, unmountOnExit: true, present: maximizeDisclosure.open, children: _jsx("button", { type: "button", onClick: () => maximizeDisclosure.setOpen(false), className: "shadow-xs ui-open:animate-slide-in-down ui-closed:animate-slide-out-down z-1 absolute left-1/2 top-0 flex h-7.5 w-[4.5rem] -translate-x-1/2 items-center justify-center rounded-b-md bg-white/30 backdrop-blur-sm", children: _jsx(ChevronDownIcon, {}) }) }), _jsxs("section", { className: "size-full", children: [globalStore.gameLaunch.details.status === 'LOADING' && (_jsx("div", { className: "flex size-full items-center justify-center", children: _jsx(SpinnerIcon, { className: "size-8" }) })), globalStore.gameLaunch.details.status === 'FAILED' && (_jsx("div", {})), globalStore.gameLaunch.details.status === 'PLAYING' && (_jsx("iframe", { src: globalStore.gameLaunch.details.session.launchUrl ?? '', className: "size-full" }))] })] }) }) }) }), _jsx(AlertDialog.Root, { role: "alertdialog", open: cancelDisclosure.open, onOpenChange: (details) => {
|
|
92
68
|
cancelDisclosure.setOpen(details.open);
|
|
93
|
-
}, lazyMount: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, {}), _jsx(AlertDialog.Positioner, { children: _jsxs(AlertDialog.Content, { children: [
|
|
69
|
+
}, lazyMount: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, {}), _jsx(AlertDialog.Positioner, { children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(AlertDialog.Header, { children: _jsx("div", { className: "bg-bg-error-secondary text-text-featured-icon-light-error flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, { className: "size-6" }) }) }), _jsxs(AlertDialog.Body, { children: [_jsx(AlertDialog.Title, { children: "Quit Game" }), _jsx(AlertDialog.Description, { children: "Are you sure you want to quit?" })] }), _jsx(AlertDialog.Context, { children: (api) => (_jsxs(AlertDialog.Footer, { children: [_jsx(Button, { variant: "outline", colorScheme: "gray", disabled: endGameSessionMutation.isPending, onClick: () => {
|
|
94
70
|
api.setOpen(false);
|
|
95
71
|
}, children: "Cancel" }), _jsx(Button, { colorScheme: "danger", disabled: endGameSessionMutation.isPending, onClick: async () => {
|
|
96
72
|
await endGameSession();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function KYC(): null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './KYC';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './KYC.js';
|
|
@@ -6,21 +6,26 @@ import { useShallow } from 'zustand/shallow';
|
|
|
6
6
|
import { useGlobalStore, useLocaleInfo, useMarkMessageAsReadMutation, } from '../../client/hooks/index.js';
|
|
7
7
|
import { getMessageIcon } from '../../components/Messages/utils.js';
|
|
8
8
|
export function MessageItem({ message }) {
|
|
9
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
/**/
|
|
11
|
+
id, icon, title, content, actions, markedAsRead, dateTimeCreated, } = message;
|
|
10
12
|
const localeInfo = useLocaleInfo();
|
|
11
|
-
const
|
|
13
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
14
|
+
message: ctx.message,
|
|
15
|
+
messages: ctx.messages,
|
|
16
|
+
})));
|
|
12
17
|
const { mutate } = useMarkMessageAsReadMutation();
|
|
13
18
|
const Icon = getMessageIcon(icon);
|
|
14
19
|
const handleViewMessage = async () => {
|
|
15
20
|
mutate(id);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
globalStore.message.setData(message);
|
|
22
|
+
globalStore.message.setOpen(true);
|
|
23
|
+
globalStore.messages.setOpen(false);
|
|
19
24
|
};
|
|
20
25
|
const handleActionClick = (e) => {
|
|
21
26
|
e.stopPropagation();
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
globalStore.messages.setOpen(false);
|
|
28
|
+
globalStore.messages.setTab('ALL');
|
|
24
29
|
};
|
|
25
30
|
return (_jsxs("div", { role: "button", tabIndex: 0, className: "border-border-secondary rounded-xs bg-bg-secondary flex h-auto flex-shrink-0 cursor-pointer flex-col border px-3.5 py-2.5", onClick: handleViewMessage, "aria-pressed": "false", children: [_jsxs("div", { className: "flex items-center space-x-2", children: [_jsx("p", { className: "text-text-tertiary-600 text-xs font-normal", children: format(new Date(dateTimeCreated), 'M/d/yyyy - h:mma', {
|
|
26
31
|
in: tz(localeInfo.timezone),
|
|
@@ -7,12 +7,13 @@ import { XIcon } from '../../icons/index.js';
|
|
|
7
7
|
import { Dialog } from '../../ui/index.js';
|
|
8
8
|
import { getMessageIcon } from './utils.js';
|
|
9
9
|
export const MessagePopup = () => {
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({ message: ctx.message })));
|
|
11
|
+
const Icon = getMessageIcon(globalStore.message.data?.icon ?? 'MESSAGE');
|
|
12
|
+
return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: globalStore.message.open, onOpenChange: ({ open }) => {
|
|
13
|
+
globalStore.message.setOpen(open);
|
|
14
|
+
}, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "min-h-auto mx-auto min-w-[21.438rem] max-w-[21.438rem] rounded-xl px-xl pb-0 pt-5 shadow-xl", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "pb-6", children: [_jsx("div", { className: "bg-bg-brand-secondary mx-auto w-fit rounded-full p-3", children: _jsx(Icon, { className: "text-text-brand", height: "24", width: "24" }) }), _jsx("p", { className: "text-text-primary-brand mt-lg text-center text-lg font-semibold leading-tight", children: globalStore.message.data?.title }), _jsx("div", { className: "text-shadow-text-secondary-700 mt-xs text-center text-sm font-normal leading-tight", dangerouslySetInnerHTML: {
|
|
15
|
+
__html: globalStore.message.data?.content ?? '',
|
|
16
|
+
} })] }), globalStore.message.data?.actions.length ? (_jsx("div", { className: "flex flex-col space-y-2 px-4 pb-8 pt-6 text-center", children: globalStore.message.data.actions.map((action, index) => (_jsx(Link, { className: "bg-button-primary-bg rounded-xs text-button-primary-fg w-full px-4 py-2.5 text-base font-semibold", href: action.url, onClick: () => {
|
|
17
|
+
globalStore.message.setOpen(false);
|
|
17
18
|
}, children: action.name }, index))) })) : null] }) })] }) }));
|
|
18
19
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
2
|
export interface PortalProviderProps {
|
|
3
3
|
googleAnalyticsId?: string;
|
|
4
4
|
googleTagManagerId?: string;
|
|
@@ -6,4 +6,4 @@ export interface PortalProviderProps {
|
|
|
6
6
|
facebookPixelId?: string;
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
}
|
|
9
|
-
export declare function PortalProvider({ children,
|
|
9
|
+
export declare function PortalProvider({ children, facebookPixelId, googleAnalyticsId, googleTagManagerId, googleRecaptchaSiteKey, }: PortalProviderProps): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { GoogleAnalytics, GoogleTagManager } from '@next/third-parties/google';
|
|
2
3
|
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
|
|
3
|
-
import {} from 'react';
|
|
4
4
|
import { prefetchAccountQuery, prefetchSessionQuery, prefetchWalletQuery, } from '../../server/utils/index.js';
|
|
5
|
+
import { FacebookPixel, GoogleRecaptcha } from '../../third-parties/index.js';
|
|
5
6
|
import { getQueryClient } from '../../utils/index.js';
|
|
6
|
-
import {
|
|
7
|
-
|
|
7
|
+
import { Providers } from './Providers.js';
|
|
8
|
+
import { Snackbar } from './Snackbar.js';
|
|
9
|
+
import { WebVitals } from './WebVitals.js';
|
|
10
|
+
export async function PortalProvider({ children, facebookPixelId, googleAnalyticsId, googleTagManagerId, googleRecaptchaSiteKey, }) {
|
|
8
11
|
const queryClient = getQueryClient();
|
|
9
12
|
await Promise.all([
|
|
10
13
|
prefetchSessionQuery(),
|
|
11
14
|
prefetchAccountQuery(),
|
|
12
15
|
prefetchWalletQuery(),
|
|
13
16
|
]);
|
|
14
|
-
return (
|
|
17
|
+
return (_jsxs(_Fragment, { children: [_jsx(Providers, { children: _jsx(HydrationBoundary, { state: dehydrate(queryClient), children: children }) }), _jsx(Snackbar, {}), _jsx(WebVitals, {}), facebookPixelId && _jsx(FacebookPixel, { fbId: facebookPixelId }), googleAnalyticsId && _jsx(GoogleAnalytics, { gaId: googleAnalyticsId }), googleTagManagerId && _jsx(GoogleTagManager, { gtmId: googleTagManagerId }), googleRecaptchaSiteKey && (_jsx(GoogleRecaptcha, { siteKey: googleRecaptchaSiteKey }))] }));
|
|
15
18
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { QueryClientProvider } from '@tanstack/react-query';
|
|
4
|
+
import dynamic from 'next/dynamic';
|
|
5
|
+
import { getQueryClient } from '../../utils/index.js';
|
|
6
|
+
const ThemeProvider = dynamic(() => import('next-themes').then((mod) => mod.ThemeProvider), {
|
|
7
|
+
ssr: false,
|
|
8
|
+
});
|
|
9
|
+
export function Providers({ children }) {
|
|
10
|
+
const queryClient = getQueryClient();
|
|
11
|
+
return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(ThemeProvider, { attribute: "class", storageKey: "WebPortalTheme", enableSystem: false, enableColorScheme: false, defaultTheme: "dark", disableTransitionOnChange: true, children: children }) }));
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Snackbar(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Toast, Toaster } from '@ark-ui/react';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { toaster } from '../../client/utils/index.js';
|
|
6
|
+
import { AlertCircleIcon, XIcon } from '../../icons/index.js';
|
|
7
|
+
export function Snackbar() {
|
|
8
|
+
return (_jsx(Toaster, { toaster: toaster, children: (toast) => (_jsxs(Toast.Root, { className: twMerge('group', 'p-xl', 'border', 'border-border-primary', 'bg-bg-primary-alt', 'flex', 'items-start', 'gap-lg', 'w-[21.438rem]', 'lg:w-[1200px]', 'max-w-full', 'rounded-xl', 'shadow-xs', 'h-[var(--height)]', 'z-[var(--z-index)]', 'scale-[var(--scale)]', 'opacity-[var(--opacity)]', '[translate:var(--x)_var(--y)_0]', 'transition-all', 'duration-300'), children: [_jsxs("div", { className: "flex grow flex-col gap-xl lg:flex-row lg:gap-lg", children: [_jsx("div", { className: twMerge('flex', 'items-center', 'justify-center', 'size-9.5', 'border-2', 'rounded-full', toast.type === 'success' && 'border-text-success-primary/15', toast.type === 'warning' && 'border-text-warning-primary/15', toast.type === 'error' && 'border-text-error-primary/15'), children: _jsx("div", { className: twMerge('flex', 'items-center', 'justify-center', 'size-7', 'border-2', 'rounded-full', toast.type === 'success' && 'border-text-success-primary/35', toast.type === 'warning' && 'border-text-warning-primary/35', toast.type === 'error' && 'border-text-error-primary/35'), children: _jsx(AlertCircleIcon, { className: twMerge('size-5', toast.type === 'success' && 'text-text-success-primary', toast.type === 'warning' && 'text-text-warning-primary', toast.type === 'error' && 'text-text-error-primary') }) }) }), _jsxs("div", { className: "grow text-sm leading-none", children: [_jsx(Toast.Title, { className: "text-text-secondary-700 font-semibold", children: toast.title
|
|
9
|
+
? toast.title
|
|
10
|
+
: toast.type === 'error'
|
|
11
|
+
? 'Error'
|
|
12
|
+
: toast.type === 'warning'
|
|
13
|
+
? 'Warning'
|
|
14
|
+
: 'Success' }), _jsx(Toast.Description, { className: "text-text-tertiary-600 mt-xs", children: toast.description
|
|
15
|
+
? toast.description
|
|
16
|
+
: toast.type === 'error'
|
|
17
|
+
? 'Something went wrong.'
|
|
18
|
+
: toast.type === 'warning'
|
|
19
|
+
? 'Please be cautious.'
|
|
20
|
+
: 'Operation completed successfully.' })] })] }), _jsx(Toast.CloseTrigger, { className: "text-text-secondary-700", children: _jsx(XIcon, { className: "size-5" }) })] }, toast.id)) }));
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function WebVitals(): null;
|
package/dist/components/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export * from './Games/index.js';
|
|
|
16
16
|
export * from './GamesSearch/index.js';
|
|
17
17
|
export * from './JackpotCounter/index.js';
|
|
18
18
|
export * from './Jackpots/index.js';
|
|
19
|
+
export * from './KYC/index.js';
|
|
19
20
|
export * from './Marquee/index.js';
|
|
20
21
|
export * from './Messages/index.js';
|
|
21
22
|
export * from './PortalProvider/index.js';
|
|
Binary file
|