From f7064bce5499c73335d476c73b466ebaaf9f8c1e Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Mon, 5 Jan 2026 08:18:21 -0500 Subject: [PATCH] refactor(group): isGroupByDate helper util Signed-off-by: Adam Setch --- .../components/notifications/NotificationHeader.tsx | 7 +++---- .../components/notifications/NotificationRow.tsx | 7 +++---- src/renderer/utils/notifications/group.test.ts | 13 +++++++++++++ src/renderer/utils/notifications/group.ts | 7 +++++++ 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/renderer/components/notifications/NotificationHeader.tsx b/src/renderer/components/notifications/NotificationHeader.tsx index 55c6178a1..f2941f70e 100644 --- a/src/renderer/components/notifications/NotificationHeader.tsx +++ b/src/renderer/components/notifications/NotificationHeader.tsx @@ -3,9 +3,10 @@ import type { FC, MouseEvent } from 'react'; import { Stack } from '@primer/react'; import { useAppContext } from '../../context/App'; -import { type GitifyNotification, GroupBy, Opacity, Size } from '../../types'; +import { type GitifyNotification, Opacity, Size } from '../../types'; import { cn } from '../../utils/cn'; import { openRepository } from '../../utils/links'; +import { isGroupByDate } from '../../utils/notifications/group'; import { AvatarWithFallback } from '../avatars/AvatarWithFallback'; interface NotificationHeaderProps { @@ -23,10 +24,8 @@ export const NotificationHeader: FC = ({ ? `#${notification.subject.number}` : ''; - const groupByDate = settings.groupBy === GroupBy.DATE; - return ( - groupByDate && ( + isGroupByDate(settings) && (