feart: optimize cashflow account transactions page.

This commit is contained in:
a.bouhuolia
2021-10-20 19:04:01 +02:00
parent 0bb1e57061
commit c7013caf12
16 changed files with 300 additions and 38 deletions

View File

@@ -33,12 +33,13 @@ function CashFlowAccountsDataTable({
// Local storage memorizing columns widths.
const [initialColumnsWidths, , handleColumnResizing] =
useMemorizedColumnsWidths(TABLES.CASHFLOW_ACCOUNTS);
return (
<DataTable
noInitialFetch={true}
columns={columns}
data={cashflowAccounts}
selectionColumn={true}
selectionColumn={false}
sticky={true}
loading={isCashFlowAccountsLoading}
headerLoading={isCashFlowAccountsLoading}
@@ -47,11 +48,8 @@ function CashFlowAccountsDataTable({
expandToggleColumn={2}
selectionColumnWidth={45}
TableCellRenderer={TableFastCell}
TableRowsRenderer={TableVirtualizedListRows}
TableLoadingRenderer={TableSkeletonRows}
// #TableVirtualizedListRows props.
vListrowHeight={cashflowTableSize == 'small' ? 40 : 42}
vListOverscanRowCount={0}
TableHeaderSkeletonRenderer={TableSkeletonHeader}
initialColumnsWidths={initialColumnsWidths}
onColumnResizing={handleColumnResizing}

View File

@@ -1,6 +1,7 @@
import React from 'react';
import { isNull } from 'lodash';
import styled from 'styled-components';
import { Link } from 'react-router-dom';
import { BankAccountsList, BankAccount } from '../../../components';
import { useCashFlowAccountsContext } from './CashFlowAccountsProvider';
@@ -23,12 +24,14 @@ function CashflowAccountsSkeleton() {
function CashflowAccountsGridItems({ accounts }) {
return accounts.map((account) => (
<BankAccount
title={account.name}
code={account.code}
balance={!isNull(account.amount) ? account.formattedAmount : '-'}
type={'cash'}
/>
<Link to={`/cashflow-accounts/${account.id}/transactions`}>
<BankAccount
title={account.name}
code={account.code}
balance={!isNull(account.amount) ? account.formattedAmount : '-'}
type={'cash'}
/>
</Link>
));
}