From 069829bd1fe0b68f894a8adb1c1a8c2ff0fead8b Mon Sep 17 00:00:00 2001 From: Robert Dyer Date: Wed, 10 Apr 2024 17:12:11 -0500 Subject: [PATCH 1/9] Dim categories hidden by their groups --- .../src/components/budget/BudgetCategories.jsx | 4 ++++ .../src/components/budget/ExpenseCategory.tsx | 10 ++++++++-- .../src/components/budget/SidebarCategory.tsx | 11 ++++++++--- upcoming-release-notes/2582.md | 6 ++++++ 4 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 upcoming-release-notes/2582.md diff --git a/packages/desktop-client/src/components/budget/BudgetCategories.jsx b/packages/desktop-client/src/components/budget/BudgetCategories.jsx index fd708f3824f..42f03aad66f 100644 --- a/packages/desktop-client/src/components/budget/BudgetCategories.jsx +++ b/packages/desktop-client/src/components/budget/BudgetCategories.jsx @@ -177,6 +177,8 @@ export const BudgetCategories = memo( } } + let catGroup = null; + return ( ; MonthComponent: ComponentProps['component']; @@ -35,6 +39,7 @@ type ExpenseCategoryProps = { export function ExpenseCategory({ cat, + catGroup, editingCell, dragState, MonthComponent, @@ -72,7 +77,7 @@ export function ExpenseCategory({ collapsed={true} style={{ backgroundColor: theme.tableBackground, - opacity: cat.hidden ? 0.5 : undefined, + opacity: cat.hidden || catGroup?.hidden ? 0.5 : undefined, }} > @@ -81,6 +86,7 @@ export function ExpenseCategory({ ; category: CategoryEntity; + catGroup?: CategoryGroupEntity; dragPreview?: boolean; dragging?: boolean; editing: boolean; @@ -30,6 +34,7 @@ type SidebarCategoryProps = { export function SidebarCategory({ innerRef, category, + catGroup, dragPreview, dragging, editing, @@ -50,7 +55,7 @@ export function SidebarCategory({ alignItems: 'center', userSelect: 'none', WebkitUserSelect: 'none', - opacity: category.hidden ? 0.33 : undefined, + opacity: category.hidden || catGroup?.hidden ? 0.33 : undefined, }} >