diff --git a/src/components/NotificationRow.tsx b/src/components/NotificationRow.tsx index b322f0fe2..d7b43fe86 100644 --- a/src/components/NotificationRow.tsx +++ b/src/components/NotificationRow.tsx @@ -17,6 +17,7 @@ import { AppContext } from '../context/App'; import { IconColor } from '../types'; import type { Notification } from '../typesGitHub'; import { openExternalLink } from '../utils/comms'; +import Constants from '../utils/constants'; import { formatForDisplay, formatNotificationUpdatedAt, @@ -86,7 +87,7 @@ export const NotificationRow: FC = ({ notification, hostname }) => { notification.subject.type, ]); - const commentsLabel = `${notification.subject.comments} ${ + const commentsPillDescription = `${notification.subject.comments} ${ notification.subject.comments > 1 ? 'comments' : 'comment' }`; @@ -156,22 +157,31 @@ export const NotificationRow: FC = ({ notification, hostname }) => { title={icon.description} className="ml-1" > - + ); }) : null} {notification.subject?.comments > 0 && ( - - + + )} diff --git a/src/components/__snapshots__/NotificationRow.test.tsx.snap b/src/components/__snapshots__/NotificationRow.test.tsx.snap index 6b24aaae0..58f5668d1 100644 --- a/src/components/__snapshots__/NotificationRow.test.tsx.snap +++ b/src/components/__snapshots__/NotificationRow.test.tsx.snap @@ -83,61 +83,79 @@ exports[`components/NotificationRow.tsx rendering for notification comments coun class="ml-1" title="octocat approved these changes" > - - - + + + + 1 + - - - + + + + 1 + - - - + + + + 1 + @@ -292,61 +310,79 @@ exports[`components/NotificationRow.tsx rendering for notification comments coun class="ml-1" title="octocat approved these changes" > - - - + + + + 1 + - - - + + + + 1 + - - - + + + + 1 + @@ -558,61 +594,79 @@ exports[`components/NotificationRow.tsx rendering for notification comments coun class="ml-1" title="octocat approved these changes" > - - - + + + + 1 + - - - + + + + 1 + - - - + + + + 2 + @@ -767,61 +821,79 @@ exports[`components/NotificationRow.tsx rendering for notification comments coun class="ml-1" title="octocat approved these changes" > - - - + + + + 1 + - - - + + + + 1 + - - - + + + + 2 + @@ -1033,41 +1105,53 @@ exports[`components/NotificationRow.tsx rendering for notification comments coun class="ml-1" title="octocat approved these changes" > - - - + + + + 1 + - - - + + + + 1 + @@ -1222,41 +1306,53 @@ exports[`components/NotificationRow.tsx rendering for notification comments coun class="ml-1" title="octocat approved these changes" > - - - + + + + 1 + - - - + + + + 1 + @@ -1462,41 +1558,53 @@ exports[`components/NotificationRow.tsx should render itself & its children 1`] class="ml-1" title="octocat approved these changes" > - - - + + + + 1 + - - - + + + + 1 + @@ -1645,41 +1753,53 @@ exports[`components/NotificationRow.tsx should render itself & its children 1`] class="ml-1" title="octocat approved these changes" > - - - + + + + 1 + - - - + + + + 1 + @@ -1885,41 +2005,53 @@ exports[`components/NotificationRow.tsx should render itself & its children when class="ml-1" title="octocat approved these changes" > - - - + + + + 1 + - - - + + + + 1 + @@ -2068,41 +2200,53 @@ exports[`components/NotificationRow.tsx should render itself & its children when class="ml-1" title="octocat approved these changes" > - - - + + + + 1 + - - - + + + + 1 + @@ -2314,41 +2458,53 @@ exports[`components/NotificationRow.tsx should render itself & its children with class="ml-1" title="octocat approved these changes" > - - - + + + + 1 + - - - + + + + 1 + @@ -2503,41 +2659,53 @@ exports[`components/NotificationRow.tsx should render itself & its children with class="ml-1" title="octocat approved these changes" > - - - + + + + 1 + - - - + + + + 1 + diff --git a/src/utils/constants.ts b/src/utils/constants.ts index c6a92a41d..a7295819e 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -24,6 +24,9 @@ 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', + // GitHub Docs GITHUB_DOCS: { OAUTH_URL: