diff --git a/packages/desktop-client/src/components/reports/ReportSidebar.jsx b/packages/desktop-client/src/components/reports/ReportSidebar.jsx
index 49857c63d88..dc2fdd24768 100644
--- a/packages/desktop-client/src/components/reports/ReportSidebar.jsx
+++ b/packages/desktop-client/src/components/reports/ReportSidebar.jsx
@@ -20,34 +20,23 @@ import { ModeButton } from './ModeButton';
import { ReportOptions } from './ReportOptions';
export function ReportSidebar({
- startDate,
- endDate,
- onChangeDates,
- dateRange,
- setDateRange,
+ customReportItems,
+ categories,
dateRangeLine,
allMonths,
- graphType,
- setGraphType,
+ setDateRange,
typeDisabled,
setTypeDisabled,
- groupBy,
+ setGraphType,
setGroupBy,
- balanceType,
setBalanceType,
- mode,
setMode,
- isDateStatic,
setIsDateStatic,
- showEmpty,
setShowEmpty,
- showOffBudgetHidden,
setShowOffBudgetHidden,
- showUncategorized,
setShowUncategorized,
- categories,
- selectedCategories,
setSelectedCategories,
+ onChangeDates,
onChangeViews,
}) {
const onSelectRange = cond => {
@@ -86,26 +75,26 @@ export function ReportSidebar({
const onChangeMode = cond => {
setMode(cond);
if (cond === 'time') {
- if (graphType === 'TableGraph') {
+ if (customReportItems.graphType === 'TableGraph') {
setTypeDisabled([]);
} else {
setTypeDisabled(['Net']);
- if (['Net'].includes(balanceType)) {
+ if (['Net'].includes(customReportItems.balanceType)) {
setBalanceType('Payment');
}
}
- if (graphType === 'BarGraph') {
+ if (customReportItems.graphType === 'BarGraph') {
setGraphType('StackedBarGraph');
}
- if (['AreaGraph', 'DonutGraph'].includes(graphType)) {
+ if (['AreaGraph', 'DonutGraph'].includes(customReportItems.graphType)) {
setGraphType('TableGraph');
onChangeViews('viewLegend', false);
}
- if (['Month', 'Year'].includes(groupBy)) {
+ if (['Month', 'Year'].includes(customReportItems.groupBy)) {
setGroupBy('Category');
}
} else {
- if (graphType === 'StackedBarGraph') {
+ if (customReportItems.graphType === 'StackedBarGraph') {
setGraphType('BarGraph');
} else {
setTypeDisabled([]);
@@ -115,12 +104,17 @@ export function ReportSidebar({
const onChangeSplit = cond => {
setGroupBy(cond);
- if (mode === 'total') {
- if (graphType !== 'TableGraph') {
- setTypeDisabled(!['Month', 'Year'].includes(groupBy) ? [] : ['Net']);
+ if (customReportItems.mode === 'total') {
+ if (customReportItems.graphType !== 'TableGraph') {
+ setTypeDisabled(
+ !['Month', 'Year'].includes(customReportItems.groupBy) ? [] : ['Net'],
+ );
}
}
- if (['Net'].includes(balanceType) && graphType !== 'TableGraph') {
+ if (
+ ['Net'].includes(customReportItems.balanceType) &&
+ customReportItems.graphType !== 'TableGraph'
+ ) {
setBalanceType('Payment');
}
};
@@ -158,13 +152,13 @@ export function ReportSidebar({
Mode:
onChangeMode('total')}
>
Total
onChangeMode('time')}
>
Time
@@ -181,16 +175,16 @@ export function ReportSidebar({
Split: