Fix fetch more notes (#16442)

fixes : https://github.com/twentyhq/twenty/issues/16320

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Etienne
2025-12-12 14:43:21 +01:00
committed by GitHub
parent 8dbcd506ed
commit 6acdde72ef
13 changed files with 607 additions and 114 deletions
@@ -6,6 +6,10 @@ type CustomResolverFetchMoreLoaderProps = {
onLastRowVisible: (...args: any[]) => any;
};
const StyledContainer = styled.div`
min-height: 1px;
`;
const StyledText = styled.div`
align-items: center;
box-shadow: none;
@@ -21,12 +25,16 @@ export const CustomResolverFetchMoreLoader = ({
onLastRowVisible,
}: CustomResolverFetchMoreLoaderProps) => {
const { ref: tbodyRef } = useInView({
onChange: onLastRowVisible,
onChange: (inView) => {
if (inView) {
onLastRowVisible();
}
},
});
return (
<div ref={tbodyRef}>
<StyledContainer ref={tbodyRef}>
{loading && <StyledText>Loading more...</StyledText>}
</div>
</StyledContainer>
);
};