@opexa/portal-components 0.0.34 → 0.0.36
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/useInfiniteQueryHelper.d.ts +8 -0
- package/dist/client/hooks/useInfiniteQueryHelper.js +11 -9
- package/dist/client/hooks/useMemberVerificationQuery.js +0 -1
- package/dist/client/hooks/useMessagesQuery.js +0 -1
- package/dist/client/hooks/useTransactionRecordsQuery.js +0 -1
- package/dist/client/hooks/useWithdrawalRecordsQuery.js +0 -1
- package/dist/components/Account/Account.js +1 -1
- package/dist/components/AccountInfo/AccountInfo.js +1 -1
- package/dist/components/AccountSecurity/AccountSecurity.js +2 -2
- package/dist/components/AccountVerification/AccountVerification.d.ts +4 -1
- package/dist/components/AccountVerification/AccountVerification.js +36 -2
- package/dist/components/AccountVerification/VerificationCapture.d.ts +1 -0
- package/dist/components/AccountVerification/VerificationCapture.js +57 -0
- package/dist/components/AccountVerification/selfie.png +0 -0
- package/dist/components/AccountVerification/upload-id.png +0 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositVCA.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositQrCode.js +1 -1
- package/dist/components/DepositWithdrawal/PaymentMethods.js +5 -5
- package/dist/components/Disclaimer/Disclaimer.js +2 -2
- package/dist/components/Games/Game.d.ts +1 -0
- package/dist/components/Games/Game.js +34 -0
- package/dist/components/Games/GameContext.d.ts +3 -0
- package/dist/components/{KYC/KYCContext.js → Games/GameContext.js} +4 -4
- package/dist/components/Games/Games.d.ts +7 -14
- package/dist/components/Games/Games.js +3 -8
- package/dist/components/Games/GamesCarousel.client.d.ts +2 -0
- package/dist/components/Games/{Games.client.js → GamesCarousel.client.js} +6 -32
- package/dist/components/Games/GamesCarousel.d.ts +15 -0
- package/dist/components/Games/GamesCarousel.js +11 -0
- package/dist/components/Games/GamesList.client.d.ts +2 -0
- package/dist/components/Games/GamesList.client.js +14 -0
- package/dist/components/Games/GamesList.d.ts +10 -0
- package/dist/components/Games/GamesList.js +10 -0
- package/dist/components/GamesSearch/GamesSearch.js +1 -1
- package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +0 -1
- package/dist/components/JackpotCounter/JackpotCounterItem.js +11 -22
- package/dist/components/Jackpots/JackpotItemDesktop.js +12 -11
- package/dist/components/Jackpots/JackpotItemMobile.js +11 -10
- package/dist/components/Jackpots/Jackpots.js +4 -2
- package/dist/components/Jackpots/useJackpotItemData.d.ts +0 -1
- package/dist/components/Jackpots/useJackpotItemData.js +0 -7
- package/dist/components/PortalProvider/PortalProvider.client.js +25 -13
- package/dist/components/TournamentCounter/TournamentCounter.client.js +5 -12
- package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +3 -4
- package/dist/components/TournamentCounter/TournamentCounterItem.js +24 -13
- package/dist/components/Tournaments/TournamentGameProviders.d.ts +5 -1
- package/dist/components/Tournaments/TournamentGameProviders.js +3 -4
- package/dist/components/Tournaments/TournamentItemDesktop.d.ts +7 -0
- package/dist/components/Tournaments/TournamentItemDesktop.js +57 -0
- package/dist/components/Tournaments/TournamentItemMobile.d.ts +6 -6
- package/dist/components/Tournaments/TournamentItemMobile.js +21 -61
- package/dist/components/Tournaments/Tournaments.d.ts +3 -1
- package/dist/components/Tournaments/Tournaments.js +8 -15
- package/dist/components/Tournaments/useTournamentItemData.d.ts +16 -0
- package/dist/components/Tournaments/useTournamentItemData.js +64 -0
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.js +0 -1
- package/dist/icons/CreditCardCheckIcon.d.ts +2 -0
- package/dist/icons/CreditCardCheckIcon.js +4 -0
- package/dist/icons/FaceIdIcon.d.ts +2 -0
- package/dist/icons/FaceIdIcon.js +4 -0
- package/dist/icons/FileSearch02Icon.d.ts +2 -0
- package/dist/icons/FileSearch02Icon.js +4 -0
- package/dist/icons/FileX02Icon.d.ts +2 -0
- package/dist/icons/FileX02Icon.js +4 -0
- package/dist/icons/Globe05Icon.d.ts +2 -0
- package/dist/icons/Globe05Icon.js +4 -0
- package/dist/icons/index.d.ts +5 -0
- package/dist/icons/index.js +5 -0
- package/dist/styles/theme.css +5 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/ui/Progress/progress.recipe.js +1 -1
- package/dist/utils/getPercentage.d.ts +1 -0
- package/dist/utils/getPercentage.js +5 -0
- package/dist/utils/maskDisplayName.d.ts +1 -0
- package/dist/utils/maskDisplayName.js +8 -0
- package/package.json +150 -150
- package/dist/components/Games/Games.client.d.ts +0 -2
- package/dist/components/KYC/KYC.d.ts +0 -5
- package/dist/components/KYC/KYC.js +0 -19
- package/dist/components/KYC/KYCContext.d.ts +0 -3
- package/dist/components/KYC/KYCTrigger.d.ts +0 -5
- package/dist/components/KYC/KYCTrigger.js +0 -14
- package/dist/components/KYC/Step1.d.ts +0 -1
- package/dist/components/KYC/Step1.js +0 -10
- package/dist/components/KYC/Step2.d.ts +0 -1
- package/dist/components/KYC/Step2.js +0 -15
- package/dist/components/KYC/Step3.d.ts +0 -1
- package/dist/components/KYC/Step3.js +0 -11
- package/dist/components/KYC/StepIndicator.d.ts +0 -1
- package/dist/components/KYC/StepIndicator.js +0 -13
- package/dist/components/KYC/UploadDocument.d.ts +0 -1
- package/dist/components/KYC/UploadDocument.js +0 -8
- package/dist/components/KYC/UploadSelfie.d.ts +0 -1
- package/dist/components/KYC/UploadSelfie.js +0 -8
- package/dist/components/KYC/index.d.ts +0 -2
- package/dist/components/KYC/index.js +0 -2
- package/dist/components/KYC/useKYC.d.ts +0 -14
- package/dist/components/KYC/useKYC.js +0 -32
- package/dist/components/KYC/utils.d.ts +0 -0
- package/dist/components/KYC/utils.js +0 -1
- package/dist/components/Tournaments/TournamentItem.d.ts +0 -5
- package/dist/components/Tournaments/TournamentItem.js +0 -97
- package/dist/config.d.ts +0 -272
- package/dist/config.js +0 -39
|
@@ -6,6 +6,9 @@ type KnownVariables = {
|
|
|
6
6
|
[x: string]: unknown;
|
|
7
7
|
};
|
|
8
8
|
interface UseInfiniteQueryHelperReturn<T extends PaginatedQueryResult<unknown>> {
|
|
9
|
+
/**
|
|
10
|
+
* @description The rows for the current page.
|
|
11
|
+
*/
|
|
9
12
|
rows: Array<T['edges'][0]['node']>;
|
|
10
13
|
page: number;
|
|
11
14
|
setPage: (page: number) => void;
|
|
@@ -19,6 +22,11 @@ interface UseInfiniteQueryHelperReturn<T extends PaginatedQueryResult<unknown>>
|
|
|
19
22
|
hasPrevPage: boolean;
|
|
20
23
|
loading: boolean;
|
|
21
24
|
firstPage: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* @description All rows loaded so far, regardless of pagination.
|
|
27
|
+
*/
|
|
28
|
+
availableRows: Array<T['edges'][0]['node']>;
|
|
29
|
+
totalAvailableRows: number;
|
|
22
30
|
}
|
|
23
31
|
export declare function useInfiniteQueryHelper<QueryData extends PaginatedQueryResult<unknown>, QueryVariables extends KnownVariables>(useQuery: InfiniteQuery<QueryData, QueryVariables>, variables: QueryVariables): UseInfiniteQueryHelperReturn<QueryData>;
|
|
24
32
|
export declare namespace useInfiniteQueryHelper {
|
|
@@ -2,32 +2,32 @@ import { chunk } from 'lodash-es';
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
export function useInfiniteQueryHelper(useQuery, variables) {
|
|
4
4
|
const [page, setPage] = useState(1);
|
|
5
|
-
const [pageSize, setPageSize_] = useState(10);
|
|
5
|
+
const [pageSize, setPageSize_] = useState(variables.first ?? 10);
|
|
6
6
|
const setPageSize = (size) => {
|
|
7
7
|
setPage(1);
|
|
8
8
|
setPageSize_(size);
|
|
9
9
|
};
|
|
10
10
|
const query = useQuery({
|
|
11
|
-
first: pageSize,
|
|
12
|
-
after: null,
|
|
13
11
|
...variables,
|
|
12
|
+
first: pageSize,
|
|
14
13
|
});
|
|
15
|
-
const
|
|
14
|
+
const availableRows = query.data?.pages
|
|
16
15
|
.map((page) => page.edges.map((edge) => edge.node))
|
|
17
16
|
.flat() ?? [];
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
17
|
+
const availablePages = chunk(availableRows, pageSize);
|
|
18
|
+
const totalAvailableRows = availableRows.length;
|
|
19
|
+
const totalAAvailablePages = Math.ceil(availableRows.length / pageSize);
|
|
20
|
+
const rows = availablePages.at(page - 1) ?? [];
|
|
21
21
|
const totalRows = query.data?.pages.at(-1)?.totalCount ?? 0;
|
|
22
22
|
const totalPages = Math.ceil(totalRows / pageSize);
|
|
23
|
-
const hasNextPage =
|
|
23
|
+
const hasNextPage = query.data?.pages.at(-1)?.pageInfo.hasNextPage ?? false;
|
|
24
24
|
const hasPrevPage = page > 1;
|
|
25
25
|
const next = async () => {
|
|
26
26
|
if (!hasNextPage) {
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
const nextPage = page + 1;
|
|
30
|
-
if (
|
|
30
|
+
if (totalAAvailablePages < nextPage) {
|
|
31
31
|
await query.fetchNextPage();
|
|
32
32
|
}
|
|
33
33
|
setPage((prev) => prev + 1);
|
|
@@ -56,6 +56,8 @@ export function useInfiniteQueryHelper(useQuery, variables) {
|
|
|
56
56
|
hasPrevPage,
|
|
57
57
|
loading,
|
|
58
58
|
firstPage,
|
|
59
|
+
availableRows,
|
|
60
|
+
totalAvailableRows,
|
|
59
61
|
};
|
|
60
62
|
}
|
|
61
63
|
useInfiniteQueryHelper.config = {
|
|
@@ -18,7 +18,6 @@ export const useMemberVerificationQuery = (config) => {
|
|
|
18
18
|
queryFn: () => getSession(),
|
|
19
19
|
});
|
|
20
20
|
invariant(session.status === 'authenticated');
|
|
21
|
-
invariant(session.status === 'authenticated');
|
|
22
21
|
return await getMemberVerification({
|
|
23
22
|
signal,
|
|
24
23
|
environment: ENVIRONMENT,
|
|
@@ -20,7 +20,6 @@ export const useMessagesQuery = (input, config) => {
|
|
|
20
20
|
queryFn: () => getSession(),
|
|
21
21
|
});
|
|
22
22
|
invariant(session.status === 'authenticated');
|
|
23
|
-
invariant(session.status === 'authenticated');
|
|
24
23
|
return getMessages({ ...input, after: pageParam }, {
|
|
25
24
|
signal,
|
|
26
25
|
environment: ENVIRONMENT,
|
|
@@ -20,7 +20,6 @@ export const useTransactionRecordsQuery = (input, config) => {
|
|
|
20
20
|
queryFn: () => getSession(),
|
|
21
21
|
});
|
|
22
22
|
invariant(session.status === 'authenticated');
|
|
23
|
-
invariant(session.status === 'authenticated');
|
|
24
23
|
return getTransactionRecords({ ...input, after: pageParam }, {
|
|
25
24
|
signal,
|
|
26
25
|
environment: ENVIRONMENT,
|
|
@@ -20,7 +20,6 @@ export const useWithdrawalRecordsQuery = (input, config) => {
|
|
|
20
20
|
queryFn: () => getSession(),
|
|
21
21
|
});
|
|
22
22
|
invariant(session.status === 'authenticated');
|
|
23
|
-
invariant(session.status === 'authenticated');
|
|
24
23
|
return await getWithdrawalRecords({ ...input, after: pageParam }, {
|
|
25
24
|
signal,
|
|
26
25
|
environment: ENVIRONMENT,
|
|
@@ -6,7 +6,7 @@ import Link from 'next/link';
|
|
|
6
6
|
import { useShallow } from 'zustand/shallow';
|
|
7
7
|
import { useAccountQuery, useGlobalStore, useLocaleInfo, useSignOutMutation, useUnreadMessagesCountQuery, useWalletQuery, } from '../../client/hooks/index.js';
|
|
8
8
|
import { AlertCircleIcon, ChevronLeftIcon, ChevronRightIcon, CoinsStacked02Icon, CoinsSwap02Icon, CreditCard02Icon, FileCheck02Icon, Gift01Icon, Lock01Icon, Logout01Icon, Settings02Icon, User01Icon, XIcon, } from '../../icons/index.js';
|
|
9
|
-
import avatarPlaceholder from '
|
|
9
|
+
import avatarPlaceholder from '~/images/placeholder-avatar.png';
|
|
10
10
|
import { Badge, Button, Drawer, IconButton, Popover, Presence } from '../../ui/index.js';
|
|
11
11
|
import { formatNumber, parseDecimal } from '../../utils/index.js';
|
|
12
12
|
import { accountRecipe } from './account.recipe.js';
|
|
@@ -5,7 +5,7 @@ import { noop } from 'lodash-es';
|
|
|
5
5
|
import Image from 'next/image';
|
|
6
6
|
import { useAccountQuery, useLocaleInfo, useMobileNumberParser, } from '../../client/hooks/index.js';
|
|
7
7
|
import { FacebookIcon, GoogleIcon } from '../../icons/index.js';
|
|
8
|
-
import avatar from '
|
|
8
|
+
import avatar from '~/images/placeholder-avatar.png';
|
|
9
9
|
import { Button, Field, IconButton } from '../../ui/index.js';
|
|
10
10
|
export function AccountInfo(props) {
|
|
11
11
|
const localeInfo = useLocaleInfo();
|
|
@@ -8,11 +8,11 @@ import { Field, PasswordInput, Select } from '../../ui/index.js';
|
|
|
8
8
|
export function AccountSecurity(props) {
|
|
9
9
|
const profileCompletionQuery = useProfileCompletionQuery();
|
|
10
10
|
const profileCompletion = profileCompletionQuery.data;
|
|
11
|
-
return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-
|
|
11
|
+
return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Log in password" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "Access your account by logging in with your name and password." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountPassword
|
|
12
12
|
? 'text-text-success-primary'
|
|
13
13
|
: 'text-text-warning-primary'), children: profileCompletion?.accountPassword ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("div", { className: "shadow-xs bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border px-4 py-5", children: [_jsx(Field.Root, { children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, {}), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }) }), _jsx(Field.Root, { className: "mt-6", children: _jsxs(Select.Root, { collection: secretQuestionCollection, lazyMount: true, positioning: {
|
|
14
14
|
sameWidth: true,
|
|
15
|
-
}, children: [_jsx(Select.Label, { children: "Security Question" }), _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, { placeholder: "Game Vendor" }), _jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: secretQuestionCollection.items.map((provider) => (_jsxs(Select.Item, { item: provider, children: [_jsx(Select.ItemText, { children: secretQuestionCollection.stringifyItem(provider) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, provider))) }) }) }) })] }) }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Answer" }), _jsx(Field.Input, {})] })] }), _jsxs("div", { className: "mt-6 flex items-
|
|
15
|
+
}, children: [_jsx(Select.Label, { children: "Security Question" }), _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, { placeholder: "Game Vendor" }), _jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: secretQuestionCollection.items.map((provider) => (_jsxs(Select.Item, { item: provider, children: [_jsx(Select.ItemText, { children: secretQuestionCollection.stringifyItem(provider) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, provider))) }) }) }) })] }) }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Answer" }), _jsx(Field.Input, {})] })] }), _jsxs("div", { className: "mt-6 flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Transaction password" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "The transaction password secures and confirms your wallet withdrawals." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountPassword
|
|
16
16
|
? 'text-text-success-primary'
|
|
17
17
|
: 'text-text-warning-primary'), children: profileCompletion?.accountPassword ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsx("div", { className: "shadow-xs bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border px-4 py-5", children: _jsx(Field.Root, { children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, {}), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }) }) })] }));
|
|
18
18
|
}
|
|
@@ -1,3 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ark } from '@ark-ui/react';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { useMemberVerificationQuery, useProfileCompletionQuery, } from '../../client/hooks/index.js';
|
|
6
|
+
import { AlertCircleIcon, CheckVerified02Icon, CreditCard02Icon, FaceIdIcon, FileCheck02Icon, FileSearch02Icon, FileX02Icon, Globe05Icon, } from '../../icons/index.js';
|
|
7
|
+
import { Button } from '../../ui/index.js';
|
|
8
|
+
import { VerificationCapture } from './VerificationCapture.js';
|
|
9
|
+
export function AccountVerification(props) {
|
|
10
|
+
const profileCompletionQuery = useProfileCompletionQuery();
|
|
11
|
+
const profileCompletion = profileCompletionQuery.data;
|
|
12
|
+
const verificationQuery = useMemberVerificationQuery();
|
|
13
|
+
const verification = verificationQuery.data;
|
|
14
|
+
const empty = verification == null;
|
|
15
|
+
const pending = verification?.status === 'PENDING';
|
|
16
|
+
const success = verification?.status === 'VERIFIED' || verification?.status === 'APPROVED';
|
|
17
|
+
const failed = verification?.status === 'REJECTED' ||
|
|
18
|
+
verification?.status === 'UNVERIFIED';
|
|
19
|
+
if (1) {
|
|
20
|
+
return (_jsx("div", { className: props.className, children: _jsx(VerificationCapture, {}) }));
|
|
21
|
+
}
|
|
22
|
+
return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Verify your identity" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "Complete personal verification to unlock all features and enhance account security." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountVerification
|
|
23
|
+
? 'text-text-success-primary'
|
|
24
|
+
: 'text-text-warning-primary'), children: profileCompletion?.accountVerification ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("div", { className: "shadow-xs border-border-secondary bg-bg-primary-alt mt-5 rounded-xl border", children: [_jsx("div", { className: "px-4 py-5", children: _jsxs("ul", { className: "space-y-lg", children: [_jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FileCheck02Icon, {}), "Basic Information"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(Globe05Icon, {}), "Proof of address"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(CreditCard02Icon, {}), "Government ID"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FaceIdIcon, {}), "Facial Verification"] })] }) }), _jsx("div", { className: "border-border-secondary border-t px-4 py-3", children: _jsx(Button, { size: "sm", children: "Verify Now" }) })] }), success && _jsx(VerificationSuccess, {}), pending && _jsx(VerificationInProgress, {}), failed && _jsx(VerificationFailed, {}), empty && _jsx(VerificationNotSubmitted, {})] }));
|
|
25
|
+
}
|
|
26
|
+
function VerificationNotSubmitted() {
|
|
27
|
+
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-warning-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-warning-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(AlertCircleIcon, { className: "text-text-warning-primary size-5" }) }) }), _jsx("p", { className: "text-text-tertiary-600 mt-2 text-sm", children: "To serve you better and unlock all features, please provide valid identification documents. This helps protect your account and makes recovery easier if ever needed." })] }));
|
|
28
|
+
}
|
|
29
|
+
function VerificationInProgress() {
|
|
30
|
+
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-warning-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-warning-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileSearch02Icon, { className: "text-text-warning-primary size-5" }) }) }), _jsx("h2", { className: "text-text-secondary-700 mt-2 text-sm font-semibold", children: "Under review" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "To serve you better and unlock all features, please provide valid identification documents. This helps protect your account and makes recovery easier if ever needed." })] }));
|
|
31
|
+
}
|
|
32
|
+
function VerificationSuccess() {
|
|
33
|
+
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-success-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-success-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileCheck02Icon, { className: "text-text-success-primary size-5" }) }) }), _jsx("h2", { className: "text-text-secondary-700 mt-2 text-sm font-semibold", children: "Verification successful" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "Your account has been successfully verified. You now have full access to all features and improved account security." })] }));
|
|
34
|
+
}
|
|
35
|
+
function VerificationFailed() {
|
|
36
|
+
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-error-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-error-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileX02Icon, { className: "text-text-error-primary size-5" }) }) }), _jsx("h2", { className: "text-text-secondary-700 mt-2 text-sm font-semibold", children: "Verification failed" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "There was an issue with the verification process. Please try again or contact support for assistance." })] }));
|
|
3
37
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function VerificationCapture(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Portal } from '@ark-ui/react';
|
|
3
|
+
import { clamp, noop } from 'lodash-es';
|
|
4
|
+
import Image from 'next/image';
|
|
5
|
+
import { createContext, useContext, useState } from 'react';
|
|
6
|
+
import invariant from 'tiny-invariant';
|
|
7
|
+
import { toaster } from '../../client/utils/index.js';
|
|
8
|
+
import { ArrowLeftIcon, CheckCircleIcon, CheckIcon, XIcon } from '../../icons/index.js';
|
|
9
|
+
import { AlertDialog, Button, Checkbox, Field, Progress } from '../../ui/index.js';
|
|
10
|
+
import selfie from './selfie.png';
|
|
11
|
+
import uploadId from './upload-id.png';
|
|
12
|
+
function useVerificationCapture() {
|
|
13
|
+
const [step, setStep_] = useState(4);
|
|
14
|
+
function setStep(step) {
|
|
15
|
+
setStep_(step);
|
|
16
|
+
if (step === 4) {
|
|
17
|
+
toaster.success({
|
|
18
|
+
title: 'Submission Successful',
|
|
19
|
+
description: 'Your documents have been submitted successfully. They’re now under review, and you’ll receive a notification as soon as your account is verified.',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
step,
|
|
25
|
+
setStep,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const VerificationCaptureContext = createContext(null);
|
|
29
|
+
function useVerificationCaptureContext() {
|
|
30
|
+
const context = useContext(VerificationCaptureContext);
|
|
31
|
+
invariant(context);
|
|
32
|
+
return context;
|
|
33
|
+
}
|
|
34
|
+
export function VerificationCapture() {
|
|
35
|
+
const context = useVerificationCapture();
|
|
36
|
+
return (_jsx(VerificationCaptureContext, { value: context, children: _jsxs("div", { children: [_jsxs("div", { className: "grid grid-cols-4 items-center", children: [_jsxs("button", { className: "text-text-tertiary-600 flex gap-sm text-sm font-semibold", disabled: context.step <= 1, onClick: () => context.setStep(clamp(context.step - 1, 1, 4)), children: [_jsx(ArrowLeftIcon, { className: "size-5" }), "Back"] }), _jsxs("div", { className: "col-span-2 flex justify-center gap-2", children: [_jsx(Progress.Root, { value: context.step >= 2 ? 100 : context.step >= 1 ? 50 : 0, onValueChange: noop, className: "w-22.5 shrink-0", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) }), _jsx(Progress.Root, { value: context.step >= 4 ? 100 : context.step >= 3 ? 50 : 0, onValueChange: noop, className: "w-22.5 shrink-0", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) })] })] }), context.step === 1 && _jsx(Step1, {}), context.step === 2 && _jsx(Step2, {}), (context.step === 3 || context.step === 4) && _jsx(Step3, {}), _jsx(Congrats, {})] }) }));
|
|
37
|
+
}
|
|
38
|
+
function Step1() {
|
|
39
|
+
const context = useVerificationCaptureContext();
|
|
40
|
+
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Prepare to upload your ID" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsx(Image, { src: uploadId, alt: "", className: "h-auto w-full" }), _jsxs("ul", { className: "mt-2xl space-y-3", children: [_jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Upload front side of your ID"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Take a photo in a well lit room"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(XIcon, { className: "text-text-featured-icon-light-error size-6" }), "Don't edit image of your ID"] })] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => context.setStep(2), children: "Continue" }) })] })] }));
|
|
41
|
+
}
|
|
42
|
+
function Step2() {
|
|
43
|
+
const context = useVerificationCaptureContext();
|
|
44
|
+
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Take a selfie holding your ID" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsx(Image, { src: selfie, alt: "", className: "h-auto w-full" }), _jsxs("ul", { className: "mt-2xl space-y-3", children: [_jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Face and ID must be clearly visible"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Take a photo in a well lit room"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(XIcon, { className: "text-text-featured-icon-light-error size-6" }), "No hats, sunglasses, or masks"] })] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => context.setStep(3), children: "Continue" }) })] })] }));
|
|
45
|
+
}
|
|
46
|
+
function Step3() {
|
|
47
|
+
const context = useVerificationCaptureContext();
|
|
48
|
+
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Enter your basic and work-related information" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsxs(Field.Root, { children: [_jsx(Field.Label, { children: "Permanent address" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Current address" }), _jsx(Field.Input, {})] }), _jsxs(Checkbox.Root, { className: "mt-sm", children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.Label, { children: "Same as permanent address" }), _jsx(Checkbox.HiddenInput, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Source of income" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Nature of work" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Place of birth" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Nationality" }), _jsx(Field.Input, {})] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => context.setStep(4), children: "Continue" }) })] })] }));
|
|
49
|
+
}
|
|
50
|
+
function Congrats() {
|
|
51
|
+
const context = useVerificationCaptureContext();
|
|
52
|
+
return (_jsx(AlertDialog.Root, { open: context.step === 4, onOpenChange: (details) => {
|
|
53
|
+
if (!details.open) {
|
|
54
|
+
context.setStep(1);
|
|
55
|
+
}
|
|
56
|
+
}, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "bg-bg-overlay/75 backdrop-blur-sm" }), _jsx(AlertDialog.Positioner, { children: _jsxs(AlertDialog.Content, { className: "mx-auto w-[21.438rem] p-xl", children: [_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success mx-auto flex size-12 items-center justify-center rounded-full", children: _jsx(CheckCircleIcon, {}) }), _jsx(AlertDialog.Title, { className: "mt-3 text-center", children: "Submission Successful" }), _jsx(AlertDialog.Description, { className: "text-text-tertiary-600 text-center", children: "Your documents have been submitted successfully. They\u2019re now under review, and you\u2019ll receive a notification as soon as your account is verified." }), _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { className: "mt-3xl", onClick: () => api.setOpen(false), children: "Ok" })) })] }) })] }) }));
|
|
57
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Portal } from '@ark-ui/react';
|
|
3
3
|
import Image from 'next/image';
|
|
4
4
|
import { BankIcon, XIcon } from '../../../../icons/index.js';
|
|
5
|
-
import bankIcon from '
|
|
5
|
+
import bankIcon from '~/images/bank-icon.png';
|
|
6
6
|
import { Button, Clipboard, Dialog } from '../../../../ui/index.js';
|
|
7
7
|
import { useOnlineBankDepositContext } from './OnlineBankDepositContext.js';
|
|
8
8
|
export function OnlineBankDepositVCA() {
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Portal, QrCode } from '@ark-ui/react';
|
|
3
3
|
import Image from 'next/image';
|
|
4
4
|
import { QrCode02Icon, SpinnerIcon, XIcon } from '../../../../icons/index.js';
|
|
5
|
-
import qrphIcon from '
|
|
5
|
+
import qrphIcon from '~/images/qrph-icon.png';
|
|
6
6
|
import { Button, Dialog } from '../../../../ui/index.js';
|
|
7
7
|
import { useQRPHDepositContext } from './QRPHDepositContext.js';
|
|
8
8
|
export function QRPHDepositQrCode() {
|
|
@@ -2,11 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import Image from 'next/image';
|
|
3
3
|
import { useControllableState } from '../../client/hooks/index.js';
|
|
4
4
|
import { CheckIcon } from '../../icons/index.js';
|
|
5
|
-
import qrph from '
|
|
6
|
-
import gcash from '
|
|
7
|
-
import instapay from '
|
|
8
|
-
import maya from '
|
|
9
|
-
import onlineBank from '
|
|
5
|
+
import qrph from '~/images/QRPh.png';
|
|
6
|
+
import gcash from '~/images/gcash.png';
|
|
7
|
+
import instapay from '~/images/instapay.png';
|
|
8
|
+
import maya from '~/images/maya.png';
|
|
9
|
+
import onlineBank from '~/images/online-bank.png';
|
|
10
10
|
import { Checkbox, Field } from '../../ui/index.js';
|
|
11
11
|
import { PaymentMethodDefinition } from './utils.js';
|
|
12
12
|
const OPTIONS = [
|
|
@@ -3,8 +3,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { Portal } from '@ark-ui/react';
|
|
4
4
|
import Image from 'next/image';
|
|
5
5
|
import { useRef } from 'react';
|
|
6
|
-
import pagcorLogo from '
|
|
7
|
-
import responsibleGamingLogo from '
|
|
6
|
+
import pagcorLogo from '~/images/pagcor.png';
|
|
7
|
+
import responsibleGamingLogo from '~/images/responsible-gaming.png';
|
|
8
8
|
import { Button, Dialog } from '../../ui/index.js';
|
|
9
9
|
import { useDisclaimer } from './useDisclaimer.js';
|
|
10
10
|
export function Disclaimer(props) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Game(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Image from 'next/image';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { useFavoriteGamesQuery, useMarkGameAsFavoriteMutation, useSessionQuery, useUnmarkGameAsFavoriteMutation, } from '../../client/hooks/index.js';
|
|
5
|
+
import { Star01Icon } from '../../icons/index.js';
|
|
6
|
+
import { GameLaunchTrigger } from '../GameLaunch/index.js';
|
|
7
|
+
import { useGameContext } from './GameContext.js';
|
|
8
|
+
export function Game() {
|
|
9
|
+
const game = useGameContext();
|
|
10
|
+
const sessionQuery = useSessionQuery();
|
|
11
|
+
const session = sessionQuery.data;
|
|
12
|
+
const favoriteGamesQuery = useFavoriteGamesQuery();
|
|
13
|
+
const favoriteGames = favoriteGamesQuery.data ?? [];
|
|
14
|
+
const markGameAsFavoriteMutation = useMarkGameAsFavoriteMutation();
|
|
15
|
+
const unmarkGameAsFavoriteMutation = useUnmarkGameAsFavoriteMutation();
|
|
16
|
+
const markedAsFavorite = favoriteGames.some((favoriteGame) => favoriteGame.id === game.id);
|
|
17
|
+
return (_jsxs(GameLaunchTrigger, { game: game, className: "relative block w-full shadow-sm", children: [session?.status === 'authenticated' && (_jsx("div", { role: "button", onClick: (e) => {
|
|
18
|
+
e.preventDefault();
|
|
19
|
+
e.stopPropagation();
|
|
20
|
+
if (markGameAsFavoriteMutation.isPending)
|
|
21
|
+
return;
|
|
22
|
+
if (unmarkGameAsFavoriteMutation.isPending)
|
|
23
|
+
return;
|
|
24
|
+
if (markedAsFavorite) {
|
|
25
|
+
unmarkGameAsFavoriteMutation.mutate(game.reference);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
markGameAsFavoriteMutation.mutate(game.reference);
|
|
29
|
+
}
|
|
30
|
+
}, "aria-disabled": markGameAsFavoriteMutation.isPending ||
|
|
31
|
+
unmarkGameAsFavoriteMutation.isPending, className: "rounded-xs absolute right-2 top-2 flex size-9 items-center justify-center bg-black/65 blur-[0.5px]", children: _jsx(Star01Icon, { className: twMerge('size-5', markedAsFavorite
|
|
32
|
+
? 'fill-yellow-400 text-yellow-400'
|
|
33
|
+
: 'text-white') }) })), _jsx(Image, { src: game.image, alt: "", width: 200, height: 200, priority: true, className: "aspect-square w-full rounded-t-md object-cover" }), _jsx("span", { className: "bg-bg-tertiary text-text-primary-brand block w-full truncate rounded-b-md px-2 py-2.5 text-center text-xs font-semibold", children: game.name })] }));
|
|
34
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createContext, useContext } from 'react';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
|
-
export const
|
|
4
|
-
export
|
|
5
|
-
const context = useContext(
|
|
3
|
+
export const GameContext = createContext(null);
|
|
4
|
+
export const useGameContext = () => {
|
|
5
|
+
const context = useContext(GameContext);
|
|
6
6
|
invariant(context);
|
|
7
7
|
return context;
|
|
8
|
-
}
|
|
8
|
+
};
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
viewAllUrl?: string;
|
|
10
|
-
/** @default 1 */
|
|
11
|
-
numOfRows?: 1 | 2 | 3;
|
|
12
|
-
className?: string;
|
|
13
|
-
filter?: GamesInput['filter'];
|
|
14
|
-
}
|
|
1
|
+
import { type GamesCarouselProps } from './GamesCarousel';
|
|
2
|
+
import { type GamesListProps } from './GamesList';
|
|
3
|
+
export type GamesProps = ({
|
|
4
|
+
layout: 'list';
|
|
5
|
+
} & GamesListProps) | ({
|
|
6
|
+
layout?: 'carousel';
|
|
7
|
+
} & GamesCarouselProps);
|
|
15
8
|
export declare function Games(props: GamesProps): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { GamesCarousel } from './GamesCarousel.js';
|
|
3
|
+
import { GamesList } from './GamesList.js';
|
|
4
4
|
export async function Games(props) {
|
|
5
|
-
|
|
6
|
-
await prefetchGamesQuery({
|
|
7
|
-
first: (numOfRows + 1) * 6,
|
|
8
|
-
filter: props.filter,
|
|
9
|
-
});
|
|
10
|
-
return _jsx(Games__client, { ...props });
|
|
5
|
+
return props.layout === 'list' ? (_jsx(GamesList, { ...props })) : (_jsx(GamesCarousel, { ...props }));
|
|
11
6
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import useEmblaCarousel, {} from 'embla-carousel-react';
|
|
4
|
-
import Image from 'next/image';
|
|
5
4
|
import Link from 'next/link';
|
|
6
5
|
import { useCallback, useEffect, useState } from 'react';
|
|
7
6
|
import { twMerge } from 'tailwind-merge';
|
|
8
|
-
import {
|
|
9
|
-
import { ArrowLeftIcon, ArrowRightIcon, ChevronRightIcon, SpinnerIcon,
|
|
7
|
+
import { useGamesQuery } from '../../client/hooks/index.js';
|
|
8
|
+
import { ArrowLeftIcon, ArrowRightIcon, ChevronRightIcon, SpinnerIcon, } from '../../icons/index.js';
|
|
10
9
|
import { Button } from '../../ui/index.js';
|
|
11
|
-
import {
|
|
12
|
-
|
|
10
|
+
import { Game } from './Game.js';
|
|
11
|
+
import { GameContext } from './GameContext.js';
|
|
12
|
+
export function GamesCarousel__client(props) {
|
|
13
13
|
const numOfRows = props.numOfRows ?? 1;
|
|
14
14
|
const gamesQuery = useGamesQuery({
|
|
15
15
|
first: (numOfRows + 1) * 6,
|
|
@@ -54,31 +54,5 @@ export function Games__client(props) {
|
|
|
54
54
|
? 'grid-rows-3'
|
|
55
55
|
: numOfRows === 2
|
|
56
56
|
? 'grid-rows-2'
|
|
57
|
-
: 'grid-rows-1'), children: games.map((game) => (_jsx(
|
|
58
|
-
}
|
|
59
|
-
function Item({ game }) {
|
|
60
|
-
const sessionQuery = useSessionQuery();
|
|
61
|
-
const session = sessionQuery.data;
|
|
62
|
-
const favoriteGamesQuery = useFavoriteGamesQuery();
|
|
63
|
-
const favoriteGames = favoriteGamesQuery.data ?? [];
|
|
64
|
-
const markGameAsFavoriteMutation = useMarkGameAsFavoriteMutation();
|
|
65
|
-
const unmarkGameAsFavoriteMutation = useUnmarkGameAsFavoriteMutation();
|
|
66
|
-
const markedAsFavorite = favoriteGames.some((favoriteGame) => favoriteGame.id === game.id);
|
|
67
|
-
return (_jsxs(GameLaunchTrigger, { game: game, className: "relative block w-full shadow-sm", children: [session?.status === 'authenticated' && (_jsx("div", { role: "button", onClick: (e) => {
|
|
68
|
-
e.preventDefault();
|
|
69
|
-
e.stopPropagation();
|
|
70
|
-
if (markGameAsFavoriteMutation.isPending)
|
|
71
|
-
return;
|
|
72
|
-
if (unmarkGameAsFavoriteMutation.isPending)
|
|
73
|
-
return;
|
|
74
|
-
if (markedAsFavorite) {
|
|
75
|
-
unmarkGameAsFavoriteMutation.mutate(game.reference);
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
markGameAsFavoriteMutation.mutate(game.reference);
|
|
79
|
-
}
|
|
80
|
-
}, "aria-disabled": markGameAsFavoriteMutation.isPending ||
|
|
81
|
-
unmarkGameAsFavoriteMutation.isPending, className: "rounded-xs absolute right-2 top-2 flex size-9 items-center justify-center bg-black/65 blur-[0.5px]", children: _jsx(Star01Icon, { className: twMerge('size-5', markedAsFavorite
|
|
82
|
-
? 'fill-yellow-400 text-yellow-400'
|
|
83
|
-
: 'text-white') }) })), _jsx(Image, { src: game.image, alt: "", width: 200, height: 200, priority: true, className: "aspect-square w-full rounded-t-md object-cover" }), _jsx("span", { className: "bg-bg-tertiary text-text-primary-brand block w-full truncate rounded-b-md px-2 py-2.5 text-center text-xs font-semibold", children: game.name })] }));
|
|
57
|
+
: 'grid-rows-1'), children: games.map((game) => (_jsx(GameContext, { value: game, children: _jsx(Game, {}) }, game.id))) }) })] }));
|
|
84
58
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { GamesInput } from '@opexa/portal-sdk-core';
|
|
2
|
+
export interface GamesCarouselProps {
|
|
3
|
+
/** @default "Games" */
|
|
4
|
+
heading?: string;
|
|
5
|
+
/**
|
|
6
|
+
* @description URL for viewing all games
|
|
7
|
+
* @default "/games"
|
|
8
|
+
*/
|
|
9
|
+
viewAllUrl?: string;
|
|
10
|
+
/** @default 1 */
|
|
11
|
+
numOfRows?: 1 | 2 | 3;
|
|
12
|
+
filter?: GamesInput['filter'];
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function GamesCarousel(props: GamesCarouselProps): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { prefetchGamesQuery } from '../../server/utils/index.js';
|
|
3
|
+
import { GamesCarousel__client } from './GamesCarousel.client.js';
|
|
4
|
+
export async function GamesCarousel(props) {
|
|
5
|
+
const numOfRows = props.numOfRows ?? 1;
|
|
6
|
+
await prefetchGamesQuery({
|
|
7
|
+
first: (numOfRows + 1) * 6,
|
|
8
|
+
filter: props.filter,
|
|
9
|
+
});
|
|
10
|
+
return _jsx(GamesCarousel__client, { ...props });
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { noop } from 'lodash-es';
|
|
4
|
+
import { useGamesQuery, useInfiniteQueryHelper } from '../../client/hooks/index.js';
|
|
5
|
+
import { Button, Progress } from '../../ui/index.js';
|
|
6
|
+
import { Game } from './Game.js';
|
|
7
|
+
import { GameContext } from './GameContext.js';
|
|
8
|
+
export function GamesList__client(props) {
|
|
9
|
+
const { availableRows, totalRows, totalAvailableRows, hasNextPage, next } = useInfiniteQueryHelper(useGamesQuery, {
|
|
10
|
+
first: props.first ?? 24,
|
|
11
|
+
filter: props.filter,
|
|
12
|
+
});
|
|
13
|
+
return (_jsxs("div", { className: props.className, children: [_jsx("h2", { className: "text-lg font-semibold", children: props.heading ?? 'Games' }), _jsx("div", { className: "mt-lg grid grid-cols-3 gap-1.5 lg:grid-cols-6 lg:gap-2.5", children: availableRows.map((game) => (_jsx(GameContext, { value: game, children: _jsx(Game, {}) }, game.id))) }), _jsxs("div", { className: "mt-3xl flex flex-col items-center", children: [_jsx(Progress.Root, { min: 0, max: totalRows, value: totalAvailableRows, onValueChange: noop, className: "w-[12.5rem]", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) }), _jsx("p", { className: "text-button-tertiary-fg mt-md text-sm", children: `Displaying ${totalAvailableRows} of ${totalRows}` }), hasNextPage && (_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, onClick: next, className: "mt-lg", children: "Load More" }))] })] }));
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GamesInput } from '@opexa/portal-sdk-core';
|
|
2
|
+
export interface GamesListProps {
|
|
3
|
+
/** @default 24 */
|
|
4
|
+
first?: number;
|
|
5
|
+
filter?: GamesInput['filter'];
|
|
6
|
+
/** @default "Games"*/
|
|
7
|
+
heading?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function GamesList(props: GamesListProps): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { prefetchGamesQuery } from '../../server/utils/index.js';
|
|
3
|
+
import { GamesList__client } from './GamesList.client.js';
|
|
4
|
+
export async function GamesList(props) {
|
|
5
|
+
await prefetchGamesQuery({
|
|
6
|
+
first: props.first ?? 24,
|
|
7
|
+
filter: props.filter,
|
|
8
|
+
});
|
|
9
|
+
return _jsx(GamesList__client, { ...props });
|
|
10
|
+
}
|
|
@@ -6,7 +6,7 @@ import { useRef, useState } from 'react';
|
|
|
6
6
|
import { useShallow } from 'zustand/shallow';
|
|
7
7
|
import { useGamesQuery, useGlobalStore } from '../../client/hooks/index.js';
|
|
8
8
|
import { SearchLgIcon, XIcon } from '../../icons/index.js';
|
|
9
|
-
import providerHacksaw from '
|
|
9
|
+
import providerHacksaw from '~/images/hacksaw-gaming.png';
|
|
10
10
|
import { Button, Dialog, Field, IconButton, Presence } from '../../ui/index.js';
|
|
11
11
|
import { GameLaunchTrigger } from '../GameLaunch/index.js';
|
|
12
12
|
export function GamesSearch(props) {
|
|
@@ -6,4 +6,3 @@ export interface JackpotCounterCardProps {
|
|
|
6
6
|
viewAllUrl?: string;
|
|
7
7
|
}
|
|
8
8
|
export declare function JackpotCounterItem({ jackpot, className, viewAllUrl, }: JackpotCounterCardProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare function maskName(name: string): string;
|