@opexa/portal-components 0.0.829 → 0.0.831

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.
@@ -0,0 +1,5 @@
1
+ export type BypassDomainConfig = {
2
+ domain: string;
3
+ isBypass: boolean;
4
+ };
5
+ export declare function useBypassKycChecker(bypassDomains: BypassDomainConfig[] | undefined): boolean;
@@ -0,0 +1,14 @@
1
+ 'use client';
2
+ import { useMemo } from 'react';
3
+ export function useBypassKycChecker(bypassDomains) {
4
+ const isBypassKyc = useMemo(() => {
5
+ if (typeof window === 'undefined' ||
6
+ !bypassDomains ||
7
+ bypassDomains.length === 0) {
8
+ return false;
9
+ }
10
+ const host = window.location.hostname;
11
+ return bypassDomains.some(({ domain, isBypass }) => isBypass && host === domain);
12
+ }, [bypassDomains]);
13
+ return isBypassKyc;
14
+ }
@@ -1,6 +1,6 @@
1
1
  export declare const QRPHDepositContext: (props: {
2
2
  value: {
3
- status: "confirmed" | "failed" | "idle" | "generating-qr-code" | "qr-code-generated";
3
+ status: "idle" | "confirmed" | "failed" | "generating-qr-code" | "qr-code-generated";
4
4
  deposit: import("../../../../types").Deposit | null;
5
5
  generateQRCode: (input: import("./useQRPHDeposit").GenerateQRCodeInput) => Promise<void>;
6
6
  regenerateQRCode: () => Promise<void>;
@@ -9,7 +9,7 @@ export declare const QRPHDepositContext: (props: {
9
9
  } & {
10
10
  children?: import("react").ReactNode | undefined;
11
11
  }) => React.ReactNode, useQRPHDepositContext: () => {
12
- status: "confirmed" | "failed" | "idle" | "generating-qr-code" | "qr-code-generated";
12
+ status: "idle" | "confirmed" | "failed" | "generating-qr-code" | "qr-code-generated";
13
13
  deposit: import("../../../../types").Deposit | null;
14
14
  generateQRCode: (input: import("./useQRPHDeposit").GenerateQRCodeInput) => Promise<void>;
15
15
  regenerateQRCode: () => Promise<void>;
@@ -5,7 +5,7 @@ export interface GenerateQRCodeInput {
5
5
  promo?: string | null;
6
6
  }
7
7
  export declare function useQRPHDeposit(): {
8
- status: "confirmed" | "failed" | "idle" | "generating-qr-code" | "qr-code-generated";
8
+ status: "idle" | "confirmed" | "failed" | "generating-qr-code" | "qr-code-generated";
9
9
  deposit: Deposit | null;
10
10
  generateQRCode: (input: GenerateQRCodeInput) => Promise<void>;
11
11
  regenerateQRCode: () => Promise<void>;
@@ -1,3 +1,4 @@
1
+ import { type BypassDomainConfig } from '../../client/hooks/useBypassKycChecker';
1
2
  export interface DepositWithdrawalProps {
2
3
  /** @default "/terms-of-use" */
3
4
  termsOfUseUrl?: string;
@@ -8,6 +9,9 @@ export interface DepositWithdrawalProps {
8
9
  allowUnverifiedAccounts?: boolean;
9
10
  libanganRedirectionUrl?: string;
10
11
  hasPrivacyPolicyAndTermsOfUse?: boolean;
11
- bypassDepositKycCheck?: boolean;
12
+ bypassDomains?: BypassDomainConfig[];
13
+ }
14
+ export interface ExtendedDepositWithdrawalProps extends DepositWithdrawalProps {
15
+ bypassDepositKycCheck: boolean;
12
16
  }
13
17
  export declare function DepositWithdrawal(props: DepositWithdrawalProps): import("react/jsx-runtime").JSX.Element;
@@ -4,6 +4,7 @@ import { useEffect } from 'react';
4
4
  import { z } from 'zod';
5
5
  import { useShallow } from 'zustand/shallow';
6
6
  import { useBonusesQuery } from '../../client/hooks/useBonusesQuery.js';
7
+ import { useBypassKycChecker, } from '../../client/hooks/useBypassKycChecker.js';
7
8
  import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
8
9
  import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
9
10
  import { useWalletQuery } from '../../client/hooks/useWalletQuery.js';
@@ -19,10 +20,12 @@ import { DepositWithdrawalPropsProvider } from './DepositWithdrawalContext.js';
19
20
  import { HasPendingBonuses } from './HasPendingBonuses.js';
20
21
  import { Withdrawal } from './Withdrawal/Withdrawal.js';
21
22
  export function DepositWithdrawal(props) {
23
+ const bypassDepositKycCheck = useBypassKycChecker(props.bypassDomains);
22
24
  const { hasPrivacyPolicyAndTermsOfUse = true, ...restProps } = props;
23
25
  const mergedProps = {
24
26
  ...restProps,
25
27
  hasPrivacyPolicyAndTermsOfUse,
28
+ bypassDepositKycCheck,
26
29
  };
27
30
  const globalStore = useGlobalStore(useShallow((ctx) => ({
28
31
  depositWithdrawal: ctx.depositWithdrawal,
@@ -1,6 +1,6 @@
1
- import type { DepositWithdrawalProps } from './DepositWithdrawal.lazy';
1
+ import type { ExtendedDepositWithdrawalProps } from './DepositWithdrawal.lazy';
2
2
  export declare const DepositWithdrawalPropsProvider: (props: {
3
- value: DepositWithdrawalProps;
3
+ value: ExtendedDepositWithdrawalProps;
4
4
  } & {
5
5
  children?: import("react").ReactNode | undefined;
6
- }) => React.ReactNode, useDepositWithdrawalPropsContext: () => DepositWithdrawalProps;
6
+ }) => React.ReactNode, useDepositWithdrawalPropsContext: () => ExtendedDepositWithdrawalProps;
@@ -1,4 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
+ import { type BypassDomainConfig } from '../../client/hooks/useBypassKycChecker';
2
3
  interface ClassNameEntries {
3
4
  root?: string;
4
5
  thumbnailRoot?: string;
@@ -8,7 +9,7 @@ export interface FavoriteGamesProps {
8
9
  className?: string | ClassNameEntries;
9
10
  /** @default 'Favorite Games' */
10
11
  heading?: string | ReactNode;
11
- bypassKycCheck?: boolean;
12
+ bypassDomains?: BypassDomainConfig[];
12
13
  }
13
14
  export declare function FavoriteGames__client(props: FavoriteGamesProps): import("react/jsx-runtime").JSX.Element | null;
14
15
  export {};
@@ -6,6 +6,7 @@ import Image from 'next/image';
6
6
  import { useCallback, useEffect, useState } from 'react';
7
7
  import { twMerge } from 'tailwind-merge';
8
8
  import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
9
+ import { useBypassKycChecker, } from '../../client/hooks/useBypassKycChecker.js';
9
10
  import { useFavoriteGamesQuery } from '../../client/hooks/useFavoriteGamesQuery.js';
10
11
  import { useFeatureFlag } from '../../client/hooks/useFeatureFlag.js';
11
12
  import { useSessionQuery } from '../../client/hooks/useSessionQuery.js';
@@ -18,6 +19,7 @@ import { Button } from '../../ui/Button/index.js';
18
19
  import { getGameImageUrl } from '../../utils/getGameImageUrl.js';
19
20
  import { GameLaunchTrigger } from '../GameLaunch/index.js';
20
21
  export function FavoriteGames__client(props) {
22
+ const isBypass = useBypassKycChecker(props.bypassDomains);
21
23
  const [emblaRef, emblaApi] = useEmblaCarousel({
22
24
  align: 'start',
23
25
  slidesToScroll: 3,
@@ -50,7 +52,7 @@ export function FavoriteGames__client(props) {
50
52
  const classNames = isString(props.className)
51
53
  ? { root: props.className }
52
54
  : (props.className ?? {});
53
- return (_jsxs("div", { className: classNames.root, children: [_jsxs("div", { className: "flex items-center", children: [_jsx("h2", { className: "font-semibold text-lg", children: props.heading ?? 'Favorite Games' }), _jsx("div", { className: "grow" }), _jsx("div", { className: "flex items-center justify-center gap-xl", children: _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { variant: "outline", colorScheme: "gray", className: "rounded-r-none border-r-0", onClick: onPrevButtonClick, disabled: prevBtnDisabled, "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsx(Button, { variant: "outline", colorScheme: "gray", className: "rounded-l-none", onClick: onNextButtonClick, disabled: nextBtnDisabled, "aria-label": "Next", children: _jsx(ArrowRightIcon, { className: "size-5" }) })] }) })] }), _jsx("div", { ref: emblaRef, className: "relative mt-lg lg:overflow-hidden", children: _jsx("div", { className: twMerge('grid auto-cols-[calc((100%-(0.375rem*2))/3)] grid-flow-col grid-rows-1 gap-sm lg:auto-cols-[calc((100%-(0.5rem*5))/6)] lg:gap-md'), children: games.map((game) => (_jsx(Item, { bypassKycCheck: props.bypassKycCheck, game: game, className: {
55
+ return (_jsxs("div", { className: classNames.root, children: [_jsxs("div", { className: "flex items-center", children: [_jsx("h2", { className: "font-semibold text-lg", children: props.heading ?? 'Favorite Games' }), _jsx("div", { className: "grow" }), _jsx("div", { className: "flex items-center justify-center gap-xl", children: _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { variant: "outline", colorScheme: "gray", className: "rounded-r-none border-r-0", onClick: onPrevButtonClick, disabled: prevBtnDisabled, "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsx(Button, { variant: "outline", colorScheme: "gray", className: "rounded-l-none", onClick: onNextButtonClick, disabled: nextBtnDisabled, "aria-label": "Next", children: _jsx(ArrowRightIcon, { className: "size-5" }) })] }) })] }), _jsx("div", { ref: emblaRef, className: "relative mt-lg lg:overflow-hidden", children: _jsx("div", { className: twMerge('grid auto-cols-[calc((100%-(0.375rem*2))/3)] grid-flow-col grid-rows-1 gap-sm lg:auto-cols-[calc((100%-(0.5rem*5))/6)] lg:gap-md'), children: games.map((game) => (_jsx(Item, { bypassKycCheck: isBypass, game: game, className: {
54
56
  thumbnailRoot: classNames.thumbnailRoot,
55
57
  thumbnailTitle: classNames.thumbnailTitle,
56
58
  } }, game.id))) }) })] }));
@@ -85,6 +85,7 @@ function GameImage() {
85
85
  const [imgSrc, setImgSrc] = useState(getGameImageUrl({
86
86
  reference: game.reference,
87
87
  provider: game.provider,
88
+ image: game.image,
88
89
  }));
89
90
  return (_jsx(Image, { src: imgSrc, alt: game.name, width: 200, height: 200, loading: "lazy", unoptimized: true, className: "aspect-square w-full rounded-t-md object-contain", onError: () => {
90
91
  const fallbackThumbnail = props.fallbackThumbnails?.[game.provider];
@@ -1,5 +1,6 @@
1
1
  import type { ImageProps } from 'next/image';
2
2
  import { type ReactNode } from 'react';
3
+ import { type BypassDomainConfig } from '../../client/hooks/useBypassKycChecker';
3
4
  import type { GamesInput__Next } from '../../services/cmsPortal';
4
5
  import type { GameProvider } from '../../types';
5
6
  interface ClassNameEntries {
@@ -24,7 +25,7 @@ export interface GamesCarouselProps {
24
25
  sort?: GamesInput__Next['sort'];
25
26
  className?: string | ClassNameEntries;
26
27
  fallbackThumbnails?: Partial<Record<GameProvider, ImageProps['src']>>;
27
- bypassKycCheck?: boolean;
28
+ bypassDomains?: BypassDomainConfig[];
28
29
  }
29
30
  export declare function GamesCarousel__client(props: GamesCarouselProps): import("react/jsx-runtime").JSX.Element;
30
31
  export {};
@@ -5,6 +5,7 @@ import { isString } from 'lodash-es';
5
5
  import Link from 'next/link';
6
6
  import { useCallback, useEffect, useState } from 'react';
7
7
  import { twMerge } from 'tailwind-merge';
8
+ import { useBypassKycChecker, } from '../../client/hooks/useBypassKycChecker.js';
8
9
  import { useGamesQuery } from '../../client/hooks/useGamesQuery.js';
9
10
  import { ArrowLeftIcon } from '../../icons/ArrowLeftIcon.js';
10
11
  import { ArrowRightIcon } from '../../icons/ArrowRightIcon.js';
@@ -16,6 +17,7 @@ import { Empty } from '../shared/Empty.js';
16
17
  import { Game } from './Game.js';
17
18
  import { GameContext, GamesPropsContext } from './GamesContext.js';
18
19
  export function GamesCarousel__client(props) {
20
+ const isBypass = useBypassKycChecker(props.bypassDomains);
19
21
  const numOfRows = props.numOfRows ?? 1;
20
22
  const gamesQuery = useGamesQuery({
21
23
  first: (numOfRows + 1) * 6,
@@ -63,7 +65,7 @@ export function GamesCarousel__client(props) {
63
65
  ? 'grid-rows-3'
64
66
  : numOfRows === 2
65
67
  ? 'grid-rows-2'
66
- : 'grid-rows-1'), children: games.map((game) => (_jsx(GameContext, { value: game, children: _jsx(Game, { bypassKycCheck: props.bypassKycCheck, badge: props.badge, className: {
68
+ : 'grid-rows-1'), children: games.map((game) => (_jsx(GameContext, { value: game, children: _jsx(Game, { bypassKycCheck: isBypass, badge: props.badge, className: {
67
69
  root: classNames.thumbnailRoot,
68
70
  title: classNames.thumbnailTitle,
69
71
  } }) }, game.id))) }) }))] }) }));
@@ -1,5 +1,6 @@
1
1
  import type { ImageProps } from 'next/image';
2
2
  import type { ReactNode } from 'react';
3
+ import { type BypassDomainConfig } from '../../client/hooks/useBypassKycChecker';
3
4
  import type { GamesInput__Next } from '../../services/cmsPortal';
4
5
  import type { GameProvider } from '../../types';
5
6
  interface ClassNameEntries {
@@ -24,7 +25,7 @@ export interface GamesListProps {
24
25
  className?: string | ClassNameEntries;
25
26
  pagination?: 'lazy-load' | 'paginated';
26
27
  fallbackThumbnails?: Partial<Record<GameProvider, ImageProps['src']>>;
27
- bypassKycCheck?: boolean;
28
+ bypassDomains?: BypassDomainConfig[];
28
29
  }
29
30
  export declare function GamesList__client(props: GamesListProps): import("react/jsx-runtime").JSX.Element;
30
31
  export {};
@@ -4,6 +4,7 @@ import { isString, noop } from 'lodash-es';
4
4
  import Link from 'next/link';
5
5
  import { useEffect, useState } from 'react';
6
6
  import { twMerge } from 'tailwind-merge';
7
+ import { useBypassKycChecker, } from '../../client/hooks/useBypassKycChecker.js';
7
8
  import { useGamesQuery } from '../../client/hooks/useGamesQuery.js';
8
9
  import { useInfiniteQueryHelper } from '../../client/hooks/useInfiniteQueryHelper.js';
9
10
  import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
@@ -16,6 +17,7 @@ import { Game } from './Game.js';
16
17
  import { GameContext, GamesPropsContext } from './GamesContext.js';
17
18
  import { GamesPagination } from './GamesPagination.js';
18
19
  export function GamesList__client(props) {
20
+ const isBypass = useBypassKycChecker(props.bypassDomains);
19
21
  const { pagination = 'lazy-load' } = props;
20
22
  const perPage = props.first ?? 24;
21
23
  const { loading, availableRows, totalRows, totalAvailableRows, hasNextPage, next, } = useInfiniteQueryHelper(useGamesQuery, {
@@ -50,7 +52,7 @@ export function GamesList__client(props) {
50
52
  ? props.heading.replaceAll('OneAPI', '')
51
53
  : (props.heading ?? 'Games') }), props.viewGameProvidersUrl && (_jsxs(Link, { href: props.viewGameProvidersUrl, className: "order-1 flex items-center gap-sm font-semibold text-button-tertiary-fg text-lg lg:order-none lg:text-sm", children: [_jsx(ChevronLeftIcon, { className: "size-5" }), "Back to all Providers"] }))] }), totalRows <= 0 && (_jsx(Empty, { icon: loading ? SpinnerIcon : GamingPad01Icon, title: loading ? 'Just a moment' : 'No games', message: loading
52
54
  ? 'Fetching latest games...'
53
- : 'No game is currently available. Please check back later', className: "mt-lg" })), totalRows >= 1 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "mt-lg grid grid-cols-3 gap-1.5 lg:grid-cols-6 lg:gap-2.5", children: (pagination === 'paginated' ? paginatedRows : availableRows).map((game) => (_jsx(GameContext, { value: game, children: _jsx(Game, { bypassKycCheck: props.bypassKycCheck, badge: props.badge, className: {
55
+ : 'No game is currently available. Please check back later', className: "mt-lg" })), totalRows >= 1 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "mt-lg grid grid-cols-3 gap-1.5 lg:grid-cols-6 lg:gap-2.5", children: (pagination === 'paginated' ? paginatedRows : availableRows).map((game) => (_jsx(GameContext, { value: game, children: _jsx(Game, { bypassKycCheck: isBypass, badge: props.badge, className: {
54
56
  root: classNames.thumbnailRoot,
55
57
  title: classNames.thumbnailTitle,
56
58
  } }) }, game.id))) }), _jsx("div", { className: "mt-2xl flex flex-col items-center lg:mt-3xl", children: pagination === 'paginated' && totalRows > 0 ? (_jsx(GamesPagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: (page) => {
@@ -1,3 +1,4 @@
1
+ import { type BypassDomainConfig } from '../../client/hooks/useBypassKycChecker';
1
2
  import type { GamesInput__Next } from '../../services/cmsPortal';
2
3
  export interface ClassNameEntries {
3
4
  root?: string;
@@ -11,7 +12,7 @@ interface GamesSearchProps {
11
12
  sort?: GamesInput__Next['sort'];
12
13
  className?: string | ClassNameEntries;
13
14
  placeholder?: string;
14
- bypassKycCheck?: boolean;
15
+ bypassDomains?: BypassDomainConfig[];
15
16
  }
16
17
  export declare function GamesSearch(props: GamesSearchProps): import("react/jsx-runtime").JSX.Element;
17
18
  export {};
@@ -5,6 +5,7 @@ import { isString } from 'lodash-es';
5
5
  import Image from 'next/image';
6
6
  import { useState } from 'react';
7
7
  import { twMerge } from 'tailwind-merge';
8
+ import { useBypassKycChecker, } from '../../client/hooks/useBypassKycChecker.js';
8
9
  import { useGamesQuery } from '../../client/hooks/useGamesQuery.js';
9
10
  import { SearchLgIcon } from '../../icons/SearchLgIcon.js';
10
11
  import { Button } from '../../ui/Button/index.js';
@@ -14,6 +15,7 @@ import { Presence } from '../../ui/Presence/index.js';
14
15
  import { getGameImageUrl } from '../../utils/getGameImageUrl.js';
15
16
  import { GameLaunchTrigger } from '../GameLaunch/index.js';
16
17
  export function GamesSearch(props) {
18
+ const isBypass = useBypassKycChecker(props.bypassDomains);
17
19
  const [search, setSearch] = useState('');
18
20
  const gamesQuery = useGamesQuery({
19
21
  first: props.first ?? 18,
@@ -44,7 +46,7 @@ export function GamesSearch(props) {
44
46
  api.setInputValue('');
45
47
  api.focus();
46
48
  }, children: "Clear" }));
47
- } })] }), _jsx(Portal, { children: _jsx(Combobox.Context, { children: (api) => (_jsxs(_Fragment, { children: [_jsx(Presence, { present: api.open, children: _jsx("div", { className: "fixed inset-0 z-40 bg-black/50 backdrop-blur-sm", onClick: () => api.setOpen(false) }) }), _jsx(Combobox.Positioner, { children: search.trim().length > 0 && (_jsx(Combobox.Content, { className: "z-50 max-h-[33.25rem] overflow-y-auto p-0", children: search.length >= 1 && search.length <= 2 ? (_jsx(Alert, { message: "Search requires at least 3 characters." })) : (_jsxs(_Fragment, { children: [games.length <= 0 && (_jsx(Alert, { message: "No results found" })), games.length > 0 && (_jsxs("div", { className: "p-xl", children: [_jsx(Combobox.Context, { children: (api) => (_jsx("div", { className: "grid grid-cols-3 gap-1.5 lg:grid-cols-9 lg:gap-3.5", children: games.map((game) => (_jsxs(GameLaunchTrigger, { bypassKycCheck: props.bypassKycCheck, game: game, onClick: () => {
49
+ } })] }), _jsx(Portal, { children: _jsx(Combobox.Context, { children: (api) => (_jsxs(_Fragment, { children: [_jsx(Presence, { present: api.open, children: _jsx("div", { className: "fixed inset-0 z-40 bg-black/50 backdrop-blur-sm", onClick: () => api.setOpen(false) }) }), _jsx(Combobox.Positioner, { children: search.trim().length > 0 && (_jsx(Combobox.Content, { className: "z-50 max-h-[33.25rem] overflow-y-auto p-0", children: search.length >= 1 && search.length <= 2 ? (_jsx(Alert, { message: "Search requires at least 3 characters." })) : (_jsxs(_Fragment, { children: [games.length <= 0 && (_jsx(Alert, { message: "No results found" })), games.length > 0 && (_jsxs("div", { className: "p-xl", children: [_jsx(Combobox.Context, { children: (api) => (_jsx("div", { className: "grid grid-cols-3 gap-1.5 lg:grid-cols-9 lg:gap-3.5", children: games.map((game) => (_jsxs(GameLaunchTrigger, { bypassKycCheck: isBypass, game: game, onClick: () => {
48
50
  api.setOpen(false);
49
51
  }, className: twMerge('block w-full shadow-sm', classNames.thumbnailRoot), children: [_jsx(Image, { src: getGameImageUrl({
50
52
  reference: game.reference,
@@ -1,4 +1,5 @@
1
1
  import { type ImageProps } from 'next/image';
2
+ import { type BypassDomainConfig } from '../../client/hooks/useBypassKycChecker';
2
3
  import type { GameProvider, GameProviderData, GameType } from '../../types';
3
4
  export interface ClassNameEntries {
4
5
  root?: string;
@@ -26,6 +27,6 @@ export interface SearchProps {
26
27
  viewGamesUrl?: string | ((gameProvider: GameProviderData) => string);
27
28
  gameProviderImages?: Partial<Record<GameProvider, ImageProps['src']>>;
28
29
  placeholder?: string;
29
- bypassKycCheck?: boolean;
30
+ bypassDomains?: BypassDomainConfig[];
30
31
  }
31
32
  export declare function Search(props: SearchProps): import("react/jsx-runtime").JSX.Element;
@@ -7,6 +7,7 @@ import { useEffect, useRef, useState } from 'react';
7
7
  import { twMerge } from 'tailwind-merge';
8
8
  import { useDebounceCallback } from 'usehooks-ts';
9
9
  import { useShallow } from 'zustand/shallow';
10
+ import { useBypassKycChecker, } from '../../client/hooks/useBypassKycChecker.js';
10
11
  import { useControllableState } from '../../client/hooks/useControllableState.js';
11
12
  import { useGamesQuery } from '../../client/hooks/useGamesQuery.js';
12
13
  import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
@@ -29,6 +30,7 @@ function lookup(value, compare) {
29
30
  .includes(compare.toLowerCase().replace(/\s+/g, ''));
30
31
  }
31
32
  export function Search(props) {
33
+ const isBypass = useBypassKycChecker(props.bypassDomains);
32
34
  const globalStore = useGlobalStore(useShallow((ctx) => ({
33
35
  search: ctx.search,
34
36
  })));
@@ -77,7 +79,7 @@ export function Search(props) {
77
79
  }, children: "Clear" }) })] }) }), _jsx("div", { className: "flex max-h-[85dvh] min-h-0 flex-1 flex-col", children: _jsx("div", { className: "mt-2xl p-xl pb-3xl lg:mt-2 lg:max-h-[41rem] lg:overflow-y-auto lg:rounded-xl lg:border lg:border-border-primary lg:bg-bg-primary", children: search.length <= 0 ? (_jsx(Alert, { message: "Search for your favorite game or provider." })) : search.length === 1 ? (_jsx(Alert, { message: "Search requires at least 2 characters." })) : (_jsxs(_Fragment, { children: [empty && _jsx(Alert, { message: "No results found" }), !empty && (_jsxs(_Fragment, { children: [gameProviders.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "font-semibold text-lg", children: "Providers" }), _jsx("div", { className: "mt-3.5 mb-3xl grid grid-cols-3 gap-1.5 lg:grid-cols-9 lg:gap-3.5", children: gameProviders.map((provider) => (_jsx(Link, { href: viewGamesUrl(provider), "aria-label": `View ${provider.name} games`, className: twMerge('flex h-14 w-full items-center rounded-md bg-brand-800', classNames.providerThumbnailRoot), onClick: () => {
78
80
  globalStore.search.setOpen(false);
79
81
  }, children: _jsx(Image, { src: props.gameProviderImages?.[provider.id] ??
80
- provider.logo, alt: "", width: 100, height: 50, className: twMerge('mx-auto h-auto w-full', classNames.providerThumbnailImage) }) }, provider.id))) })] })), games.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "font-semibold text-lg", children: "Games" }), _jsx("div", { className: "mt-3.5 grid grid-cols-3 gap-1.5 lg:grid-cols-9 lg:gap-3.5", children: games.map((game) => (_jsxs(GameLaunchTrigger, { bypassKycCheck: props.bypassKycCheck, game: game, className: twMerge('block w-full shadow-sm', classNames.gameThumbnailRoot), onClick: () => {
82
+ provider.logo, alt: "", width: 100, height: 50, className: twMerge('mx-auto h-auto w-full', classNames.providerThumbnailImage) }) }, provider.id))) })] })), games.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "font-semibold text-lg", children: "Games" }), _jsx("div", { className: "mt-3.5 grid grid-cols-3 gap-1.5 lg:grid-cols-9 lg:gap-3.5", children: games.map((game) => (_jsxs(GameLaunchTrigger, { bypassKycCheck: isBypass, game: game, className: twMerge('block w-full shadow-sm', classNames.gameThumbnailRoot), onClick: () => {
81
83
  globalStore.search.setOpen(false);
82
84
  }, children: [_jsx(Image, { src: getGameImageUrl({
83
85
  reference: game.reference,
@@ -4,11 +4,13 @@ type Args = {
4
4
  reference?: never;
5
5
  provider: GameProvider;
6
6
  version?: string;
7
+ image?: string | null;
7
8
  } | {
8
9
  id?: never;
9
10
  reference: string;
10
11
  provider: GameProvider;
11
12
  version?: string;
13
+ image?: string | null;
12
14
  };
13
15
  export declare const getGameImageUrl: <T extends Args>(args: T) => string;
14
16
  export {};
@@ -13,6 +13,9 @@ export const getGameImageUrl = cache((args) => {
13
13
  const rainbowBallOnline = `${STATIC_ENDPOINT}/images/${provider}/rainbow-ball-online.webp?_v=${version}`;
14
14
  const currentHour = new Date().getHours();
15
15
  const between3amAnd3pm = currentHour >= 15 || currentHour < 3;
16
+ if (args.image) {
17
+ return args.image;
18
+ }
16
19
  switch (id) {
17
20
  case MARBLE_GAME_REFERENCE:
18
21
  return between3amAnd3pm ? marbleGameOnline : marbleGameOffline;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.829",
3
+ "version": "0.0.831",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",