BC-4: feat: base currency withCurrentOrganization

This commit is contained in:
elforjani3
2021-09-07 00:16:46 +02:00
parent 6401692903
commit 39ba31a842
31 changed files with 152 additions and 213 deletions

View File

@@ -24,7 +24,7 @@ import EstimatesEmptyStatus from './EstimatesEmptyStatus';
import { statusAccessor } from './components';
import withEstimates from './withEstimates';
import withEstimateActions from './withEstimateActions';
import withSettings from 'containers/Settings/withSettings';
import withCurrentOrganization from 'containers/Organization/withCurrentOrganization';
// Estimates transactions datatable.
function EstimatesDataTable({
@@ -38,8 +38,8 @@ function EstimatesDataTable({
// #withEstimatesActions
addEstimatesTableQueries,
// #withSettings
baseCurrency,
// #withCurrentOrganization
organization: { base_currency },
// #ownProps
onEditEstimate,
@@ -50,7 +50,6 @@ function EstimatesDataTable({
onDrawerEstimate,
onSelectedRowsChange,
}) {
const isLoaded = useIsValuePassed(estimatesLoading, false);
const handleEditEstimate = useCallback(
@@ -171,7 +170,7 @@ function EstimatesDataTable({
{
id: 'amount',
Header: intl.get('amount'),
accessor: (r) => <Money amount={r.amount} currency={baseCurrency} />,
accessor: (r) => <Money amount={r.amount} currency={base_currency} />,
width: 140,
className: 'amount',
@@ -293,7 +292,5 @@ export default compose(
estimatesCurrentViewId,
}),
),
withSettings(({ organizationSettings }) => ({
baseCurrency: organizationSettings?.baseCurrency,
})),
withCurrentOrganization(),
)(EstimatesDataTable);