mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
chrone: sperate client and server to different repos.
This commit is contained in:
64
src/containers/Accounts/AccountsChart.js
Normal file
64
src/containers/Accounts/AccountsChart.js
Normal file
@@ -0,0 +1,64 @@
|
||||
import React, { useEffect } from 'react';
|
||||
|
||||
import 'style/pages/Accounts/List.scss';
|
||||
import { DashboardPageContent, DashboardContentTable } from 'components';
|
||||
|
||||
import { AccountsChartProvider } from './AccountsChartProvider';
|
||||
|
||||
import AccountsViewsTabs from 'containers/Accounts/AccountsViewsTabs';
|
||||
import AccountsActionsBar from 'containers/Accounts/AccountsActionsBar';
|
||||
import AccountsAlerts from './AccountsAlerts';
|
||||
import AccountsDataTable from './AccountsDataTable';
|
||||
|
||||
import withAccounts from 'containers/Accounts/withAccounts';
|
||||
|
||||
import { compose } from 'utils';
|
||||
import { transformAccountsStateToQuery } from './utils';
|
||||
import withAccountsTableActions from './withAccountsTableActions';
|
||||
|
||||
/**
|
||||
* Accounts chart list.
|
||||
*/
|
||||
function AccountsChart({
|
||||
// #withAccounts
|
||||
accountsTableState,
|
||||
accountsTableStateChanged,
|
||||
|
||||
// #withAccountsActions
|
||||
resetAccountsTableState,
|
||||
}) {
|
||||
// Resets the accounts table state once the page unmount.
|
||||
useEffect(
|
||||
() => () => {
|
||||
resetAccountsTableState();
|
||||
},
|
||||
[resetAccountsTableState],
|
||||
);
|
||||
|
||||
return (
|
||||
<AccountsChartProvider
|
||||
query={transformAccountsStateToQuery(accountsTableState)}
|
||||
tableStateChanged={accountsTableStateChanged}
|
||||
>
|
||||
<AccountsActionsBar />
|
||||
|
||||
<DashboardPageContent>
|
||||
<AccountsViewsTabs />
|
||||
|
||||
<DashboardContentTable>
|
||||
<AccountsDataTable />
|
||||
</DashboardContentTable>
|
||||
</DashboardPageContent>
|
||||
|
||||
<AccountsAlerts />
|
||||
</AccountsChartProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export default compose(
|
||||
withAccounts(({ accountsTableState, accountsTableStateChanged }) => ({
|
||||
accountsTableState,
|
||||
accountsTableStateChanged,
|
||||
})),
|
||||
withAccountsTableActions,
|
||||
)(AccountsChart);
|
||||
Reference in New Issue
Block a user