mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
60 lines
1.4 KiB
JavaScript
60 lines
1.4 KiB
JavaScript
import React from 'react';
|
|
import { DashboardContentTable, DashboardPageContent } from 'components';
|
|
|
|
import 'style/pages/SaleReceipt/List.scss';
|
|
|
|
import ReceiptActionsBar from './ReceiptActionsBar';
|
|
import ReceiptViewTabs from './ReceiptViewTabs';
|
|
import ReceiptsTable from './ReceiptsTable';
|
|
|
|
import withReceipts from './withReceipts';
|
|
import withReceiptsActions from './withReceiptsActions';
|
|
|
|
import { ReceiptsListProvider } from './ReceiptsListProvider';
|
|
import { transformTableStateToQuery, compose } from 'utils';
|
|
|
|
/**
|
|
* Receipts list page.
|
|
*/
|
|
function ReceiptsList({
|
|
// #withReceipts
|
|
receiptTableState,
|
|
receiptsTableStateChanged,
|
|
|
|
// #withReceiptsActions
|
|
resetReceiptsTableState,
|
|
}) {
|
|
// Resets the receipts table state once the page unmount.
|
|
React.useEffect(
|
|
() => () => {
|
|
resetReceiptsTableState();
|
|
},
|
|
[resetReceiptsTableState],
|
|
);
|
|
|
|
return (
|
|
<ReceiptsListProvider
|
|
query={transformTableStateToQuery(receiptTableState)}
|
|
tableStateChanged={receiptsTableStateChanged}
|
|
>
|
|
<DashboardPageContent>
|
|
<ReceiptActionsBar />
|
|
|
|
<DashboardPageContent>
|
|
<ReceiptViewTabs />
|
|
<ReceiptsTable />
|
|
</DashboardPageContent>
|
|
|
|
</DashboardPageContent>
|
|
</ReceiptsListProvider>
|
|
);
|
|
}
|
|
|
|
export default compose(
|
|
withReceipts(({ receiptTableState, receiptsTableStateChanged }) => ({
|
|
receiptTableState,
|
|
receiptsTableStateChanged,
|
|
})),
|
|
withReceiptsActions,
|
|
)(ReceiptsList);
|