@opexa/portal-components 0.0.1104 → 0.0.1106

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.
@@ -1,11 +1,21 @@
1
- import { useInfiniteQuery } from '@tanstack/react-query';
1
+ import { useInfiniteQuery, useQueryClient } from '@tanstack/react-query';
2
+ import { useEffect } from 'react';
2
3
  import { getJackpotsNext } from '../../services/report.js';
3
4
  import { getJackpotsNextQueryKey } from '../../utils/queryKeys.js';
5
+ import { useSessionQuery } from './useSessionQuery.js';
4
6
  export const useJackpotsNextQuery = (input, config) => {
7
+ const queryClient = useQueryClient();
8
+ const sessionQuery = useSessionQuery();
9
+ // biome-ignore lint/correctness/useExhaustiveDependencies: intentionally only re-runs on session status change; input is stable per call site and queryClient is stable from useQueryClient
10
+ useEffect(() => {
11
+ if (sessionQuery.data?.status === 'authenticated') {
12
+ queryClient.invalidateQueries({
13
+ queryKey: getJackpotsNextQueryKey(input),
14
+ });
15
+ }
16
+ }, [sessionQuery.data?.status]);
5
17
  const query = useInfiniteQuery({
6
- refetchOnMount: false,
7
- refetchOnReconnect: false,
8
- refetchOnWindowFocus: false,
18
+ staleTime: 0,
9
19
  ...config,
10
20
  queryKey: getJackpotsNextQueryKey(input),
11
21
  queryFn: ({ pageParam, signal }) => {
@@ -17,9 +17,6 @@ export const useJackpotsQuery = (input, config) => {
17
17
  }
18
18
  }, [sessionQuery.data?.status]);
19
19
  const query = useInfiniteQuery({
20
- refetchOnMount: false,
21
- refetchOnReconnect: false,
22
- refetchOnWindowFocus: false,
23
20
  staleTime: 0,
24
21
  ...config,
25
22
  queryKey: getJackpotsQueryKey(input),
@@ -13,7 +13,7 @@ const JackpotsListItemDesktop = dynamic(() => import('./JackpotsListItemDesktop.
13
13
  const JackpotsListItemMobile = dynamic(() => import('./JackpotsListItemMobile.js').then((mod) => mod.JackpotsListItemMobile));
14
14
  export function JackpotsListNext(props) {
15
15
  const jackpotsNextQuery = useJackpotsNextQuery({
16
- first: 25,
16
+ first: 100,
17
17
  filter: {
18
18
  deleted: {
19
19
  equal: false,
@@ -41,5 +41,5 @@ export function JackpotsListItemGameProviders({ gameProviders, }) {
41
41
  emblaApi.on('select', onSelect);
42
42
  emblaApi.on('reInit', onSelect);
43
43
  }, [emblaApi, onSelect]);
44
- return (_jsxs("div", { className: twMerge('p-4 pb-8', classNames.providerRoot), children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: twMerge('font-semibold text-lg text-text-primary-900', classNames.providerHeading), children: "Jackpot Game Providers" }), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { disabled: !canScrollPrev, onClick: scrollPrev, variant: "outline", colorScheme: "gray", className: twMerge('rounded-r-none border-r-0', classNames.providerNavigationButton), "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsxs(Button, { disabled: !canScrollNext, onClick: scrollNext, variant: "outline", colorScheme: "gray", className: twMerge('rounded-l-none', classNames.providerNavigationButton), "aria-label": "Next", children: [_jsx("span", { className: "sr-only", children: "Next" }), _jsx(ArrowRightIcon, { className: "size-5" })] })] })] }), _jsx("div", { className: "relative mt-3 overflow-hidden", ref: emblaRef, children: _jsx("div", { className: "flex gap-3.5", children: gameProviders.map((provider) => (_jsx(Link, { href: provider.redirectUrl, className: twMerge('min-w-27.5 rounded-md bg-brand-800 lg:bg-bg-primary-900', classNames.providerThumbnailRoot), children: _jsx(Image, { src: provider.providedLogo ?? provider.logo, alt: "provider", className: twMerge('size-full', classNames.providerThumbnailImage), width: 300, height: 150 }) }, provider.slug))) }) })] }));
44
+ return (_jsxs("div", { className: twMerge('p-4 pb-8', classNames.providerRoot), children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: twMerge('font-semibold text-lg text-text-primary-900', classNames.providerHeading), children: "Jackpot Game Providers" }), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { disabled: !canScrollPrev, onClick: scrollPrev, variant: "outline", colorScheme: "gray", className: twMerge('rounded-r-none border-r-0', classNames.providerNavigationButton), "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsxs(Button, { disabled: !canScrollNext, onClick: scrollNext, variant: "outline", colorScheme: "gray", className: twMerge('rounded-l-none', classNames.providerNavigationButton), "aria-label": "Next", children: [_jsx("span", { className: "sr-only", children: "Next" }), _jsx(ArrowRightIcon, { className: "size-5" })] })] })] }), _jsx("div", { className: "relative mt-3 overflow-hidden", ref: emblaRef, children: _jsx("div", { className: "flex gap-3.5", children: gameProviders.map((provider) => (_jsx(Link, { href: provider.redirectUrl, className: twMerge('flex min-w-27.5 items-center justify-center rounded-md bg-brand-800 lg:bg-bg-primary-900', classNames.providerThumbnailRoot), children: _jsx(Image, { src: provider.providedLogo ?? provider.logo, alt: "provider", className: twMerge('size-1/2 object-contain', classNames.providerThumbnailImage), width: 300, height: 150 }) }, provider.slug))) }) })] }));
45
45
  }
@@ -44,5 +44,5 @@ export function TournamentsListItemGameProviders({ gameProviders, }) {
44
44
  emblaApi.on('select', onSelect);
45
45
  emblaApi.on('reInit', onSelect);
46
46
  }, [emblaApi, onSelect]);
47
- return (_jsxs("div", { className: "p-4 pb-8", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "font-semibold text-lg text-text-primary-900", children: "Tournament Game Providers" }), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { disabled: !canScrollPrev, onClick: scrollPrev, variant: "outline", colorScheme: "gray", className: "rounded-r-none border-r-0", "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsxs(Button, { disabled: !canScrollNext, onClick: scrollNext, variant: "outline", colorScheme: "gray", className: "rounded-l-none", "aria-label": "Next", children: [_jsx("span", { className: "sr-only", children: "Next" }), _jsx(ArrowRightIcon, { className: "size-5" })] })] })] }), _jsx("div", { className: "relative mt-3 overflow-hidden", ref: emblaRef, children: _jsx("div", { className: "flex gap-3.5", children: gameProviders.map((provider) => (_jsx(Link, { href: viewGamesUrl(provider), className: "min-w-27.5 rounded-md bg-gray-800", children: _jsx(Image, { src: provider.logo, alt: "provider", className: "size-full", width: 300, height: 150 }) }, provider.slug))) }) })] }));
47
+ return (_jsxs("div", { className: "p-4 pb-8", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "font-semibold text-lg text-text-primary-900", children: "Tournament Game Providers" }), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { disabled: !canScrollPrev, onClick: scrollPrev, variant: "outline", colorScheme: "gray", className: "rounded-r-none border-r-0", "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsxs(Button, { disabled: !canScrollNext, onClick: scrollNext, variant: "outline", colorScheme: "gray", className: "rounded-l-none", "aria-label": "Next", children: [_jsx("span", { className: "sr-only", children: "Next" }), _jsx(ArrowRightIcon, { className: "size-5" })] })] })] }), _jsx("div", { className: "relative mt-3 overflow-hidden", ref: emblaRef, children: _jsx("div", { className: "flex gap-3.5", children: gameProviders.map((provider) => (_jsx(Link, { href: viewGamesUrl(provider), className: "flex min-w-27.5 items-center justify-center rounded-md bg-brand-800 lg:bg-bg-primary-900", children: _jsx(Image, { src: provider.logo, alt: "provider", className: "size-1/2 object-contain", width: 300, height: 150 }) }, provider.slug))) }) })] }));
48
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.1104",
3
+ "version": "0.0.1106",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",