From 83f13cbdc85c2c3a7d2404b603398d3a41cbfc28 Mon Sep 17 00:00:00 2001 From: Neil <55785687+carkom@users.noreply.github.com> Date: Sat, 20 Jan 2024 21:18:15 +0000 Subject: [PATCH] add compact to custom reports (#2258) * add compact * notes --- .../reports/graphs/tableGraph/ReportTable.tsx | 3 ++- .../reports/graphs/tableGraph/ReportTableHeader.tsx | 10 +++++----- .../reports/graphs/tableGraph/ReportTableList.tsx | 6 +++++- .../reports/graphs/tableGraph/ReportTableRow.tsx | 12 +++++++----- .../reports/graphs/tableGraph/ReportTableTotals.tsx | 10 +++++----- .../src/components/reports/reports/CustomReport.jsx | 2 +- upcoming-release-notes/2258.md | 6 ++++++ 7 files changed, 31 insertions(+), 18 deletions(-) create mode 100644 upcoming-release-notes/2258.md diff --git a/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTable.tsx b/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTable.tsx index 4d380951f1d..9aa4e7a923c 100644 --- a/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTable.tsx +++ b/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTable.tsx @@ -50,7 +50,7 @@ export function ReportTable({ }); const renderItem = useCallback( - ({ item, groupByItem, mode, style, monthsCount }) => { + ({ item, groupByItem, mode, style, monthsCount, compact }) => { return ( ); }, diff --git a/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableHeader.tsx b/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableHeader.tsx index 7db0209fde0..ea81dc53438 100644 --- a/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableHeader.tsx +++ b/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableHeader.tsx @@ -64,7 +64,7 @@ export function ReportTableHeader({ return ( ); diff --git a/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableRow.tsx b/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableRow.tsx index b0adffaa2dd..4779f22dfff 100644 --- a/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableRow.tsx +++ b/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableRow.tsx @@ -17,6 +17,7 @@ type ReportTableRowProps = { mode: string; style?: CSSProperties; monthsCount: number; + compact: boolean; }; export const ReportTableRow = memo( @@ -27,6 +28,7 @@ export const ReportTableRow = memo( mode, style, monthsCount, + compact, }: ReportTableRowProps) => { const average = amountToInteger(item[balanceTypeOp]) / monthsCount; return ( @@ -54,7 +56,7 @@ export const ReportTableRow = memo( @@ -94,7 +96,7 @@ export const ReportTableRow = memo( width="flex" privacyFilter style={{ - minWidth: 85, + minWidth: compact ? 80 : 125, ...styles.tnum, }} /> @@ -109,7 +111,7 @@ export const ReportTableRow = memo( } style={{ fontWeight: 600, - minWidth: 85, + minWidth: compact ? 80 : 125, ...styles.tnum, }} width="flex" @@ -124,7 +126,7 @@ export const ReportTableRow = memo( } style={{ fontWeight: 600, - minWidth: 85, + minWidth: compact ? 80 : 125, ...styles.tnum, }} width="flex" diff --git a/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableTotals.tsx b/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableTotals.tsx index c149e5d6cca..784f6054e24 100644 --- a/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableTotals.tsx +++ b/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableTotals.tsx @@ -85,7 +85,7 @@ export function ReportTableTotals({ return (