@opexa/portal-components 0.0.800 → 0.0.801

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.
@@ -29,5 +29,9 @@ export interface GameProvidersListProps {
29
29
  showAllProviders?: boolean;
30
30
  viewAllUrl?: string;
31
31
  futureGameProviders?: GameProvider[];
32
+ providerUrlMappings?: {
33
+ providers: GameProvider[];
34
+ url: string;
35
+ }[];
32
36
  }
33
37
  export declare function GameProvidersList(props: GameProvidersListProps): import("react/jsx-runtime").JSX.Element;
@@ -32,6 +32,12 @@ export function GameProvidersList(props) {
32
32
  : chunked.loadedItems;
33
33
  return (_jsxs("div", { className: classNames.root, children: [_jsx("h2", { className: "font-semibold text-lg", children: props.heading ?? 'Providers' }), _jsxs("div", { className: "mt-lg grid grid-cols-3 gap-1.5 lg:grid-cols-6 lg:gap-2.5", children: [props.showAllProviders && (_jsx(Link, { href: props.viewAllUrl ?? '/providers', className: twMerge('flex h-full w-full items-center justify-center overflow-hidden rounded-md bg-brand-800 font-extrabold lg:h-[5.75rem]', classNames.thumbnailRoot), "aria-label": `View all games`, children: _jsx("p", { className: "text-center text-4xl", children: " ALL" }) })), items.map((provider) => {
34
34
  const customLogo = props.gameProviderImages?.[provider.id];
35
- return (_jsx(Link, { href: viewGamesUrl(provider), className: twMerge('flex h-full w-full items-center overflow-hidden rounded-md bg-brand-800 lg:h-[5.75rem]', !customLogo && 'px-2 py-1.5', classNames.thumbnailRoot), "aria-label": `View ${provider.name} games`, children: _jsx(Image, { src: customLogo ?? provider.logo, alt: "", width: 300, height: 150, className: twMerge('mx-auto h-auto w-full', classNames.thumbnailImage) }) }, provider.id));
35
+ const url = props.providerUrlMappings
36
+ ? (props.providerUrlMappings
37
+ ?.find(({ providers }) => providers.includes(provider.id))
38
+ ?.url.replace(':slug', provider.slug)
39
+ .replace(':id', provider?.id) ?? `/providers/${provider.slug}`)
40
+ : null;
41
+ return (_jsx(Link, { href: url ?? viewGamesUrl(provider), className: twMerge('flex h-full w-full items-center overflow-hidden rounded-md bg-brand-800 lg:h-[5.75rem]', !customLogo && 'px-2 py-1.5', classNames.thumbnailRoot), "aria-label": `View ${provider.name} games`, children: _jsx(Image, { src: customLogo ?? provider.logo, alt: "", width: 300, height: 150, className: twMerge('mx-auto h-auto w-full', classNames.thumbnailImage) }) }, provider.id));
36
42
  })] }), !props.showAllProviders && (_jsxs("div", { className: "mt-2xl flex flex-col items-center lg:mt-3xl", children: [_jsx(Progress.Root, { min: 0, max: chunked.totalItems, value: chunked.totalLoadedItems, onValueChange: noop, className: twMerge('w-[12.5rem]', classNames.progressRoot), children: _jsx(Progress.Track, { className: twMerge('bg-bg-tertiary', classNames.progressTrack), children: _jsx(Progress.Range, {}) }) }), _jsx("p", { className: "mt-md text-button-tertiary-fg text-sm", children: `Displaying ${chunked.totalLoadedItems} of ${chunked.totalItems}` }), chunked.hasNext && (_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, onClick: chunked.next, className: twMerge('mt-lg', classNames.loadMoreButton), children: "Load More" }))] }))] }));
37
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.800",
3
+ "version": "0.0.801",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",