feat(RealizedGainorLoss): add realized gain or loss.

This commit is contained in:
elforjani13
2022-02-03 22:47:38 +02:00
parent 66552a2d28
commit 164eebd6ae
16 changed files with 451 additions and 3 deletions

View File

@@ -0,0 +1,67 @@
import React from 'react';
import { FinancialStatement } from 'components';
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
import RealizedGainOrLossHeader from './RealizedGainOrLossHeader';
import RealizedGainOrLossTable from './RealizedGainOrLossTable';
import RealizedGainOrLossActionsBar from './RealizedGainOrLossActionsBar';
import withCurrentOrganization from '../../Organization/withCurrentOrganization';
import withRealizedGainOrLossActions from './withRealizedGainOrLossActions';
import { RealizedGainOrLossProvider } from './RealizedGainOrLossProvider';
import { RealizedGainOrLossLoadingBar } from './components';
import { compose } from 'utils';
/**
* Realized Gain or Loss.
*/
function RealizedGainOrLoss({
// #withPreferences
organizationName,
//#withRealizedGainOrLossActions
toggleRealizedGainOrLossFilterDrawer,
}) {
// Handle refetch realized Gain or Loss after filter change.
const handleFilterSubmit = (filter) => {};
// Handle format number submit.
const handleNumberFormatSubmit = (values) => {};
React.useEffect(
() => () => {
toggleRealizedGainOrLossFilterDrawer(false);
},
[toggleRealizedGainOrLossFilterDrawer],
);
return (
<RealizedGainOrLossProvider>
<RealizedGainOrLossActionsBar />
<DashboardPageContent>
<FinancialStatement>
<RealizedGainOrLossHeader
pageFilter={[]}
onSubmitFilter={handleFilterSubmit}
/>
<RealizedGainOrLossLoadingBar />
<div className="financial-statement__body">
<RealizedGainOrLossTable companyName={organizationName} />
</div>
</FinancialStatement>
</DashboardPageContent>
</RealizedGainOrLossProvider>
);
}
export default compose(
withCurrentOrganization(({ organization }) => ({
organizationName: organization.name,
})),
withRealizedGainOrLossActions,
)(RealizedGainOrLoss);