@pickaxeproject/react 3.1.0 → 3.1.1
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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),i=require("react-intersection-observer"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),i=require("react-intersection-observer"),r=require("../../../../hooks/pickaxe/usePickaxeContext.js"),a=require("../../../../hooks/pickaxe/useHistory.js"),t=require("../../../Icons/spinner-circle.svg.js"),n=require("./Item.js");exports.default=()=>{var l,c;const{styles:o,colors:u,misc:x}=r.usePickaxeContext(),d=a.useHistory({enabled:null===(l=x.isHistory)||void 0===l||l}),m=!!x.isHistory&&d.isLoading,{ref:g}=i.useInView({onChange(e){e&&d.hasNextPage&&d.fetchNextPage()}});return m?e.jsx("div",{className:"w-full min-h-[300px] animate-pulse bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===o.theme?"#1E1E1F":"#E5E7EB"}}):d.isError?e.jsx("div",{}):e.jsxs("div",Object.assign({className:"flex flex-col gap-y-8"},{children:[null===(c=d.data)||void 0===c?void 0:c.pages.map(((i,r)=>e.jsx(s.Fragment,{children:i.data.map((i=>e.jsx(s.Fragment,{children:e.jsx(n.default,{item:i})},i.responseId)))},r))),e.jsx("div",Object.assign({className:"flex items-center justify-center"},{children:d.isFetchingNextPage?e.jsx(t.default,{className:"my-10 h-14 w-14 animate-spin animate-spin text-gray-300",style:{fill:u.accent}}):d.hasNextPage?e.jsx("div",{ref:g,className:"invisible h-14 w-14"}):null}))]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as s}from"react/jsx-runtime";import{Fragment as i}from"react";import{useInView as a}from"react-intersection-observer";import{usePickaxeContext as t}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useHistory as r}from"../../../../hooks/pickaxe/useHistory.js";import o from"../../../Icons/spinner-circle.svg.js";import n from"./Item.js";const c=()=>{var c,l;const{styles:m,colors:d,misc:p}=t(),f=r({enabled:null===(c=p.isHistory)||void 0===c||c}),{ref:
|
|
1
|
+
import{jsx as e,jsxs as s}from"react/jsx-runtime";import{Fragment as i}from"react";import{useInView as a}from"react-intersection-observer";import{usePickaxeContext as t}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useHistory as r}from"../../../../hooks/pickaxe/useHistory.js";import o from"../../../Icons/spinner-circle.svg.js";import n from"./Item.js";const c=()=>{var c,l;const{styles:m,colors:d,misc:p}=t(),f=r({enabled:null===(c=p.isHistory)||void 0===c||c}),g=!!p.isHistory&&f.isLoading,{ref:h}=a({onChange(e){e&&f.hasNextPage&&f.fetchNextPage()}});return g?e("div",{className:"w-full min-h-[300px] animate-pulse bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===m.theme?"#1E1E1F":"#E5E7EB"}}):f.isError?e("div",{}):s("div",Object.assign({className:"flex flex-col gap-y-8"},{children:[null===(l=f.data)||void 0===l?void 0:l.pages.map(((s,a)=>e(i,{children:s.data.map((s=>e(i,{children:e(n,{item:s})},s.responseId)))},a))),e("div",Object.assign({className:"flex items-center justify-center"},{children:f.isFetchingNextPage?e(o,{className:"my-10 h-14 w-14 animate-spin animate-spin text-gray-300",style:{fill:d.accent}}):f.hasNextPage?e("div",{ref:h,className:"invisible h-14 w-14"}):null}))]}))};export{c as default};
|