From efc9caf2404aa1fdf564e8bdde712cad82c6c54e Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Wed, 5 Jun 2024 08:42:28 -0400 Subject: [PATCH 1/3] refactor: more pill css changes --- src/components/NotificationRow.tsx | 206 +- .../NotificationRow.test.tsx.snap | 5148 ++++++++--------- src/utils/constants.ts | 2 +- src/utils/helpers.ts | 4 +- 4 files changed, 2646 insertions(+), 2714 deletions(-) diff --git a/src/components/NotificationRow.tsx b/src/components/NotificationRow.tsx index 18e0585ab..e32045aa1 100644 --- a/src/components/NotificationRow.tsx +++ b/src/components/NotificationRow.tsx @@ -115,7 +115,7 @@ export const NotificationRow: FC = ({ notification, hostname }) => {
openNotification()} onKeyDown={() => openNotification()} > @@ -127,113 +127,111 @@ export const NotificationRow: FC = ({ notification, hostname }) => { {notification.subject.title}
-
- - {notification.subject.user ? ( - - {`${notification.subject.user.login}'s +
+ {notification.subject.user ? ( +
+ {`${notification.subject.user.login}'s +
+ ) : ( +
+ +
+ )} +
{reason.title}
+
{updatedAt}
+
+ {notification.subject?.linkedIssues?.length > 0 && ( + + + + )} + {notification.subject.reviews + ? notification.subject.reviews.map((review) => { + const icon = getPullRequestReviewIcon(review); + if (!icon) { + return null; + } + + return ( + + + + ); + }) + : null} + {notification.subject?.comments > 0 && ( + + - ) : ( - - + )} + {notification.subject?.labels?.length > 0 && ( + + )} - {reason.title} - {updatedAt} - - {notification.subject?.linkedIssues?.length > 0 && ( - - - - )} - {notification.subject.reviews - ? notification.subject.reviews.map((review) => { - const icon = getPullRequestReviewIcon(review); - if (!icon) { - return null; + {notification.subject.milestone && ( + + - - ); - }) - : null} - {notification.subject?.comments > 0 && ( - - - - )} - {notification.subject?.labels?.length > 0 && ( - - - - )} - {notification.subject.milestone && ( - - - - )} - - + aria-label={notification.subject.milestone.title} + /> + + + )} +
diff --git a/src/components/__snapshots__/NotificationRow.test.tsx.snap b/src/components/__snapshots__/NotificationRow.test.tsx.snap index b9cab2c6d..9b0ecf5b4 100644 --- a/src/components/__snapshots__/NotificationRow.test.tsx.snap +++ b/src/components/__snapshots__/NotificationRow.test.tsx.snap @@ -33,7 +33,7 @@ exports[`components/NotificationRow.tsx notification pills / metrics comment pil
- + +
+
+ Updated +
+
+ 7 years ago +
+
- - - - Updated - - - over 6 years ago + - - - - - - - + + 1 + + + + - - + + 1 + + + + - + + + 1 + - +
- + +
+
+ Updated +
+
+ 7 years ago +
+
- - - - Updated - - - over 6 years ago + - - - - + + 1 + + + + - - + + 1 + + + + - - - - + + + 1 + - +
- + +
+
+ Updated +
+
+ 7 years ago +
+
- - - - Updated - - - over 6 years ago + - - - - - - - + + 1 + + + + - - + + 1 + + + + - + + + 2 + - +
- + +
+
- -
+ 7 years ago +
+
+ + - Updated - - - over 6 years ago + - - - - + + 1 + + + + - - - - - - - + + + 2 + - +
- + +
+
+ Updated +
+
+ 7 years ago +
+
- - - - Updated - - - over 6 years ago + - - - - - - - + + 1 + + + + - + + + 1 + - +
- + +
+
- -
+ 7 years ago +
+
+ + - Updated - - - over 6 years ago + - - - - - - - - - + + + 1 + - +
- - - - - - Updated - - - over 6 years ago - - - - - - - - - - - - - - - - - - - -
-
-
- - - -
-
-
- , - "container":
-
-
- - - - -
-
-
- I am a robot and this is a test! -
-
- - +
- - +
Updated - - - over 6 years ago - - +
+ 7 years ago +
+
+
-
-
- - + + +
+
+
+ , + "container":
+
+
+ + + + +
+
+
+ I am a robot and this is a test! +
+
+
+ +
+
+ Updated +
+
+ 7 years ago +
+
+ + + + + + + + + + + + + + + +
+
+
+
+ +
- + +
+
- -
+ 7 years ago +
+
+ + - Updated - - - over 6 years ago + - - - - - - - - - + + + 1 + - +
- + +
+
+ Updated +
+
+ 7 years ago +
+
- - - - Updated - - - over 6 years ago + - - - - - - - + + 1 + + + + - + + + 1 + - +
- + +
+
- -
+ 7 years ago +
+
+ + - Updated - - - over 6 years ago + - - - - - - - - - + + + 1 + - +
- + +
+
+ Updated +
+
+ 7 years ago +
+
- - - - Updated - - - over 6 years ago + - - - - - - - + + 1 + + + + - + + + 1 + - +
- + +
+
- -
+ 7 years ago +
+
+ + + + + - Updated - - - over 6 years ago + - - - - - - - - - - - - - + + 2 + + + + - - + + + 2 + + + + - + + + - +
- + +
+
+ Updated +
+
+ 7 years ago +
+
- - - - Updated - - - over 6 years ago + - - - - - - - - - - + + 1 + + + + - - + + + 1 + + + + + + - - - 2 - - - + - + + + 2 + + + + - +
- - - - -
-
-
- I am a robot and this is a test! -
-
- - - - - - Updated - - - over 6 years ago - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - - -
-
-
- , - "container":
-
-
- - - - -
-
-
- I am a robot and this is a test! + + + +
- + I am a robot and this is a test! +
+
- +
- - +
Updated - - - over 6 years ago - - +
+ 7 years ago +
+
+
+
+
+ + + +
+
+
+ , + "container":
+
+
+ + + + +
+
+
+ I am a robot and this is a test! +
+
+
+ +
+
+ Updated +
+
+ 7 years ago +
+
+ + + + + + + + + + + + + + + + + - + + + - +
- + gitify-app's avatar +
+
+ Updated +
+
+ 7 years ago +
+
- gitify-app's avatar - - - Updated - - - over 6 years ago + - - - - - - + + + 1 + - +
- + gitify-app's avatar +
+
+ Updated +
+
+ 7 years ago +
+
- gitify-app's avatar - - - Updated - - - over 6 years ago + - - - - - - + + + 1 + - +
- + gitify-app's avatar +
+
+ Updated +
+
+ 7 years ago +
+
- gitify-app's avatar - - - Updated - - - over 6 years ago + - - - - - - + + + 1 + - +
- + gitify-app's avatar +
+
+ Updated +
+
+ 7 years ago +
+
- gitify-app's avatar - - - Updated - - - over 6 years ago + - - - - - - + + + 1 + - +
- + +
+
+ Updated +
+
+ 7 years ago +
+
- - - - Updated - - - over 6 years ago + - - - - - - + + + 1 + - +
- + +
+
+ Updated +
+
+ 7 years ago +
+
- - - - Updated - - - over 6 years ago + - - - - - - + + + 1 + - +
Date: Wed, 5 Jun 2024 10:24:26 -0400 Subject: [PATCH 2/3] refactor: more pill css changes --- src/components/NotificationRow.tsx | 53 ++- src/components/Repository.tsx | 2 +- .../NotificationRow.test.tsx.snap | 308 ++++++++---------- .../__snapshots__/Repository.test.tsx.snap | 8 +- 4 files changed, 161 insertions(+), 210 deletions(-) diff --git a/src/components/NotificationRow.tsx b/src/components/NotificationRow.tsx index e32045aa1..d0a32c1b4 100644 --- a/src/components/NotificationRow.tsx +++ b/src/components/NotificationRow.tsx @@ -105,29 +105,29 @@ export const NotificationRow: FC = ({ notification, hostname }) => { return (
openNotification()} onKeyDown={() => openNotification()} >
{notification.subject.title}
-
+
{notification.subject.user ? (
= ({ notification, hostname }) => { )}
{reason.title}
{updatedAt}
-
+
{notification.subject?.linkedIssues?.length > 0 && ( )} - {notification.subject.reviews - ? notification.subject.reviews.map((review) => { - const icon = getPullRequestReviewIcon(review); - if (!icon) { - return null; - } + {notification.subject.reviews?.map((review) => { + const icon = getPullRequestReviewIcon(review); + if (!icon) { + return null; + } - return ( - - - - ); - }) - : null} + return ( + + + + ); + })} {notification.subject?.comments > 0 && (