@opexa/portal-components 0.0.444 → 0.0.445

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.
@@ -14,6 +14,7 @@ export const useAvailableQuestsQuery = (config) => {
14
14
  ? false
15
15
  : sessionQuery.data?.status === 'authenticated',
16
16
  queryKey: getAvailableQuestsQueryKey(),
17
+ refetchInterval: 5000,
17
18
  queryFn: async ({ signal }) => {
18
19
  const session = await queryClient.fetchQuery({
19
20
  queryKey: getSessionQueryKey(),
@@ -1,4 +1,4 @@
1
1
  import { type JackpotsCarouselProps } from './JackpotsCarousel/JackpotsCarousel';
2
2
  import { type JackpotsListProps } from './JackpotsList/JackpotsList';
3
- export type JackpotsProps = (JackpotsCarouselProps | JackpotsListProps);
3
+ export type JackpotsProps = JackpotsCarouselProps | JackpotsListProps;
4
4
  export declare function Jackpots(props: JackpotsProps): Promise<import("react/jsx-runtime").JSX.Element>;
@@ -6,9 +6,6 @@ export async function Jackpots(props) {
6
6
  await prefetchJackpotsQuery({
7
7
  first: 100,
8
8
  filter: {
9
- status: {
10
- equal: 'ACTIVE',
11
- },
12
9
  deleted: {
13
10
  equal: false,
14
11
  },
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import useEmblaCarousel from 'embla-carousel-react';
4
4
  import { isString } from 'lodash-es';
5
5
  import Link from 'next/link';
6
- import { useCallback, useEffect, useState } from 'react';
6
+ import { useCallback, useEffect, useState, } from 'react';
7
7
  import { useJackpotsQuery } from '../../../client/hooks/useJackpotsQuery.js';
8
8
  import { ArrowLeftIcon } from '../../../icons/ArrowLeftIcon.js';
9
9
  import { ArrowRightIcon } from '../../../icons/ArrowRightIcon.js';
@@ -43,9 +43,6 @@ export function JackpotsCarousel({ style, className, ...props }) {
43
43
  const jackpotsQuery = useJackpotsQuery({
44
44
  first: 100,
45
45
  filter: {
46
- status: {
47
- equal: 'ACTIVE',
48
- },
49
46
  deleted: {
50
47
  equal: false,
51
48
  },
@@ -18,4 +18,4 @@ export interface JackpotsCarouselItemProps {
18
18
  animate?: boolean;
19
19
  jackpotProfileShape?: 'oval' | 'star';
20
20
  }
21
- export declare function JackpotsCarouselItem({ style, className, viewAllUrl, animate, customJackpotChestImage, jackpotProfileShape, }: JackpotsCarouselItemProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function JackpotsCarouselItem({ style, className, viewAllUrl, animate, customJackpotChestImage, jackpotProfileShape, }: JackpotsCarouselItemProps): import("react/jsx-runtime").JSX.Element | null;
@@ -85,6 +85,9 @@ export function JackpotsCarouselItem({ style, className, viewAllUrl, animate = t
85
85
  }, [minLimitTooltipOpen, isMobileDevice]);
86
86
  const ProfileIcon = () => jackpotProfileShape === 'oval' ? (_jsxs("div", { className: "relative flex h-18 w-18 items-center justify-center rounded-full bg-bg-tertiary", children: [_jsx(User01Icon, { className: "size-9 text-text-quarterary-500" }), _jsx("div", { className: twMerge('absolute right-0 bottom-0 flex h-6 w-6 items-center justify-center rounded-full border-[1.5px] border-bg-primary bg-yellow-400 font-bold text-brand-950 text-xs', className?.latestPayoutRankRoot), children: "1st" })] })) : (_jsxs("div", { className: "relative grid h-18 w-18", children: [_jsx(StarIcon, { className: "col-start-1 row-start-1 h-full w-full" }), _jsx(User01Icon, { className: "z-10 col-start-1 row-start-1 size-9 place-self-center text-text-quarterary-500" }), _jsx("div", { className: twMerge('-right-0 absolute bottom-0 z-20 flex h-7 w-7 items-center justify-center rounded-full border-[1.5px] border-bg-primary bg-yellow-400 text-center font-bold text-brand-950 text-xs', className?.latestPayoutRankRoot), children: "1st" })] }));
87
87
  const PayoutBadge = () => (_jsxs("div", { className: twMerge('flex h-fit w-fit items-center gap-1 rounded-sm border border-utility-brand-200 bg-utility-brand-50 px-2 py-0.5 font-medium text-utility-brand-700 text-xs', className?.latestPayoutBadgeRoot), children: [_jsx(Trophy01Icon, { className: twMerge('size-3.5 text-utility-brand-600', className?.latestPayoutBadgeIcon) }), "Latest Payout"] }));
88
+ if (jackpot.status === 'DISABLED' && jackpot.drawing !== true) {
89
+ return null;
90
+ }
88
91
  return (_jsxs("div", { className: twMerge('relative flex w-full shrink-0 rounded-2xl border border-border-primary bg-bg-tertiary p-3 text-center lg:gap-4 lg:p-5', className?.itemRoot), style: style, children: [_jsxs("div", { className: "relative z-1 flex flex-1 flex-col", children: [_jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsxs("div", { className: "flex w-full flex-col", children: [_jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { children: [isPayingOut ? (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-success-200 bg-utility-success-50 px-2 py-0.5 font-medium text-utility-success-700 text-xs", children: [_jsx("span", { className: "full size-1.5 animate-pulse rounded bg-utility-success-500" }), "Paying Out"] })) : (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-blue-200 bg-utility-blue-50 px-2 py-0.5 font-medium text-utility-blue-700 text-xs", children: [_jsx(ArrowNarrowUpRightIcon, { className: "size-3.5 text-utility-blue-500" }), "Accumulating"] })), _jsx("div", { className: "mt-1 text-left font-medium text-lg text-text-primary-900 lg:mt-5 lg:text-2xl", children: jackpot.name }), _jsx("div", { className: twMerge('mt-1.5 w-fit rounded-md bg-bg-primary px-2 py-1 font-bold text-2xl text-brand-400 lg:mt-2 lg:text-4xl', className?.jackpotAmountRoot), children: formatNumber(jackpotAmount, {
89
92
  currency: localeInfo.currency.code,
90
93
  minDecimalPlaces: 2,
@@ -143,7 +146,7 @@ export function JackpotsCarouselItem({ style, className, viewAllUrl, animate = t
143
146
  minDecimalPlaces: 2,
144
147
  maxDecimalPlaces: 2,
145
148
  }) }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: format(new Date(jp.dateTimeCreated), 'dd MMM yyyy h:mm a') })] }, i)))
146
- : Array.from({ length: 10 }).map((_, i) => (_jsx("tr", { className: twMerge('bg-bg-primary text-sm text-text-secondary-700', className?.recentPayoutsTableBodyRow), children: Array.from({ length: 5 }).map((_, j) => (_jsx("td", { className: twMerge("h-12 border-border-secondary border-t-2", className?.recentPayoutsTableBodyData), children: "-" }, j))) }, i))) })] }) }) })] }), isPayingOut && animate && (_jsx("div", { className: twMerge(styles['light-rays'], 'absolute top-0 right-0 rounded-2xl [--light-rays-top:25%] lg:[--light-rays-top:9.375rem]') }))] }));
149
+ : Array.from({ length: 10 }).map((_, i) => (_jsx("tr", { className: twMerge('bg-bg-primary text-sm text-text-secondary-700', className?.recentPayoutsTableBodyRow), children: Array.from({ length: 5 }).map((_, j) => (_jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2', className?.recentPayoutsTableBodyData), children: "-" }, j))) }, i))) })] }) }) })] }), isPayingOut && animate && (_jsx("div", { className: twMerge(styles['light-rays'], 'absolute top-0 right-0 rounded-2xl [--light-rays-top:25%] lg:[--light-rays-top:9.375rem]') }))] }));
147
150
  }
148
151
  const getAccumulatingJackpotDescription = (part, total) => {
149
152
  const percentage = total === 0 ? 0 : (part / total) * 100;
@@ -12,9 +12,6 @@ export function JackpotsList(props) {
12
12
  const jackpotsQuery = useJackpotsQuery({
13
13
  first: 100,
14
14
  filter: {
15
- status: {
16
- equal: 'ACTIVE',
17
- },
18
15
  deleted: {
19
16
  equal: false,
20
17
  },
@@ -16,5 +16,5 @@ interface JackpotsListItemDesktopProps {
16
16
  };
17
17
  jackpotProfileShape?: 'oval' | 'star';
18
18
  }
19
- export declare function JackpotsListItemDesktop({ animate, customJackpotChestImage, jackpotProfileShape, className, ...props }: JackpotsListItemDesktopProps): import("react/jsx-runtime").JSX.Element;
19
+ export declare function JackpotsListItemDesktop({ animate, customJackpotChestImage, jackpotProfileShape, className, ...props }: JackpotsListItemDesktopProps): import("react/jsx-runtime").JSX.Element | null;
20
20
  export {};
@@ -65,6 +65,9 @@ export function JackpotsListItemDesktop({ animate = true, customJackpotChestImag
65
65
  maxDecimalPlaces: 2,
66
66
  }) }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: format(new Date(jackpotPayout.dateTimeCreated), 'dd MMM yyyy h:mm a') })] }, i)))
67
67
  : Array.from({ length: 10 }).map((_, i) => (_jsx("tr", { className: twMerge('bg-bg-primary text-sm text-text-secondary-700', className?.recentPayoutsTableBodyRow), children: Array.from({ length: 5 }).map((_, j) => (_jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2', className?.recentPayoutsTableBodyData), children: "-" }, j))) }, i))) })] }) }) }));
68
+ if (jackpot.status === 'DISABLED' && jackpot.drawing !== true) {
69
+ return null;
70
+ }
68
71
  return (_jsxs("div", { className: twMerge('rounded-2xl border border-border-primary bg-bg-tertiary', className?.itemRoot), children: [_jsxs("div", { style: props.style, className: twMerge('relative flex shrink-0 rounded-2xl p-3 text-center lg:gap-4 lg:p-5'), children: [_jsxs("div", { className: "relative z-1 flex flex-1 flex-col", children: [_jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsxs("div", { className: "flex w-full flex-col", children: [_jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { children: [isPayingOut ? (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-success-200 bg-utility-success-50 px-2 py-0.5 font-medium text-utility-success-700 text-xs", children: [_jsx("span", { className: "full size-1.5 animate-pulse rounded bg-utility-success-500" }), "Paying Out"] })) : (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-blue-200 bg-utility-blue-50 px-2 py-0.5 font-medium text-utility-blue-700 text-xs", children: [_jsx(ArrowNarrowUpRightIcon, { className: "size-3.5 text-utility-blue-500" }), "Accumulating"] })), _jsx("div", { className: "mt-1 text-left font-medium text-lg text-text-primary-900 lg:mt-5 lg:text-2xl", children: jackpot.name }), _jsx("div", { className: twMerge('mt-1.5 w-fit rounded-md bg-bg-primary px-2 py-1 font-bold text-2xl text-brand-400 lg:mt-2 lg:text-4xl', className?.jackpotAmountRoot), children: formatNumber(jackpotAmount, {
69
72
  currency: localeInfo.currency.code,
70
73
  minDecimalPlaces: 2,
@@ -16,5 +16,5 @@ interface JackpotsListItemMobileProps {
16
16
  };
17
17
  jackpotProfileShape?: 'oval' | 'star';
18
18
  }
19
- export declare function JackpotsListItemMobile({ animate, customJackpotChestImage, jackpotProfileShape, className, ...props }: JackpotsListItemMobileProps): import("react/jsx-runtime").JSX.Element;
19
+ export declare function JackpotsListItemMobile({ animate, customJackpotChestImage, jackpotProfileShape, className, ...props }: JackpotsListItemMobileProps): import("react/jsx-runtime").JSX.Element | null;
20
20
  export {};
@@ -100,6 +100,9 @@ export function JackpotsListItemMobile({ animate = true, customJackpotChestImage
100
100
  maxDecimalPlaces: 2,
101
101
  }) }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: format(new Date(jackpotPayout.dateTimeCreated), 'dd MMM yyyy h:mm a') })] }, i)))
102
102
  : Array.from({ length: 10 }).map((_, i) => (_jsx("tr", { className: twMerge('bg-bg-primary text-left text-sm text-text-secondary-700', className?.recentPayoutsTableBodyRow), children: Array.from({ length: 5 }).map((_, j) => (_jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: "-" }, j))) }, i))) })] }) }));
103
+ if (jackpot.status === 'DISABLED' && jackpot.drawing !== true) {
104
+ return null;
105
+ }
103
106
  return (_jsxs("div", { className: twMerge('rounded-2xl border border-border-primary bg-bg-primary', className?.itemRoot), children: [_jsxs("div", { style: props.style, className: "relative flex shrink-0 rounded-2xl bg-bg-tertiary p-3 text-center lg:gap-4 lg:p-5", children: [_jsxs("div", { className: "relative z-1 flex flex-1 flex-col", children: [_jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsx("div", { className: "flex w-full flex-col", children: _jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { children: [isPayingOut ? (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-success-200 bg-utility-success-50 px-2 py-0.5 font-medium text-utility-success-700 text-xs", children: [_jsx("span", { className: "full size-1.5 animate-pulse rounded bg-utility-success-500" }), "Paying Out"] })) : (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-blue-200 bg-utility-blue-50 px-2 py-0.5 font-medium text-utility-blue-700 text-xs", children: [_jsx(ArrowNarrowUpRightIcon, { className: "size-3.5 text-utility-blue-500" }), "Accumulating"] })), _jsx("div", { className: "mt-1 text-left font-medium text-lg text-text-primary-900 lg:mt-5 lg:text-2xl", children: jackpot.name }), _jsx("div", { className: twMerge('mt-1.5 w-fit rounded-md bg-bg-primary px-2 py-1 font-bold text-2xl text-brand-400 lg:mt-2 lg:text-4xl', className?.jackpotAmountRoot), children: formatNumber(jackpotAmount, {
104
107
  currency: localeInfo.currency.code,
105
108
  minDecimalPlaces: 2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.444",
3
+ "version": "0.0.445",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",