From 7f6b88894f21a024e893466d990cdf514b86bd95 Mon Sep 17 00:00:00 2001
From: Adam Setch
Date: Tue, 4 Jun 2024 08:00:58 -0400
Subject: [PATCH 1/2] refactor: update notification footer styles
---
src/components/NotificationRow.tsx | 177 +-
.../NotificationRow.test.tsx.snap | 3740 ++++++++---------
src/utils/constants.ts | 2 +-
3 files changed, 1867 insertions(+), 2052 deletions(-)
diff --git a/src/components/NotificationRow.tsx b/src/components/NotificationRow.tsx
index 1a5af4379..20b04bd89 100644
--- a/src/components/NotificationRow.tsx
+++ b/src/components/NotificationRow.tsx
@@ -114,111 +114,104 @@ export const NotificationRow: FC = ({ notification, hostname }) => {
openNotification()}
onKeyDown={() => openNotification()}
>
{notification.subject.title}
-
-
-
- {notification.subject.user ? (
-
-
-
- ) : (
-
-
+
+ {notification.subject.user ? (
+
+
+
+ ) : (
+
+
+
+ )}
+ {reason.title}
+ {updatedAt}
+ {notification.subject?.linkedIssues?.length > 0 && (
+
+
+
-
- )}
-
- {reason.title}
+ {notification.subject.linkedIssues.length}
+
- {updatedAt}
- {notification.subject?.linkedIssues?.length > 0 && (
-
-
-
- {notification.subject.linkedIssues.length}
-
-
- )}
- {notification.subject.reviews
- ? notification.subject.reviews.map((review) => {
- const icon = getPullRequestReviewIcon(review);
- if (!icon) {
- return null;
- }
-
- return (
- {
+ const icon = getPullRequestReviewIcon(review);
+ if (!icon) {
+ return null;
+ }
+
+ return (
+
+
-
-
- {review.users.length}
-
-
- );
- })
- : null}
- {notification.subject?.comments > 0 && (
-
-
-
- {notification.subject.comments}
-
-
- )}
- {notification.subject?.labels?.length > 0 && (
-
-
-
- {notification.subject.labels.length}
-
-
- )}
-
+
+ {review.users.length}
+
+
+ );
+ })
+ : null}
+ {notification.subject?.comments > 0 && (
+
+
+
+ {notification.subject.comments}
+
+
+ )}
+ {notification.subject?.labels?.length > 0 && (
+
+
+
+ {notification.subject.labels.length}
+
+
+ )}
diff --git a/src/components/__snapshots__/NotificationRow.test.tsx.snap b/src/components/__snapshots__/NotificationRow.test.tsx.snap
index c2cac717f..23c316b69 100644
--- a/src/components/__snapshots__/NotificationRow.test.tsx.snap
+++ b/src/components/__snapshots__/NotificationRow.test.tsx.snap
@@ -33,307 +33,20 @@ exports[`components/NotificationRow.tsx linked issues/prs should render when lin
I am a robot and this is a test!
-
-
-
-
-
-
-
- Updated
-
-
- over 6 years ago
-
-
-
-
-
-
-
- 2
-
-
-
-
-
-
-
- 1
-
-
-
-
-
-
-
- 1
-
-
-
-
-
-
-
- 2
-
-
-
-
-
-
-
- 2
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+ I am a robot and this is a test!
+
+
+
+
+
+
+
+
+
+ Updated
+
+
+ over 6 years ago
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
+
+ 2
+
+
+
+
+
+
+
+ 2
+
+
@@ -1283,158 +1235,147 @@ exports[`components/NotificationRow.tsx notification labels should render labels
I am a robot and this is a test!
+
+
+
+
+
+
+ Updated
+
+
+ over 6 years ago
+
-
+
-
-
- Updated
-
-
- over 6 years ago
-
-
-
-
-
-
- 1
-
-
-
+
+
+
-
-
-
-
- 1
-
-
-
+
+ 1
+
+
+
+
-
-
-
-
- 2
-
-
-
+
+ 2
+
+
+
+
-
-
-
-
- 2
-
-
+ class="mr-1 text-gray-500 dark:text-gray-300"
+ fill="currentColor"
+ focusable="false"
+ height="12"
+ role="img"
+ style="display: inline-block; user-select: none; vertical-align: text-bottom; overflow: visible;"
+ viewBox="0 0 16 16"
+ width="12"
+ >
+
+
+ 2
+
@@ -1538,158 +1479,147 @@ exports[`components/NotificationRow.tsx notification labels should render labels
I am a robot and this is a test!
+
+
+
+
+
-
+ Updated
+
+
+ over 6 years ago
+
+
+
-
-
- Updated
-
-
- over 6 years ago
-
-
-
-
-
-
- 1
-
-
-
-
-
-
-
- 1
-
-
-
+
+
+
-
-
-
-
- 2
-
-
-
+
+ 1
+
+
+
+
-
-
-
-
- 2
-
-
+
+
+
+ 2
+
+
+
+
+
+
+
+ 2
+
@@ -1850,130 +1780,120 @@ exports[`components/NotificationRow.tsx rendering for notification comments coun
I am a robot and this is a test!
+
+
+
+
+
+
+ Updated
+
+
+ over 6 years ago
+
-
+
-
-
- Updated
-
-
- over 6 years ago
-
-
-
-
-
-
- 1
-
-
-
+
+
+
-
-
-
-
- 1
-
-
-
+
+ 1
+
+
+
+
-
-
-
-
- 1
-
-
+
+
+ 1
+
@@ -2077,130 +1997,120 @@ exports[`components/NotificationRow.tsx rendering for notification comments coun
I am a robot and this is a test!
+
+
+
+
+
-
+ Updated
+
+
+ over 6 years ago
+
+
+
-
-
- Updated
-
-
- over 6 years ago
-
-
-
-
-
-
- 1
-
-
-
+
+
+
-
-
-
-
- 1
-
-
-
+
+ 1
+
+
+
+
-
-
-
-
- 1
-
-
+
+
+ 1
+
@@ -2361,130 +2271,120 @@ exports[`components/NotificationRow.tsx rendering for notification comments coun
I am a robot and this is a test!
+
+
+
+
+
+
+ Updated
+
+
+ over 6 years ago
+
+
+
+
+
+
+ 1
+
+
-
+
-
-
- Updated
-
-
- over 6 years ago
-
-
-
-
-
-
- 1
-
-
-
-
-
-
-
- 1
-
-
-
+
+
+
-
-
-
-
- 2
-
-
+
+
+ 2
+
@@ -2588,130 +2488,120 @@ exports[`components/NotificationRow.tsx rendering for notification comments coun
I am a robot and this is a test!
+
+
+
+
+
-
+ Updated
+
+
+ over 6 years ago
+
+
+
-
-
- Updated
-
-
- over 6 years ago
-
-
-
-
-
-
- 1
-
-
-
+
+
+
-
-
-
-
- 1
-
-
-
+
+ 1
+
+
+
+
-
-
-
-
- 2
-
-
+
+
+ 2
+
@@ -2872,104 +2762,95 @@ exports[`components/NotificationRow.tsx rendering for notification comments coun
I am a robot and this is a test!
+
+
+
+
+
+
+ Updated
+
+
+ over 6 years ago
+
-
+
-
-
- Updated
-
-
- over 6 years ago
-
-
-
-
-
-
- 1
-
-
-
+
+
+
-
-
-
-
- 1
-
-
+
+
+ 1
+
@@ -3073,104 +2954,95 @@ exports[`components/NotificationRow.tsx rendering for notification comments coun
I am a robot and this is a test!
+
+
+
+
+
-
+ Updated
+
+
+ over 6 years ago
+
+
+
+
+
+ 1
+
+
+
+
+
-
-
- Updated
-
-
- over 6 years ago
-
-
-
-
-
-
- 1
-
-
-
-
-
-
-
- 1
-
-
+ 1
+
@@ -3331,98 +3203,90 @@ exports[`components/NotificationRow.tsx should render itself & its children 1`]
I am a robot and this is a test!
-
-
-
-
- Updated
-
-
- over 6 years ago
-
-
+
+
+ Updated
+
+
+ over 6 years ago
+
+
+
-
-
-
-
- 1
-
-
-
+
+ 1
+
+
+
+
-
-
-
-
- 1
-
-
+
+
+ 1
+
@@ -3526,98 +3390,90 @@ exports[`components/NotificationRow.tsx should render itself & its children 1`]
I am a robot and this is a test!
-
-
-
-
- Updated
-
-
- over 6 years ago
-
-
+
+
+ Updated
+
+
+ over 6 years ago
+
+
+
-
-
-
-
- 1
-
-
-
+
+ 1
+
+
+
+
-
-
-
-
- 1
-
-
+
+
+ 1
+
@@ -3778,98 +3634,90 @@ exports[`components/NotificationRow.tsx should render itself & its children when
I am a robot and this is a test!
-
-
-
-
- Updated
-
-
- over 6 years ago
-
-
+
+
+ Updated
+
+
+ over 6 years ago
+
+
+
-
-
-
-
- 1
-
-
-
+
+ 1
+
+
+
+
-
-
-
-
- 1
-
-
+
+
+ 1
+
@@ -3973,98 +3821,90 @@ exports[`components/NotificationRow.tsx should render itself & its children when
I am a robot and this is a test!
-
-
-
-
- Updated
-
-
- over 6 years ago
-
-
+
+
+ Updated
+
+
+ over 6 years ago
+
+
+
-
-
-
-
- 1
-
-
-
+
+ 1
+
+
+
+
-
-
-
-
- 1
-
-
+
+
+ 1
+
@@ -4225,104 +4065,95 @@ exports[`components/NotificationRow.tsx should render itself & its children with
I am a robot and this is a test!
+
+
+
+
+
+ Updated
+
+
+ over 6 years ago
+
+
-
+
-
-
- Updated
-
-
- over 6 years ago
-
-
-
-
-
-
- 1
-
-
-
+
+
+
-
-
-
-
- 1
-
-
+
+
+ 1
+
@@ -4426,104 +4257,95 @@ exports[`components/NotificationRow.tsx should render itself & its children with
I am a robot and this is a test!
+
+
+
+
+
-
+ Updated
+
+
+ over 6 years ago
+
+
+
-
-
- Updated
-
-
- over 6 years ago
-
-
-
-
-
-
- 1
-
-
-
+
+
+
-
-
-
-
- 1
-
-
+
+
+ 1
+
diff --git a/src/utils/constants.ts b/src/utils/constants.ts
index a7295819e..bb1567670 100644
--- a/src/utils/constants.ts
+++ b/src/utils/constants.ts
@@ -25,7 +25,7 @@ export const Constants = {
READ_CLASS_NAME: 'opacity-50 dark:opacity-50',
PILL_CLASS_NAME:
- 'rounded-full text-xs px-2 bg-gray-100 hover:bg-gray-200 dark:bg-gray-800 dark:hover:bg-gray-700',
+ 'rounded-full text-xs px-1.5 bg-gray-100 hover:bg-gray-200 dark:bg-gray-800 dark:hover:bg-gray-700',
// GitHub Docs
GITHUB_DOCS: {
From 9659723ccdcd9939046632dcccf5cc7ad20d5c1f Mon Sep 17 00:00:00 2001
From: Adam Setch
Date: Tue, 4 Jun 2024 09:18:24 -0400
Subject: [PATCH 2/2] refactor: update notification footer styles
---
src/components/NotificationRow.tsx | 124 +-
.../NotificationRow.test.tsx.snap | 2612 +++++++++--------
2 files changed, 1405 insertions(+), 1331 deletions(-)
diff --git a/src/components/NotificationRow.tsx b/src/components/NotificationRow.tsx
index 20b04bd89..59a9fdfff 100644
--- a/src/components/NotificationRow.tsx
+++ b/src/components/NotificationRow.tsx
@@ -126,7 +126,7 @@ export const NotificationRow: FC = ({ notification, hostname }) => {
{notification.subject.title}
-
+
{notification.subject.user ? (
= ({ notification, hostname }) => {
)}
{reason.title}
{updatedAt}
- {notification.subject?.linkedIssues?.length > 0 && (
-
-
-
- {notification.subject.linkedIssues.length}
-
-
- )}
- {notification.subject.reviews
- ? notification.subject.reviews.map((review) => {
- const icon = getPullRequestReviewIcon(review);
- if (!icon) {
- return null;
- }
-
- return (
-
-
-
- {review.users.length}
-
-
- );
- })
- : null}
- {notification.subject?.comments > 0 && (
-
-
-
- {notification.subject.comments}
-
-
- )}
- {notification.subject?.labels?.length > 0 && (
-
-
-
- {notification.subject.labels.length}
-
-
- )}
+
+ {notification.subject?.linkedIssues?.length > 0 && (
+
+
+
+ {notification.subject.linkedIssues.length}
+
+
+ )}
+ {notification.subject.reviews
+ ? notification.subject.reviews.map((review) => {
+ const icon = getPullRequestReviewIcon(review);
+ if (!icon) {
+ return null;
+ }
+
+ return (
+
+
+
+ {review.users.length}
+
+
+ );
+ })
+ : null}
+ {notification.subject?.comments > 0 && (
+
+
+
+ {notification.subject.comments}
+
+
+ )}
+ {notification.subject?.labels?.length > 0 && (
+
+
+
+ {notification.subject.labels.length}
+
+
+ )}
+
diff --git a/src/components/__snapshots__/NotificationRow.test.tsx.snap b/src/components/__snapshots__/NotificationRow.test.tsx.snap
index 23c316b69..751812d56 100644
--- a/src/components/__snapshots__/NotificationRow.test.tsx.snap
+++ b/src/components/__snapshots__/NotificationRow.test.tsx.snap
@@ -43,7 +43,7 @@ exports[`components/NotificationRow.tsx linked issues/prs should render when lin
I am a robot and this is a test!