fix: infinity scrolling of bank account transactions

This commit is contained in:
Ahmed Bouhuolia
2024-08-05 20:57:13 +02:00
parent 8e99a31455
commit 64c0732e5f
8 changed files with 124 additions and 65 deletions

View File

@@ -1,5 +1,5 @@
// @ts-nocheck
import React from 'react';
import React, { useRef, useState } from 'react';
import { useParams } from 'react-router-dom';
import { DashboardInsider } from '@/components';
import { useCashflowAccounts, useAccount } from '@/hooks/query';
@@ -41,6 +41,8 @@ function AccountTransactionsProvider({ query, ...props }) {
isLoading: isBankAccountMetaSummaryLoading,
} = useGetBankAccountSummaryMeta(accountId);
const [scrollableRef, setScrollableRef] = useState();
// Provider payload.
const provider = {
accountId,
@@ -56,6 +58,9 @@ function AccountTransactionsProvider({ query, ...props }) {
filterTab,
setFilterTab,
scrollableRef,
setScrollableRef
};
return (