@opexa/portal-components 0.1.39 → 0.1.40
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.
|
@@ -104,6 +104,19 @@ export function Search(props) {
|
|
|
104
104
|
const normalizedSearch = normalizeGameName(search);
|
|
105
105
|
games = games.filter((game) => normalizeGameName(game.name).includes(normalizedSearch));
|
|
106
106
|
}
|
|
107
|
+
const providersFromGameTypes = gameTypesFiltered.length > 0 && games.length > 0
|
|
108
|
+
? [
|
|
109
|
+
...new Set(games
|
|
110
|
+
.filter((game) => gameTypesFiltered.some((gt) => gt.id === game.type))
|
|
111
|
+
.map((game) => game.provider)),
|
|
112
|
+
]
|
|
113
|
+
.map((providerId) => GAME_PROVIDER_DATA[providerId])
|
|
114
|
+
.filter((p) => p != null)
|
|
115
|
+
: [];
|
|
116
|
+
const displayGameProviders = [
|
|
117
|
+
...gameProviders,
|
|
118
|
+
...providersFromGameTypes.filter((p) => !gameProviders.some((gp) => gp.id === p.id)),
|
|
119
|
+
];
|
|
107
120
|
const hasNextPage = gamesQuery.hasNextPage || collapsedGamesQuery.hasNextPage;
|
|
108
121
|
function fetchNextPage() {
|
|
109
122
|
if (gamesQuery.hasNextPage) {
|
|
@@ -147,7 +160,7 @@ export function Search(props) {
|
|
|
147
160
|
featureFlag.enabled && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "font-semibold text-lg", children: "Type" }), _jsx("div", { className: "mt-3.5 mb-3xl grid grid-cols-3 gap-1.5 lg:grid-cols-9 lg:gap-3.5", children: gameTypesFiltered.map((type) => (_jsx(Link, { href: viewGameTypeUrl(type), "aria-label": `View ${type.name} games`, className: twMerge('flex h-14 w-full items-center rounded-md bg-bg-primary-alt', classNames.gameTypeThumbnailRoot), onClick: () => {
|
|
148
161
|
globalStore.search.setOpen(false);
|
|
149
162
|
}, children: _jsx(Image, { src: (props.gameTypeImages?.[type.id] ??
|
|
150
|
-
defaultGameTypeImages[type.id]), alt: "", width: 100, height: 50, className: twMerge('mx-auto h-auto w-full', classNames.gameTypeThumbnailName) }) }, type.id))) })] })),
|
|
163
|
+
defaultGameTypeImages[type.id]), alt: "", width: 100, height: 50, className: twMerge('mx-auto h-auto w-full', classNames.gameTypeThumbnailName) }) }, type.id))) })] })), displayGameProviders.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: displayGameProviders.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: () => {
|
|
151
164
|
globalStore.search.setOpen(false);
|
|
152
165
|
}, children: _jsx(Image, { src: props.gameProviderImages?.[provider.id] ??
|
|
153
166
|
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: twMerge('mt-3.5 grid grid-cols-3 gap-1.5 lg:grid-cols-9 lg:gap-3.5', classNames.gameSearchResult), children: games.map((game) => (_jsxs(GameLaunchTrigger, { bypassKycCheck: isBypass, game: game, className: twMerge('block w-full shadow-sm', classNames.gameThumbnailRoot), onClick: () => {
|