diff --git a/package.json b/package.json
index e6c51ca30..780f23250 100644
--- a/package.json
+++ b/package.json
@@ -105,7 +105,7 @@
"afterSign": "scripts/notarize.js"
},
"dependencies": {
- "@primer/octicons-react": "^11.2.0",
+ "@primer/octicons-react": "^19.8.0",
"axios": "=0.27.2",
"date-fns": "^2.16.1",
"electron-updater": "^4.3.9",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 09d72d9a0..b6d470411 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -6,8 +6,8 @@ settings:
dependencies:
'@primer/octicons-react':
- specifier: ^11.2.0
- version: 11.2.0(react@16.14.0)
+ specifier: ^19.8.0
+ version: 19.8.0(react@16.14.0)
axios:
specifier: '=0.27.2'
version: 0.27.2
@@ -816,11 +816,11 @@ packages:
fastq: 1.15.0
dev: true
- /@primer/octicons-react@11.2.0(react@16.14.0):
- resolution: {integrity: sha512-pi3DT5fUtATw2atMRQ7xCUUbdauA/hYTKfM2ijf3rtipeyQ7Ou3ij/JLhnc9Ke110ljHJh69j/PiINbbKAYegQ==}
+ /@primer/octicons-react@19.8.0(react@16.14.0):
+ resolution: {integrity: sha512-2Z+D7xTloFTLQVRUEbg0pQpe6aTL9RR+8RqBhjkrF+BFuVdM1ENOyjywaGEO7DIkPU5Zxlv0gxSlD85LQxL+sw==}
engines: {node: '>=8'}
peerDependencies:
- react: '>=15'
+ react: '>=16.3'
dependencies:
react: 16.14.0
dev: false
diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx
index 5081e077b..0da632a4b 100644
--- a/src/components/Sidebar.tsx
+++ b/src/components/Sidebar.tsx
@@ -1,4 +1,4 @@
-import * as Octicons from '@primer/octicons-react';
+import { BellIcon } from '@primer/octicons-react';
import { ipcRenderer, shell } from 'electron';
import React, { useCallback, useContext, useMemo } from 'react';
import { useHistory, useLocation } from 'react-router-dom';
@@ -55,7 +55,7 @@ export const Sidebar: React.FC = () => {
onClick={onOpenGitHubNotifications}
aria-label={`${notificationsCount} Unread Notifications`}
>
-
+
{notificationsCount > 0 && notificationsCount}
diff --git a/src/components/__snapshots__/AccountNotifications.test.tsx.snap b/src/components/__snapshots__/AccountNotifications.test.tsx.snap
index 18c3181df..1a8fcb8ec 100644
--- a/src/components/__snapshots__/AccountNotifications.test.tsx.snap
+++ b/src/components/__snapshots__/AccountNotifications.test.tsx.snap
@@ -8,25 +8,26 @@ Array [
github.com
,
Repository
@@ -41,24 +42,25 @@ exports[`components/AccountNotifications.tsx should render itself (github.com wi
github.com
`;
diff --git a/src/components/__snapshots__/NotificationRow.test.tsx.snap b/src/components/__snapshots__/NotificationRow.test.tsx.snap
index 15fd3fb4d..ac0a03b85 100644
--- a/src/components/__snapshots__/NotificationRow.test.tsx.snap
+++ b/src/components/__snapshots__/NotificationRow.test.tsx.snap
@@ -10,25 +10,29 @@ exports[`components/Notification.js should render itself & its children 1`] = `
",
- }
- }
fill="currentColor"
+ focusable="false"
height={13}
role="img"
style={
Object {
"display": "inline-block",
+ "overflow": "visible",
"userSelect": "none",
"verticalAlign": "text-bottom",
}
}
viewBox="0 0 16 16"
width={13}
- />
+ >
+
+
@@ -93,24 +98,25 @@ exports[`components/Notification.js should render itself & its children 1`] = `
aria-hidden="false"
aria-label="Mark as Read"
className="hover:text-green-500"
- dangerouslySetInnerHTML={
- Object {
- "__html": "",
- }
- }
fill="currentColor"
+ focusable="false"
height={20}
role="img"
style={
Object {
"display": "inline-block",
+ "overflow": "visible",
"userSelect": "none",
"verticalAlign": "text-bottom",
}
}
viewBox="0 0 16 16"
width={20}
- />
+ >
+
+
diff --git a/src/components/__snapshots__/Repository.test.tsx.snap b/src/components/__snapshots__/Repository.test.tsx.snap
index d6deac116..54c25a118 100644
--- a/src/components/__snapshots__/Repository.test.tsx.snap
+++ b/src/components/__snapshots__/Repository.test.tsx.snap
@@ -29,24 +29,25 @@ Array [
aria-hidden="false"
aria-label="Mark Repository as Read"
className="hover:text-green-500"
- dangerouslySetInnerHTML={
- Object {
- "__html": "",
- }
- }
fill="currentColor"
+ focusable="false"
height={20}
role="img"
style={
Object {
"display": "inline-block",
+ "overflow": "visible",
"userSelect": "none",
"verticalAlign": "text-bottom",
}
}
viewBox="0 0 16 16"
width={20}
- />
+ >
+
+
,
diff --git a/src/components/__snapshots__/Sidebar.test.tsx.snap b/src/components/__snapshots__/Sidebar.test.tsx.snap
index 5ff88d128..814aa2c5f 100644
--- a/src/components/__snapshots__/Sidebar.test.tsx.snap
+++ b/src/components/__snapshots__/Sidebar.test.tsx.snap
@@ -59,25 +59,26 @@ exports[`components/Sidebar.tsx should render itself & its children (logged in)
>
4
@@ -178,25 +179,26 @@ exports[`components/Sidebar.tsx should render itself & its children (logged out)
>
4
diff --git a/src/routes/__snapshots__/LoginEnterprise.test.tsx.snap b/src/routes/__snapshots__/LoginEnterprise.test.tsx.snap
index a00a315bb..9edc43f32 100644
--- a/src/routes/__snapshots__/LoginEnterprise.test.tsx.snap
+++ b/src/routes/__snapshots__/LoginEnterprise.test.tsx.snap
@@ -15,24 +15,25 @@ exports[`routes/LoginEnterprise.js renders correctly 1`] = `
",
- }
- }
fill="currentColor"
+ focusable="false"
height={20}
role="img"
style={
Object {
"display": "inline-block",
+ "overflow": "visible",
"userSelect": "none",
"verticalAlign": "text-bottom",
}
}
viewBox="0 0 16 16"
width={20}
- />
+ >
+
+
",
- }
- }
fill="currentColor"
+ focusable="false"
height={20}
role="img"
style={
Object {
"display": "inline-block",
+ "overflow": "visible",
"userSelect": "none",
"verticalAlign": "text-bottom",
}
}
viewBox="0 0 16 16"
width={20}
- />
+ >
+
+
{
});
it('should get the notification type icon', () => {
- expect(getNotificationTypeIcon('CheckSuite').name).toBe('SyncIcon');
- expect(getNotificationTypeIcon('Commit').name).toBe('GitCommitIcon');
- expect(getNotificationTypeIcon('Discussion').name).toBe(
+ expect(getNotificationTypeIcon('CheckSuite').displayName).toBe('SyncIcon');
+ expect(getNotificationTypeIcon('Commit').displayName).toBe('GitCommitIcon');
+ expect(getNotificationTypeIcon('Discussion').displayName).toBe(
'CommentDiscussionIcon'
);
- expect(getNotificationTypeIcon('Issue').name).toBe('IssueOpenedIcon');
- expect(getNotificationTypeIcon('PullRequest').name).toBe(
- 'GitPullRequestIcon'
+ expect(getNotificationTypeIcon('Issue').displayName).toBe(
+ 'IssueOpenedIcon'
);
- expect(getNotificationTypeIcon('Release').name).toBe('TagIcon');
- expect(getNotificationTypeIcon('RepositoryVulnerabilityAlert').name).toBe(
- 'AlertIcon'
+ expect(getNotificationTypeIcon('PullRequest').displayName).toBe(
+ 'GitPullRequestIcon'
);
- expect(getNotificationTypeIcon('Unknown' as SubjectType).name).toBe(
+ expect(getNotificationTypeIcon('Release').displayName).toBe('TagIcon');
+ expect(
+ getNotificationTypeIcon('RepositoryVulnerabilityAlert').displayName
+ ).toBe('AlertIcon');
+ expect(getNotificationTypeIcon('Unknown' as SubjectType).displayName).toBe(
'QuestionIcon'
);
});
diff --git a/src/utils/github-api.ts b/src/utils/github-api.ts
index 0cbe2a545..dcb1312a8 100644
--- a/src/utils/github-api.ts
+++ b/src/utils/github-api.ts
@@ -1,5 +1,16 @@
+import {
+ AlertIcon,
+ CommentDiscussionIcon,
+ GitCommitIcon,
+ GitPullRequestIcon,
+ IssueOpenedIcon,
+ MailIcon,
+ OcticonProps,
+ QuestionIcon,
+ SyncIcon,
+ TagIcon,
+} from '@primer/octicons-react';
import { Reason, StateType, SubjectType } from '../typesGithub';
-import * as Octicons from '@primer/octicons-react';
// prettier-ignore
const DESCRIPTIONS = {
@@ -55,26 +66,26 @@ export function formatReason(reason: Reason): {
export function getNotificationTypeIcon(
type: SubjectType
-): React.FC {
+): React.FC {
switch (type) {
case 'CheckSuite':
- return Octicons.SyncIcon;
+ return SyncIcon;
case 'Commit':
- return Octicons.GitCommitIcon;
+ return GitCommitIcon;
case 'Discussion':
- return Octicons.CommentDiscussionIcon;
+ return CommentDiscussionIcon;
case 'Issue':
- return Octicons.IssueOpenedIcon;
+ return IssueOpenedIcon;
case 'PullRequest':
- return Octicons.GitPullRequestIcon;
+ return GitPullRequestIcon;
case 'Release':
- return Octicons.TagIcon;
+ return TagIcon;
case 'RepositoryInvitation':
- return Octicons.MailIcon;
+ return MailIcon;
case 'RepositoryVulnerabilityAlert':
- return Octicons.AlertIcon;
+ return AlertIcon;
default:
- return Octicons.QuestionIcon;
+ return QuestionIcon;
}
}