lkd-web-kit 0.7.18 → 0.7.20

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.
@@ -25,14 +25,12 @@ const InfinityLoadMoreButton = ({
25
25
  if (hasNextPage && !isFetchingNextPage && entry?.isIntersecting) fetchNextPage();
26
26
  }, [entry?.isIntersecting]);
27
27
  const showLoader = infinity.isLoading || infinity.isFetchingNextPage;
28
- const showEndMessage = infinity.data && infinity.data.pages.length > 1 && !infinity.hasNextPage;
29
- if (showLoader && !showEndMessage) return null;
30
28
  return /* @__PURE__ */ jsxRuntime.jsx(
31
29
  core.Button,
32
30
  {
33
31
  ref,
34
32
  onClick: () => fetchNextPage(),
35
- className: clsx((!hasNextPage || isFetchingNextPage) && "pointer-events-none", "font-medium"),
33
+ className: clsx((!hasNextPage || showLoader) && "pointer-events-none", "font-medium"),
36
34
  variant: "transparent",
37
35
  color: !hasNextPage ? "gray" : void 0,
38
36
  ...props,
@@ -21,14 +21,12 @@ const InfinityLoadMoreButton = ({
21
21
  if (hasNextPage && !isFetchingNextPage && entry?.isIntersecting) fetchNextPage();
22
22
  }, [entry?.isIntersecting]);
23
23
  const showLoader = infinity.isLoading || infinity.isFetchingNextPage;
24
- const showEndMessage = infinity.data && infinity.data.pages.length > 1 && !infinity.hasNextPage;
25
- if (showLoader && !showEndMessage) return null;
26
24
  return /* @__PURE__ */ jsx(
27
25
  Button,
28
26
  {
29
27
  ref,
30
28
  onClick: () => fetchNextPage(),
31
- className: clsx((!hasNextPage || isFetchingNextPage) && "pointer-events-none", "font-medium"),
29
+ className: clsx((!hasNextPage || showLoader) && "pointer-events-none", "font-medium"),
32
30
  variant: "transparent",
33
31
  color: !hasNextPage ? "gray" : void 0,
34
32
  ...props,
package/dist/index.d.ts CHANGED
@@ -320,7 +320,7 @@ export declare function indexBy<T, K, C extends string>(arr: T[], getKey: (item:
320
320
 
321
321
  export declare type IndexByResult<T> = Record<string, T | undefined>;
322
322
 
323
- export declare const InfinityLoadMoreButton: <T>({ infinity, labels, parentRef, ...props }: InfinityLoadMoreButtonProps<T>) => JSX.Element | null;
323
+ export declare const InfinityLoadMoreButton: <T>({ infinity, labels, parentRef, ...props }: InfinityLoadMoreButtonProps<T>) => JSX.Element;
324
324
 
325
325
  export declare interface InfinityLoadMoreButtonProps<T> extends ButtonProps {
326
326
  infinity: InfiniteQueryHookResult<InfiniteData<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkd-web-kit",
3
- "version": "0.7.18",
3
+ "version": "0.7.20",
4
4
  "description": "A template for creating React component libraries with Vite.",
5
5
  "author": "LKD",
6
6
  "license": "MIT",