feat(FinancialReports): add loading progress bar.

fix(preformance): Optimize preformance of virtualized list.
fix(preformance): Optimize financial reports preformance.
This commit is contained in:
a.bouhuolia
2021-03-16 17:27:27 +02:00
parent f1cf02c9df
commit 42230fe64b
73 changed files with 969 additions and 320 deletions

View File

@@ -31,7 +31,7 @@ function PaymentReceiveFormProvider({ paymentReceiveId, ...props }) {
enabled: !!paymentReceiveId,
});
// Handle fetch accounts data.
const { data: accounts, isFetching: isAccountsFetching } = useAccounts();
const { data: accounts, isLoading: isAccountsLoading } = useAccounts();
// Fetch payment made settings.
const fetchSettings = useSettingsPaymentReceives();
@@ -39,7 +39,7 @@ function PaymentReceiveFormProvider({ paymentReceiveId, ...props }) {
// Fetches customers list.
const {
data: { customers },
isFetching: isCustomersFetching,
isLoading: isCustomersLoading,
} = useCustomers({ page_size: 10000 });
// Detarmines whether the new mode.
@@ -58,9 +58,9 @@ function PaymentReceiveFormProvider({ paymentReceiveId, ...props }) {
customers,
isPaymentLoading,
isAccountsLoading,
isPaymentFetching,
isAccountsFetching,
isCustomersFetching,
isCustomersLoading,
isNewMode,
submitPayload,
@@ -72,7 +72,7 @@ function PaymentReceiveFormProvider({ paymentReceiveId, ...props }) {
return (
<DashboardInsider
loading={isPaymentLoading || isAccountsFetching || isCustomersFetching}
loading={isPaymentLoading || isAccountsLoading || isCustomersLoading}
name={'payment-receive-form'}
>
<PaymentReceiveFormContext.Provider value={provider} {...props} />