Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: octokit openapi types #1626

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"@biomejs/biome": "1.9.4",
"@discordapp/twemoji": "15.1.0",
"@electron/notarize": "2.5.0",
"@octokit/openapi-types": "22.2.0",
"@primer/octicons-react": "19.12.0",
"@testing-library/react": "16.0.1",
"@types/jest": "29.5.14",
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions src/renderer/components/RepositoryNotifications.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { CheckIcon, MarkGithubIcon, ReadIcon } from '@primer/octicons-react';
import { type FC, type MouseEvent, useContext, useState } from 'react';
import { AppContext } from '../context/App';
import { Opacity, Size } from '../types';
import { type Link, Opacity, Size } from '../types';
import type { Notification } from '../typesGitHub';
import { cn } from '../utils/cn';
import { openExternalLink } from '../utils/comms';
import {
getChevronDetails,
isMarkAsDoneFeatureSupported,
} from '../utils/helpers';
import { openRepository } from '../utils/links';
import { HoverGroup } from './HoverGroup';
import { NotificationRow } from './NotificationRow';
import { InteractionButton } from './buttons/InteractionButton';
Expand Down Expand Up @@ -67,7 +67,9 @@ export const RepositoryNotifications: FC<IRepositoryNotifications> = ({
onClick={(event: MouseEvent<HTMLElement>) => {
// Don't trigger onClick of parent element.
event.stopPropagation();
openRepository(repoNotifications[0].repository);
openExternalLink(
repoNotifications[0].repository.html_url as Link,
);
}}
>
{repoName}
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/components/notification/NotificationHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { MarkGithubIcon } from '@primer/octicons-react';
import { type FC, type MouseEvent, useContext } from 'react';
import { AppContext } from '../../context/App';
import { Opacity, Size } from '../../types';
import { type Link, Opacity, Size } from '../../types';
import type { Notification } from '../../typesGitHub';
import { cn } from '../../utils/cn';
import { openRepository } from '../../utils/links';
import { openExternalLink } from '../../utils/comms';
import { AvatarIcon } from '../icons/AvatarIcon';

interface INotificationHeader {
Expand Down Expand Up @@ -43,7 +43,7 @@ export const NotificationHeader: FC<INotificationHeader> = ({
onClick={(event: MouseEvent<HTMLElement>) => {
// Don't trigger onClick of parent element.
event.stopPropagation();
openRepository(notification.repository);
openExternalLink(notification.repository.html_url as Link);
}}
>
{repoSlug}
Expand Down
Loading
Loading