@opexa/portal-components 0.0.35 → 0.0.37
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/useAccountQuery.d.ts +1 -1
- package/dist/client/hooks/useAuthenticateMutation.d.ts +1 -1
- package/dist/client/hooks/useAvailablePromosQuery.d.ts +1 -1
- package/dist/client/hooks/useBetRecordsQuery.d.ts +1 -1
- package/dist/client/hooks/useBonusesQuery.d.ts +1 -1
- package/dist/client/hooks/useCashbacksQuery.d.ts +1 -1
- package/dist/client/hooks/useCreateGCashDepositMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateGCashWithdrawalMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateGameSessionMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateGameSessionMutation.js +1 -1
- package/dist/client/hooks/useCreateInstapayWithdrawalMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateMayaAppDepositMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateMayaAppWithdrawalMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateMayaDepositMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateMayaWithdrawalMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateOnlineBankDepositMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateQRPHDepositMutation.d.ts +1 -1
- package/dist/client/hooks/useDepositQuery.d.ts +1 -1
- package/dist/client/hooks/useDepositRecordsQuery.d.ts +1 -1
- package/dist/client/hooks/useDepositsCountQuery.d.ts +1 -1
- package/dist/client/hooks/useEndGameSessionMutation.d.ts +1 -1
- package/dist/client/hooks/useEndGameSessionMutation.js +1 -1
- package/dist/client/hooks/useFavoriteGamesQuery.d.ts +1 -1
- package/dist/client/hooks/useGamesQuery.d.ts +1 -1
- package/dist/client/hooks/useInfiniteQueryHelper.d.ts +9 -1
- package/dist/client/hooks/useInfiniteQueryHelper.js +11 -9
- package/dist/client/hooks/useInstapayBankListQuery.d.ts +1 -1
- package/dist/client/hooks/useIsMayaSessionValidQuery.d.ts +1 -1
- package/dist/client/hooks/useJackpotPayoutsQuery.d.ts +1 -1
- package/dist/client/hooks/useJackpotPayoutsQuery.js +1 -1
- package/dist/client/hooks/useJackpotsQuery.d.ts +1 -1
- package/dist/client/hooks/useLocaleInfo.d.ts +1 -1
- package/dist/client/hooks/useMarkGameAsFavoriteMutation.d.ts +1 -1
- package/dist/client/hooks/useMarkMessageAsReadMutation.d.ts +1 -1
- package/dist/client/hooks/useMarkMessageAsReadMutation.js +1 -1
- package/dist/client/hooks/useMemberVerificationQuery.d.ts +1 -1
- package/dist/client/hooks/useMessagesQuery.d.ts +1 -1
- package/dist/client/hooks/usePaymentSettingsQuery.d.ts +1 -1
- package/dist/client/hooks/usePlatformQuery.d.ts +1 -1
- package/dist/client/hooks/useProfileCompletionQuery.d.ts +1 -1
- package/dist/client/hooks/usePromoQuery.d.ts +1 -1
- package/dist/client/hooks/usePromosQuery.d.ts +1 -1
- package/dist/client/hooks/useSendVerificationCodeMutation.d.ts +1 -1
- package/dist/client/hooks/useSessionQuery.d.ts +1 -1
- package/dist/client/hooks/useSignInMutation.d.ts +1 -1
- package/dist/client/hooks/useSignOutMutation.d.ts +1 -1
- package/dist/client/hooks/useSignUpMutation.d.ts +1 -1
- package/dist/client/hooks/useTopWinsQuery.d.ts +1 -1
- package/dist/client/hooks/useTournamentsQuery.d.ts +1 -1
- package/dist/client/hooks/useTransactionRecordsQuery.d.ts +1 -1
- package/dist/client/hooks/useUnmarkGameAsFavoriteMutation.d.ts +1 -1
- package/dist/client/hooks/useUnreadMessagesCountQuery.d.ts +1 -1
- package/dist/client/hooks/useWalletQuery.d.ts +1 -1
- package/dist/client/hooks/useWalletQuery.js +1 -1
- package/dist/client/hooks/useWithdrawalRecordsQuery.d.ts +1 -1
- package/dist/client/services/getSession.d.ts +1 -1
- package/dist/components/Account/Account.js +1 -1
- package/dist/components/AccountInfo/AccountInfo.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositVCA.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositQrCode.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/DepositWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/PaymentMethods.js +5 -5
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js +1 -1
- package/dist/components/Disclaimer/Disclaimer.js +2 -2
- package/dist/components/GameProviders/GameProviders.d.ts +1 -1
- 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/Games/GameContext.js +8 -0
- 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.js +8 -10
- package/dist/components/Jackpots/JackpotGameProviders.d.ts +1 -1
- package/dist/components/Jackpots/JackpotItemDesktop.d.ts +1 -1
- package/dist/components/Jackpots/JackpotItemDesktop.js +8 -10
- package/dist/components/Jackpots/JackpotItemMobile.d.ts +1 -1
- package/dist/components/Jackpots/JackpotItemMobile.js +8 -13
- package/dist/components/Jackpots/Jackpots.d.ts +1 -1
- package/dist/components/Jackpots/Jackpots.js +1 -1
- package/dist/components/Jackpots/useJackpotItemData.d.ts +1 -1
- package/dist/components/Jackpots/useJackpotItemData.js +1 -1
- package/dist/components/Messages/utils.d.ts +1 -1
- package/dist/components/PortalProvider/PortalProvider.client.js +25 -13
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +2 -2
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +1 -1
- package/dist/components/Quests/WageringQuest/WageringQuest.js +1 -1
- package/dist/components/Quests/WageringQuest/WageringQuestModal.js +1 -1
- package/dist/components/SignIn/SignInForm.js +1 -1
- package/dist/components/TournamentCounter/TournamentCounterItem.js +7 -8
- package/dist/components/Tournaments/TournamentGameProviders.d.ts +1 -1
- package/dist/components/Tournaments/TournamentItemDesktop.d.ts +1 -1
- package/dist/components/Tournaments/TournamentItemDesktop.js +6 -7
- package/dist/components/Tournaments/TournamentItemMobile.d.ts +1 -1
- package/dist/components/Tournaments/TournamentItemMobile.js +6 -11
- package/dist/components/Tournaments/Tournaments.d.ts +1 -1
- package/dist/components/Tournaments/Tournaments.js +1 -1
- package/dist/components/Tournaments/useTournamentItemData.d.ts +1 -1
- package/dist/components/TransactionRecords/TableFilters.d.ts +1 -1
- package/dist/icons/index.d.ts +3 -0
- package/dist/icons/index.js +3 -0
- package/dist/server/services/getSession.d.ts +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/getPercentage.d.ts +1 -1
- package/dist/utils/getPercentage.js +6 -5
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/mask.d.ts +10 -0
- package/dist/utils/mask.js +10 -0
- package/package.json +6 -10
- package/dist/components/Games/Games.client.d.ts +0 -2
- package/dist/utils/maskDisplayName.d.ts +0 -1
- package/dist/utils/maskDisplayName.js +0 -8
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type BetRecord, type BetRecordsInput, type PaginatedQueryResult } from '@opexa/portal-sdk-core';
|
|
2
|
-
import type { InfiniteQuery } from '
|
|
2
|
+
import type { InfiniteQuery } from '../../types';
|
|
3
3
|
export declare const useBetRecordsQuery: InfiniteQuery<PaginatedQueryResult<BetRecord>, BetRecordsInput>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type CreateGCashDepositInput, type Deposit } from '@opexa/portal-sdk-core';
|
|
2
2
|
import type { SetOptional } from 'type-fest';
|
|
3
|
-
import type { Mutation } from '
|
|
3
|
+
import type { Mutation } from '../../types';
|
|
4
4
|
export declare const useCreateGCashDepositMutation: Mutation<Deposit, SetOptional<CreateGCashDepositInput, 'id'>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type CreateGCashWithdrawalInput } from '@opexa/portal-sdk-core';
|
|
2
2
|
import type { SetOptional } from 'type-fest';
|
|
3
|
-
import type { Mutation } from '
|
|
3
|
+
import type { Mutation } from '../../types';
|
|
4
4
|
export declare const useCreateGCashWithdrawalMutation: Mutation<string, SetOptional<CreateGCashWithdrawalInput, 'id'>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type FavoriteGame, type Game, type GameSession } from '@opexa/portal-sdk-core';
|
|
2
|
-
import type { Mutation } from '
|
|
2
|
+
import type { Mutation } from '../../types';
|
|
3
3
|
export declare const useCreateGameSessionMutation: Mutation<GameSession, Game | FavoriteGame>;
|
|
@@ -2,7 +2,7 @@ import { createGameSession, createGameSession__legacy, getGameSession, getGameSe
|
|
|
2
2
|
import { ObjectId, ObjectType } from '@opexa/portal-sdk-core/object-id';
|
|
3
3
|
import { useMutation } from '@tanstack/react-query';
|
|
4
4
|
import invariant from 'tiny-invariant';
|
|
5
|
-
import { ENVIRONMENT, LEGACY_GAME_PROVIDERS, PLATFORM_CODE } from '../../constants/index.js';
|
|
5
|
+
import { ENVIRONMENT, LEGACY_GAME_PROVIDERS, PLATFORM_CODE, } from '../../constants/index.js';
|
|
6
6
|
import { createPoll, getCreateGameSessionMutationKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
|
|
7
7
|
import { getSession } from '../services/index.js';
|
|
8
8
|
export const useCreateGameSessionMutation = (config) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type CreateAIOInstapayWithdrawalInput } from '@opexa/portal-sdk-core';
|
|
2
2
|
import type { SetOptional } from 'type-fest';
|
|
3
|
-
import type { Mutation } from '
|
|
3
|
+
import type { Mutation } from '../../types';
|
|
4
4
|
export declare const useCreateInstapayWithdrawalMutation: Mutation<string, SetOptional<CreateAIOInstapayWithdrawalInput, 'id'>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type CreateMayaAppDepositInput, type Deposit } from '@opexa/portal-sdk-core';
|
|
2
2
|
import type { SetOptional } from 'type-fest';
|
|
3
|
-
import type { Mutation } from '
|
|
3
|
+
import type { Mutation } from '../../types';
|
|
4
4
|
export declare const useCreateMayaAppDepositMutation: Mutation<Deposit, SetOptional<CreateMayaAppDepositInput, 'id'>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type CreateMayaAppWithdrawalInput } from '@opexa/portal-sdk-core';
|
|
2
2
|
import type { SetOptional } from 'type-fest';
|
|
3
|
-
import type { Mutation } from '
|
|
3
|
+
import type { Mutation } from '../../types';
|
|
4
4
|
export declare const useCreateMayaAppWithdrawalMutation: Mutation<string, SetOptional<CreateMayaAppWithdrawalInput, 'id'>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type CreateMayaDepositInput, type Deposit } from '@opexa/portal-sdk-core';
|
|
2
2
|
import type { SetOptional } from 'type-fest';
|
|
3
|
-
import type { Mutation } from '
|
|
3
|
+
import type { Mutation } from '../../types';
|
|
4
4
|
export declare const useCreateMayaDepositMutation: Mutation<Deposit, SetOptional<CreateMayaDepositInput, 'id'>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type CreateMayaWithdrawalInput } from '@opexa/portal-sdk-core';
|
|
2
2
|
import type { SetOptional } from 'type-fest';
|
|
3
|
-
import type { Mutation } from '
|
|
3
|
+
import type { Mutation } from '../../types';
|
|
4
4
|
export declare const useCreateMayaWithdrawalMutation: Mutation<string, SetOptional<CreateMayaWithdrawalInput, 'id'>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type CreateAIOOnlineBankDepositInput, type Deposit } from '@opexa/portal-sdk-core';
|
|
2
2
|
import type { SetOptional } from 'type-fest';
|
|
3
|
-
import type { Mutation } from '
|
|
3
|
+
import type { Mutation } from '../../types';
|
|
4
4
|
export declare const useCreateOnlineBankDepositMutation: Mutation<Deposit, SetOptional<CreateAIOOnlineBankDepositInput, 'id'>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type CreateAIOQRPHDeposit, type Deposit } from '@opexa/portal-sdk-core';
|
|
2
2
|
import type { SetOptional } from 'type-fest';
|
|
3
|
-
import type { Mutation } from '
|
|
3
|
+
import type { Mutation } from '../../types';
|
|
4
4
|
export declare const useCreateQRPHDepositMutation: Mutation<Deposit, SetOptional<CreateAIOQRPHDeposit, 'id'>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type DepositRecord, type DepositRecordsInput, type PaginatedQueryResult } from '@opexa/portal-sdk-core';
|
|
2
|
-
import type { InfiniteQuery } from '
|
|
2
|
+
import type { InfiniteQuery } from '../../types';
|
|
3
3
|
export declare const useDepositRecordsQuery: InfiniteQuery<PaginatedQueryResult<DepositRecord>, DepositRecordsInput>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Query } from '
|
|
1
|
+
import type { Query } from '../../types';
|
|
2
2
|
export declare const useDepositsCountQuery: Query<number>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type FavoriteGame, type Game, type GameSession } from '@opexa/portal-sdk-core';
|
|
2
|
-
import type { Mutation } from '
|
|
2
|
+
import type { Mutation } from '../../types';
|
|
3
3
|
export declare const useEndGameSessionMutation: Mutation<void, {
|
|
4
4
|
game: Game | FavoriteGame;
|
|
5
5
|
session: GameSession;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { endGameSession, endGameSession__legacy, } from '@opexa/portal-sdk-core';
|
|
2
2
|
import { useMutation } from '@tanstack/react-query';
|
|
3
3
|
import invariant from 'tiny-invariant';
|
|
4
|
-
import { ENVIRONMENT, LEGACY_GAME_PROVIDERS, PLATFORM_CODE } from '../../constants/index.js';
|
|
4
|
+
import { ENVIRONMENT, LEGACY_GAME_PROVIDERS, PLATFORM_CODE, } from '../../constants/index.js';
|
|
5
5
|
import { getEndGameSessionMutationKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
|
|
6
6
|
import { getSession } from '../services/index.js';
|
|
7
7
|
export const useEndGameSessionMutation = (config) => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type Game, type GamesInput, type PaginatedQueryResult } from '@opexa/portal-sdk-core';
|
|
2
|
-
import type { InfiniteQuery } from '
|
|
2
|
+
import type { InfiniteQuery } from '../../types';
|
|
3
3
|
export declare const useGamesQuery: InfiniteQuery<PaginatedQueryResult<Game>, GamesInput>;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { PaginatedQueryResult } from '@opexa/portal-sdk-core';
|
|
2
|
-
import type { InfiniteQuery } from '
|
|
2
|
+
import type { InfiniteQuery } from '../../types';
|
|
3
3
|
type KnownVariables = {
|
|
4
4
|
first?: number;
|
|
5
5
|
after?: string | null;
|
|
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 = {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Query } from '
|
|
1
|
+
import type { Query } from '../../types';
|
|
2
2
|
export declare const useIsMayaSessionValidQuery: Query<boolean>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type JackpotPayout, type JackpotPayoutsInput, type PaginatedQueryResult } from '@opexa/portal-sdk-core';
|
|
2
|
-
import type { InfiniteQuery } from '
|
|
2
|
+
import type { InfiniteQuery } from '../../types';
|
|
3
3
|
export declare const useJackpotPayoutsQuery: InfiniteQuery<PaginatedQueryResult<JackpotPayout>, JackpotPayoutsInput>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getJackpotPayouts } from '@opexa/portal-sdk-core';
|
|
1
|
+
import { getJackpotPayouts, } from '@opexa/portal-sdk-core';
|
|
2
2
|
import { useInfiniteQuery } from '@tanstack/react-query';
|
|
3
3
|
import { ENVIRONMENT, PLATFORM_CODE } from '../../constants/index.js';
|
|
4
4
|
import { getJackpotPayoutsQueryKey } from '../../utils/index.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type Jackpot, type JackpotsInput, type PaginatedQueryResult } from '@opexa/portal-sdk-core';
|
|
2
|
-
import type { InfiniteQuery } from '
|
|
2
|
+
import type { InfiniteQuery } from '../../types';
|
|
3
3
|
export declare const useJackpotsQuery: InfiniteQuery<PaginatedQueryResult<Jackpot>, JackpotsInput>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useLocaleInfo: () => import("
|
|
1
|
+
export declare const useLocaleInfo: () => import("../../utils").LocaleInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Mutation } from '
|
|
1
|
+
import type { Mutation } from '../../types';
|
|
2
2
|
export declare const useMarkGameAsFavoriteMutation: Mutation<string, string>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Mutation } from '
|
|
1
|
+
import type { Mutation } from '../../types';
|
|
2
2
|
export declare const useMarkMessageAsReadMutation: Mutation<string, string>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { markMessageAsRead } from '@opexa/portal-sdk-core';
|
|
2
2
|
import { useMutation } from '@tanstack/react-query';
|
|
3
3
|
import invariant from 'tiny-invariant';
|
|
4
|
-
import { getSession } from '../../client/services/index.js';
|
|
5
4
|
import { ENVIRONMENT, PLATFORM_CODE } from '../../constants/index.js';
|
|
6
5
|
import { getMarkMessageAsReadMutationKey, getMessagesQueryKey, getQueryClient, getSessionQueryKey, getUnreadMessagesCountQueryKey, } from '../../utils/index.js';
|
|
6
|
+
import { getSession } from '../services/index.js';
|
|
7
7
|
export const useMarkMessageAsReadMutation = (config) => {
|
|
8
8
|
const queryClient = getQueryClient();
|
|
9
9
|
const mutation = useMutation({
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type Message, type MessagesInput, type PaginatedQueryResult } from '@opexa/portal-sdk-core';
|
|
2
|
-
import type { InfiniteQuery } from '
|
|
2
|
+
import type { InfiniteQuery } from '../../types';
|
|
3
3
|
export declare const useMessagesQuery: InfiniteQuery<PaginatedQueryResult<Message>, MessagesInput>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Query, Session } from '
|
|
1
|
+
import type { Query, Session } from '../../types';
|
|
2
2
|
export declare const useSessionQuery: Query<Session>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Authenticator } from '@opexa/portal-sdk-core';
|
|
2
|
-
import type { Mutation } from '
|
|
2
|
+
import type { Mutation } from '../../types';
|
|
3
3
|
import { type SignInInput } from '../services';
|
|
4
4
|
export declare const useSignInMutation: Mutation<Authenticator | null, SignInInput>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Mutation } from '
|
|
1
|
+
import type { Mutation } from '../../types';
|
|
2
2
|
export declare const useSignOutMutation: Mutation;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RegisterMemberAccountViaMobileInput } from '@opexa/portal-sdk-core';
|
|
2
|
-
import type { Mutation } from '
|
|
2
|
+
import type { Mutation } from '../../types';
|
|
3
3
|
export interface SignUpMutationInput extends RegisterMemberAccountViaMobileInput {
|
|
4
4
|
}
|
|
5
5
|
export declare const useSignUpMutation: Mutation<void, SignUpMutationInput>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type PaginatedQueryResult, type Tournament, type TournamentsInput } from '@opexa/portal-sdk-core';
|
|
2
|
-
import type { InfiniteQuery } from '
|
|
2
|
+
import type { InfiniteQuery } from '../../types';
|
|
3
3
|
export declare const useTournamentsQuery: InfiniteQuery<PaginatedQueryResult<Tournament>, TournamentsInput>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type PaginatedQueryResult, type TransactionRecord, type TransactionRecordsInput } from '@opexa/portal-sdk-core';
|
|
2
|
-
import type { InfiniteQuery } from '
|
|
2
|
+
import type { InfiniteQuery } from '../../types';
|
|
3
3
|
export declare const useTransactionRecordsQuery: InfiniteQuery<PaginatedQueryResult<TransactionRecord>, TransactionRecordsInput>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Mutation } from '
|
|
1
|
+
import type { Mutation } from '../../types';
|
|
2
2
|
export declare const useUnmarkGameAsFavoriteMutation: Mutation<void, string>;
|
|
@@ -2,7 +2,7 @@ import { getWallet } from '@opexa/portal-sdk-core';
|
|
|
2
2
|
import { useQuery } from '@tanstack/react-query';
|
|
3
3
|
import invariant from 'tiny-invariant';
|
|
4
4
|
import { ENVIRONMENT, PLATFORM_CODE } from '../../constants/index.js';
|
|
5
|
-
import { getQueryClient, getSessionQueryKey, getWalletQueryKey } from '../../utils/index.js';
|
|
5
|
+
import { getQueryClient, getSessionQueryKey, getWalletQueryKey, } from '../../utils/index.js';
|
|
6
6
|
import { getSession } from '../services/index.js';
|
|
7
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
8
8
|
export const useWalletQuery = (config) => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type PaginatedQueryResult, type WithdrawalRecord, type WithdrawalRecordsInput } from '@opexa/portal-sdk-core';
|
|
2
|
-
import type { InfiniteQuery } from '
|
|
2
|
+
import type { InfiniteQuery } from '../../types';
|
|
3
3
|
export declare const useWithdrawalRecordsQuery: InfiniteQuery<PaginatedQueryResult<WithdrawalRecord>, WithdrawalRecordsInput>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Session } from '
|
|
1
|
+
import type { Session } from '../../types';
|
|
2
2
|
export declare const getSession: () => Promise<Session>;
|
|
@@ -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();
|
|
@@ -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() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
|
-
import { useCreateQRPHDepositMutation, useDepositQuery } from '../../../../client/hooks/index.js';
|
|
3
|
+
import { useCreateQRPHDepositMutation, useDepositQuery, } from '../../../../client/hooks/index.js';
|
|
4
4
|
import { toaster } from '../../../../client/utils/index.js';
|
|
5
5
|
export function useQRPHDeposit() {
|
|
6
6
|
const [view, setView] = useState('FORM');
|
|
@@ -4,7 +4,7 @@ import { Portal } from '@ark-ui/react';
|
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { useShallow } from 'zustand/shallow';
|
|
7
|
-
import { useGlobalStore, useLocaleInfo, useWalletQuery } from '../../client/hooks/index.js';
|
|
7
|
+
import { useGlobalStore, useLocaleInfo, useWalletQuery, } from '../../client/hooks/index.js';
|
|
8
8
|
import { Wallet02Icon, XIcon } from '../../icons/index.js';
|
|
9
9
|
import { Dialog, Tabs } from '../../ui/index.js';
|
|
10
10
|
import { formatNumber } from '../../utils/index.js';
|
|
@@ -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 = [
|
package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js
CHANGED
|
@@ -8,7 +8,7 @@ import { useShallow } from 'zustand/shallow';
|
|
|
8
8
|
import { useCreateInstapayWithdrawalMutation, useGlobalStore, useInstapayBankListQuery, usePaymentSettingsQuery, } from '../../../../client/hooks/index.js';
|
|
9
9
|
import { toaster } from '../../../../client/utils/index.js';
|
|
10
10
|
import { CheckIcon, ChevronDownIcon, ChevronUpIcon, EyeIcon, EyeOffIcon, SpinnerIcon, } from '../../../../icons/index.js';
|
|
11
|
-
import { Button, Field, NumberInput, PasswordInput, Select } from '../../../../ui/index.js';
|
|
11
|
+
import { Button, Field, NumberInput, PasswordInput, Select, } from '../../../../ui/index.js';
|
|
12
12
|
import { parseDecimal } from '../../../../utils/index.js';
|
|
13
13
|
import { AmountChoices } from '../../AmountChoices.js';
|
|
14
14
|
export function InstapayWithdrawal() {
|
|
@@ -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
|
+
}
|