diff --git a/src/components/NotificationRow.tsx b/src/components/NotificationRow.tsx index f4f726a37..76575e2fc 100644 --- a/src/components/NotificationRow.tsx +++ b/src/components/NotificationRow.tsx @@ -105,10 +105,10 @@ export const NotificationRow: FC = ({ notification, hostname }) => { return (
@@ -120,122 +120,115 @@ export const NotificationRow: FC = ({ notification, hostname }) => { onKeyDown={() => openNotification()} >
{notification.subject.title}
-
- - {notification.subject.user ? ( - - {`${notification.subject.user.login}'s - - ) : ( - - - - )} - {reason.title} - {updatedAt} - {settings.showPills && ( - - {notification.subject?.linkedIssues?.length > 0 && ( - - - - )} - {notification.subject.reviews - ? notification.subject.reviews.map((review) => { - const icon = getPullRequestReviewIcon(review); - if (!icon) { - return null; - } +
+ {notification.subject.user ? ( +
+ {`${notification.subject.user.login}'s +
+ ) : ( +
+ +
+ )} +
{reason.title}
+
{updatedAt}
+ {settings.showPills && ( +
+ {notification.subject?.linkedIssues?.length > 0 && ( + + + + )} + {notification.subject.reviews?.map((review) => { + const icon = getPullRequestReviewIcon(review); + if (!icon) { + return null; + } - return ( - - - - ); - }) - : null} - {notification.subject?.comments > 0 && ( - + return ( + - )} - {notification.subject?.labels?.length > 0 && ( - - - - )} - {notification.subject.milestone && ( - - - - )} - - )} - + ); + })} + {notification.subject?.comments > 0 && ( + + + + )} + {notification.subject?.labels?.length > 0 && ( + + + + )} + {notification.subject.milestone && ( + + + + )} +
+ )}
diff --git a/src/components/Repository.tsx b/src/components/Repository.tsx index 47074f314..2b7877617 100644 --- a/src/components/Repository.tsx +++ b/src/components/Repository.tsx @@ -52,7 +52,7 @@ export const RepositoryNotifications: FC = ({ )} diff --git a/src/components/__snapshots__/NotificationRow.test.tsx.snap b/src/components/__snapshots__/NotificationRow.test.tsx.snap index 7cf6e5b80..d8901bfcc 100644 --- a/src/components/__snapshots__/NotificationRow.test.tsx.snap +++ b/src/components/__snapshots__/NotificationRow.test.tsx.snap @@ -6,11 +6,11 @@ exports[`components/NotificationRow.tsx notification pills / metrics comment pil "baseElement":
I am a robot and this is a test!
- + +
+
- - - + Updated +
+
+ 7 years ago +
+
- Updated - - - over 6 years ago + - - - - - - - + + 1 + + + + - - + + 1 + + + + - + + + 1 + - +
, "container":
I am a robot and this is a test!
- + +
+
- - - + Updated +
+
+ 7 years ago +
+
- Updated - - - over 6 years ago + - - - - + + 1 + + + + - - + + 1 + + + + - - - - + + + 1 + - +
I am a robot and this is a test!
- + +
+
- - - + Updated +
+
+ 7 years ago +
+
- Updated - - - over 6 years ago + - - - - - - - + + 1 + + + + - - + + 1 + + + + - + + + 2 + - +
, "container":
I am a robot and this is a test!
- + +
+
- -
+ 7 years ago +
+
+ + - Updated - - - over 6 years ago + - - - - + + 1 + + + + - - - - - - - + + + 2 + - +
I am a robot and this is a test!
- + +
+
- - - + Updated +
+
+ 7 years ago +
+
- Updated - - - over 6 years ago + - - - - - - - + + 1 + + + + - + + + 1 + - +
, "container":
I am a robot and this is a test!
- + +
+
- - - + Updated +
+
+ 7 years ago +
+
- Updated - - - over 6 years ago + - - - - - - - + + 1 + + + + - + + + 1 + - +
-
-
-
- - - - -
-
-
- I am a robot and this is a test! -
-
- - - - - - Updated - - - over 6 years ago - - - - - - - - - - - - - - - - - - - -
-
-
- - - -
-
-
- , - "container":
-
-
- - - - -
+ "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`components/NotificationRow.tsx notification pills / metrics label pills should render labels pill 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
- 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 +
+
+ + + + + + + + + + + + + + - +
I am a robot and this is a test!
- + +
+
- - - + Updated +
+
+ 7 years ago +
+
- Updated - - - over 6 years ago + - - - - - - - + + 1 + + + + - + + + 1 + - +
, "container":
I am a robot and this is a test!
- + +
+
- - - + Updated +
+
+ 7 years ago +
+
- Updated - - - over 6 years ago + - - - - - - - + + 1 + + + + - + + + 1 + - +
I am a robot and this is a test!
- + +
+
- - - + Updated +
+
+ 7 years ago +
+
- Updated - - - over 6 years ago + - - - - - - - + + 1 + + + + - + + + 1 + - +
, "container":
I am a robot and this is a test!
- + +
+
- - - + Updated +
+
+ 7 years ago +
+
- Updated - - - over 6 years ago + - - - - - - - + + 1 + + + + - + + + 1 + - +
I am a robot and this is a test!
- + +
+
- -
+ 7 years ago +
+
+ + - Updated - - - over 6 years ago + - - - - - - - - - - + + 1 + + + + - - + + 2 + + + + - - + + + 2 + + + + - + + + - +
, "container":
I am a robot and this is a test!
- + +
+
- - - + 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 +
+
+ + + + + + + + + + + + + + + + + - +
I am a robot and this is a test!
- - - - - + - - over 6 years ago - - + + +
+
+ Updated +
+
+ 7 years ago +
, "container":
I am a robot and this is a test!
- - - - - + - - over 6 years ago - - + + +
+
+ Updated +
+
+ 7 years ago +
I am a robot and this is a test!
- + gitify-app's avatar +
+
+ Updated +
+
+ 7 years ago +
+
- gitify-app's avatar - - - Updated - - - over 6 years ago + - - - - - - + + + 1 + - +
, "container":
I am a robot and this is a test!
- + gitify-app's avatar +
+
+ Updated +
+
+ 7 years ago +
+
- gitify-app's avatar - - - Updated - - - over 6 years ago + - - - - - - + + + 1 + - +
I am a robot and this is a test!
- + gitify-app's avatar +
+
+ Updated +
+
+ 7 years ago +
+
- gitify-app's avatar - - - Updated - - - over 6 years ago + - - - - - - + + + 1 + - +
, "container":
I am a robot and this is a test!
- + gitify-app's avatar +
+
+ Updated +
+
+ 7 years ago +
+
- gitify-app's avatar - - - Updated - - - over 6 years ago + - - - - - - + + + 1 + - +
I am a robot and this is a test!
- + +
+
- - - + Updated +
+
+ 7 years ago +
+
- Updated - - - over 6 years ago + - - - - - - + + + 1 + - +
, "container":
I am a robot and this is a test!
- + +
+
- - - + Updated +
+
+ 7 years ago +
+
- Updated - - - over 6 years ago + - - - - - - + + + 1 + - +
gitify-app/notifications-test @@ -95,7 +95,7 @@ exports[`components/Repository.tsx should render itself & its children 1`] = ` src="https://avatars.githubusercontent.com/u/133795385?s=200&v=4" /> gitify-app/notifications-test @@ -239,7 +239,7 @@ exports[`components/Repository.tsx should use default repository icon when avata /> gitify-app/notifications-test @@ -326,7 +326,7 @@ exports[`components/Repository.tsx should use default repository icon when avata /> gitify-app/notifications-test diff --git a/src/utils/constants.ts b/src/utils/constants.ts index bb1567670..a3d607f94 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-1.5 bg-gray-100 hover:bg-gray-200 dark:bg-gray-800 dark:hover:bg-gray-700', + 'rounded-full text-xss px-1 m-0.5 bg-gray-100 hover:bg-gray-200 dark:bg-gray-800 dark:hover:bg-gray-700', // GitHub Docs GITHUB_DOCS: { diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index f175c8b4b..a69d121bb 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -1,4 +1,4 @@ -import { formatDistanceToNow, parseISO } from 'date-fns'; +import { formatDistanceToNowStrict, parseISO } from 'date-fns'; import type { Account, AuthState } from '../types'; import type { Notification } from '../typesGitHub'; import { openExternalLink } from '../utils/comms'; @@ -176,7 +176,7 @@ export function formatNotificationUpdatedAt( const date = notification.last_read_at ?? notification.updated_at; try { - return formatDistanceToNow(parseISO(date), { + return formatDistanceToNowStrict(parseISO(date), { addSuffix: true, }); } catch (e) {} diff --git a/tailwind.config.js b/tailwind.config.js index e1e37787e..d8329ccf9 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -3,6 +3,9 @@ module.exports = { darkMode: 'class', theme: { extend: { + fontSize: { + xss: '0.625rem', // 10px + }, colors: { gray: { sidebar: '#24292e',