diff --git a/src/components/NotificationRow.tsx b/src/components/NotificationRow.tsx index 909eba3ff..b4ad71a07 100644 --- a/src/components/NotificationRow.tsx +++ b/src/components/NotificationRow.tsx @@ -11,7 +11,6 @@ import { import { type FC, type MouseEvent, useCallback, useContext } from 'react'; import { AppContext } from '../context/App'; -import { PILL_CLASS_NAME } from '../styles/gitify'; import { type Account, IconColor } from '../types'; import type { Notification } from '../typesGitHub'; import { @@ -25,6 +24,7 @@ import { } from '../utils/icons'; import { openNotification, openUserProfile } from '../utils/links'; import { formatReason } from '../utils/reason'; +import { PillButton } from './buttons/PillButton'; interface IProps { account: Account; @@ -143,17 +143,14 @@ export const NotificationRow: FC = ({ notification, account }) => { {settings.showPills && (
{notification.subject?.linkedIssues?.length > 0 && ( - - - + )} + {notification.subject.reviews?.map((review) => { const icon = getPullRequestReviewIcon(review); if (!icon) { @@ -161,59 +158,41 @@ export const NotificationRow: FC = ({ notification, account }) => { } return ( - - - + ); })} {notification.subject?.comments > 0 && ( - - - + )} {notification.subject?.labels?.length > 0 && ( - - - + )} {notification.subject.milestone && ( - - - + icon={MilestoneIcon} + color={ + notification.subject.milestone.state === 'open' + ? IconColor.GREEN + : IconColor.RED + } + /> )}
)} diff --git a/src/components/__snapshots__/NotificationRow.test.tsx.snap b/src/components/__snapshots__/NotificationRow.test.tsx.snap index 2a20cdc13..270ecb255 100644 --- a/src/components/__snapshots__/NotificationRow.test.tsx.snap +++ b/src/components/__snapshots__/NotificationRow.test.tsx.snap @@ -3377,7 +3377,6 @@ exports[`components/NotificationRow.tsx notification pills / metrics milestone p + + ); +}; diff --git a/src/components/buttons/__snapshots__/PillButton.test.tsx.snap b/src/components/buttons/__snapshots__/PillButton.test.tsx.snap new file mode 100644 index 000000000..000c3b996 --- /dev/null +++ b/src/components/buttons/__snapshots__/PillButton.test.tsx.snap @@ -0,0 +1,114 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`components/buttons/PillButton.tsx should render 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+ + + +
+ , + "container":
+ + + +
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; diff --git a/src/styles/gitify.ts b/src/styles/gitify.ts index f33ad0229..22be10267 100644 --- a/src/styles/gitify.ts +++ b/src/styles/gitify.ts @@ -4,7 +4,4 @@ export const BUTTON_CLASS_NAME = export const BUTTON_SIDEBAR_CLASS_NAME = 'flex justify-evenly items-center bg-transparent border-0 w-full text-sm text-white my-1 py-2 cursor-pointer hover:text-gray-500 focus:outline-none disabled:text-gray-500 disabled:cursor-default'; -export const PILL_CLASS_NAME = - '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'; - export const READ_NOTIFICATION_CLASS_NAME = 'opacity-50 dark:opacity-50';