feat(UnrealizedGainorLoss): add Unrealized gain or loss.

This commit is contained in:
elforjani13
2022-02-03 22:47:56 +02:00
committed by a.bouhuolia
parent 3036b232b5
commit e1fe28736e
17 changed files with 447 additions and 3 deletions

View File

@@ -0,0 +1,65 @@
import React from 'react';
import { FinancialStatement } from 'components';
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
import UnrealizedGainOrLossHeader from './UnrealizedGainOrLossHeader';
import UnrealizedGainOrLossTable from './UnrealizedGainOrLossTable';
import UnrealizedGainOrLossActionsBar from './UnrealizedGainOrLossActionsBar';
import withCurrentOrganization from '../../Organization/withCurrentOrganization';
import withUnrealizedGainOrLossActions from './withUnrealizedGainOrLossActions';
import { UnrealizedGainOrLossProvider } from './UnrealizedGainOrLossProvider';
import { UnrealizedGainOrLossLoadingBar } from './components';
import { compose } from 'utils';
/**
* Unrealized Gain or Loss
*/
function UnrealizedGainOrLoss({
// #withPreferences
organizationName,
//#withUnrealizedGainOrLossActions
toggleUnrealizedGainOrLossFilterDrawer,
}) {
// Handle refetch unrealized Gain or Loss after filter change.
const handleFilterSubmit = (filter) => {};
// Handle format number submit.
const handleNumberFormatSubmit = (values) => {};
React.useEffect(
() => () => {
toggleUnrealizedGainOrLossFilterDrawer(false);
},
[toggleUnrealizedGainOrLossFilterDrawer],
);
return (
<UnrealizedGainOrLossProvider>
<UnrealizedGainOrLossActionsBar />
<DashboardPageContent>
<FinancialStatement>
<UnrealizedGainOrLossHeader
pageFilter={[]}
onSubmitFilter={handleFilterSubmit}
/>
<UnrealizedGainOrLossLoadingBar />
<div className="financial-statement__body">
<UnrealizedGainOrLossTable companyName={organizationName} />
</div>
</FinancialStatement>
</DashboardPageContent>
</UnrealizedGainOrLossProvider>
);
}
export default compose(
withCurrentOrganization(({ organization }) => ({
organizationName: organization.name,
})),
withUnrealizedGainOrLossActions,
)(UnrealizedGainOrLoss);