feat: cashflow account transactions infinity scroll loading.

This commit is contained in:
a.bouhuolia
2021-10-23 23:10:48 +02:00
parent c7013caf12
commit 65e8d3f26a
11 changed files with 268 additions and 68 deletions

View File

@@ -0,0 +1,23 @@
import React from 'react';
import { useIntersectionObserver } from 'hooks/utils';
/**
* Intersection observer.
*/
export function IntersectionObserver({ onIntersect }) {
const loadMoreButtonRef = React.useRef();
useIntersectionObserver({
// enabled: !isItemsLoading && !isResourceLoading,
target: loadMoreButtonRef,
onIntersect: () => {
onIntersect && onIntersect();
},
});
return (
<div ref={loadMoreButtonRef} style={{ opacity: 0 }}>
Load Newer
</div>
);
}