Skip to content

Commit 739b5cd

Browse files
committed
refactor: update imports
1 parent 0f62e27 commit 739b5cd

30 files changed

+13
-55
lines changed

src/app.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
Routes,
77
useLocation,
88
} from 'react-router-dom';
9-
109
import { Loading } from './components/Loading';
1110
import { Sidebar } from './components/Sidebar';
1211
import { AppContext, AppProvider } from './context/App';

src/components/AccountNotifications.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { ChevronDownIcon, ChevronLeftIcon } from '@primer/octicons-react';
2-
32
import type { Notification } from '../typesGitHub';
43
import { RepositoryNotifications } from './Repository';
54

src/components/AllRead.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { mockMathRandom } from './test-utils';
2-
31
import { render } from '@testing-library/react';
42
import { AllRead } from './AllRead';
3+
import { mockMathRandom } from './test-utils';
54

65
describe('components/AllRead.tsx', () => {
76
// The read emoji randomly rotates, but then the snapshots would never match

src/components/Loading.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { render } from '@testing-library/react';
22
import NProgress from 'nprogress';
3-
43
import { AppContext } from '../context/App';
54
import { Loading } from './Loading';
65

src/components/Loading.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import NProgress from 'nprogress';
22
import { useContext, useEffect } from 'react';
3-
43
import { AppContext } from '../context/App';
54

65
export const Loading = () => {

src/components/Logo.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { fireEvent, render, screen } from '@testing-library/react';
2-
32
import { Logo } from './Logo';
43

54
describe('components/Logo.tsx', () => {

src/components/NotificationRow.test.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import { fireEvent, render, screen } from '@testing-library/react';
2-
3-
import * as helpers from '../utils/helpers';
4-
52
import { shell } from 'electron';
63
import { mockAccounts, mockSettings } from '../__mocks__/mock-state';
74
import { mockedSingleNotification } from '../__mocks__/mockedData';
85
import { AppContext } from '../context/App';
96
import type { UserType } from '../typesGitHub';
7+
import * as helpers from '../utils/helpers';
108
import { NotificationRow } from './NotificationRow';
119

1210
describe('components/NotificationRow.tsx', () => {

src/components/Oops.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { type FC, useMemo } from 'react';
2-
32
import type { GitifyError } from '../types';
43

54
interface IProps {

src/components/Repository.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { CheckIcon, MarkGithubIcon, ReadIcon } from '@primer/octicons-react';
2-
32
import { type FC, useCallback, useContext } from 'react';
43
import { CSSTransition, TransitionGroup } from 'react-transition-group';
5-
64
import { AppContext } from '../context/App';
75
import type { Notification } from '../typesGitHub';
86
import { openExternalLink } from '../utils/comms';

src/components/Sidebar.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ import {
55
XCircleIcon,
66
} from '@primer/octicons-react';
77
import { ipcRenderer } from 'electron';
8-
98
import { type FC, useCallback, useContext, useMemo } from 'react';
109
import { useLocation, useNavigate } from 'react-router-dom';
11-
1210
import { Logo } from '../components/Logo';
1311
import { AppContext } from '../context/App';
1412
import { openExternalLink } from '../utils/comms';

src/components/fields/Button.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { fireEvent, render, screen } from '@testing-library/react';
2-
31
import { MarkGithubIcon } from '@primer/octicons-react';
2+
import { fireEvent, render, screen } from '@testing-library/react';
43
import { shell } from 'electron';
54
import { Button, type IButton } from './Button';
65

src/components/fields/RadioGroup.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { fireEvent, render, screen } from '@testing-library/react';
2-
32
import { type IRadioGroup, RadioGroup } from './RadioGroup';
43

54
describe('components/fields/RadioGroup.tsx', () => {

src/components/fields/Tooltip.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { fireEvent, render, screen } from '@testing-library/react';
2-
32
import { type ITooltip, Tooltip } from './Tooltip';
43

54
describe('components/fields/Tooltip.tsx', () => {

src/context/App.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { act, fireEvent, render, waitFor } from '@testing-library/react';
22
import { useContext } from 'react';
3-
43
import { mockAccounts, mockSettings } from '../__mocks__/mock-state';
54
import { useNotifications } from '../hooks/useNotifications';
65
import type { AuthState, SettingsState } from '../types';

src/context/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
useMemo,
77
useState,
88
} from 'react';
9-
109
import { useInterval } from '../hooks/useInterval';
1110
import { useNotifications } from '../hooks/useNotifications';
1211
import {

src/hooks/useNotifications.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { act, renderHook, waitFor } from '@testing-library/react';
22
import axios, { AxiosError } from 'axios';
33
import nock from 'nock';
4-
54
import { mockAccounts, mockSettings } from '../__mocks__/mock-state';
65
import { mockedNotificationUser, mockedUser } from '../__mocks__/mockedData';
76
import type { AuthState } from '../types';

src/hooks/useNotifications.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { useCallback, useState } from 'react';
2-
32
import type {
43
AccountNotifications,
54
AuthState,

src/routes/Login.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
const { ipcRenderer } = require('electron');
2-
2+
import { KeyIcon, PersonIcon } from '@primer/octicons-react';
33
import { type FC, useContext, useEffect } from 'react';
44
import { useNavigate } from 'react-router-dom';
5-
6-
import { KeyIcon, PersonIcon } from '@primer/octicons-react';
75
import { Logo } from '../components/Logo';
86
import { Button } from '../components/fields/Button';
97
import { AppContext } from '../context/App';

src/routes/LoginWithOAuthApp.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
const ipcRenderer = require('electron').ipcRenderer;
2-
32
import {
43
ArrowLeftIcon,
54
BookIcon,
65
PersonIcon,
76
SignInIcon,
87
} from '@primer/octicons-react';
9-
108
import { type FC, useCallback, useContext, useEffect } from 'react';
119
import { Form, type FormRenderProps } from 'react-final-form';
1210
import { useNavigate } from 'react-router-dom';
13-
1411
import { Button } from '../components/fields/Button';
1512
import { FieldInput } from '../components/fields/FieldInput';
1613
import { AppContext } from '../context/App';

src/routes/LoginWithPersonalAccessToken.test.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import {
66
waitFor,
77
} from '@testing-library/react';
88
import { shell } from 'electron';
9-
109
import { MemoryRouter } from 'react-router-dom';
11-
1210
import { AppContext } from '../context/App';
1311
import {
1412
LoginWithPersonalAccessToken,

src/routes/LoginWithPersonalAccessToken.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@ import {
44
KeyIcon,
55
SignInIcon,
66
} from '@primer/octicons-react';
7-
87
import { type FC, useCallback, useContext, useState } from 'react';
98
import { Form, type FormRenderProps } from 'react-final-form';
109
import { useNavigate } from 'react-router-dom';
11-
10+
import { Button } from '../components/fields/Button';
1211
import { FieldInput } from '../components/fields/FieldInput';
1312
import { AppContext } from '../context/App';
1413
import type { AuthTokenOptions } from '../types';
15-
import { Constants } from '../utils/constants';
16-
17-
import { Button } from '../components/fields/Button';
1814
import { getNewTokenURL, isValidHostname, isValidToken } from '../utils/auth';
15+
import { Constants } from '../utils/constants';
1916

2017
interface IValues {
2118
token?: string;

src/routes/Notifications.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { type FC, useContext, useMemo } from 'react';
2-
32
import { AccountNotifications } from '../components/AccountNotifications';
43
import { AllRead } from '../components/AllRead';
54
import { Oops } from '../components/Oops';

src/routes/Settings.test.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { act, fireEvent, render, screen } from '@testing-library/react';
2-
32
import { MemoryRouter } from 'react-router-dom';
4-
53
const { ipcRenderer } = require('electron');
6-
74
import { shell } from 'electron';
85
import { mockAccounts, mockSettings } from '../__mocks__/mock-state';
96
import { AppContext } from '../context/App';

src/routes/Settings.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
XCircleIcon,
88
} from '@primer/octicons-react';
99
import { ipcRenderer } from 'electron';
10-
1110
import {
1211
type FC,
1312
type MouseEvent,
@@ -17,7 +16,6 @@ import {
1716
useState,
1817
} from 'react';
1918
import { useNavigate } from 'react-router-dom';
20-
2119
import { Checkbox } from '../components/fields/Checkbox';
2220
import { RadioGroup } from '../components/fields/RadioGroup';
2321
import { AppContext } from '../context/App';

src/utils/api/client.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { AxiosPromise } from 'axios';
2+
import { print } from 'graphql/language/printer';
23
import type { SettingsState } from '../../types';
34
import type {
45
Commit,
@@ -14,11 +15,9 @@ import type {
1415
Release,
1516
UserDetails,
1617
} from '../../typesGitHub';
17-
import { apiRequestAuth } from './request';
18-
19-
import { print } from 'graphql/language/printer';
2018
import { QUERY_SEARCH_DISCUSSIONS } from './graphql/discussions';
2119
import { formatAsGitHubSearchSyntax } from './graphql/utils';
20+
import { apiRequestAuth } from './request';
2221
import { getGitHubAPIBaseUrl, getGitHubGraphQLUrl } from './utils';
2322

2423
/**

src/utils/auth.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import type { AxiosPromise, AxiosResponse } from 'axios';
2-
31
import remote from '@electron/remote';
4-
const browserWindow = new remote.BrowserWindow();
5-
2+
import type { AxiosPromise, AxiosResponse } from 'axios';
63
import type { AuthState } from '../types';
74
import * as apiRequests from './api/request';
85
import * as auth from './auth';
96
import { getNewOAuthAppURL, getNewTokenURL } from './auth';
107

8+
const browserWindow = new remote.BrowserWindow();
9+
1110
describe('utils/auth.tsx', () => {
1211
describe('authGitHub', () => {
1312
const loadURLMock = jest.spyOn(browserWindow, 'loadURL');

src/utils/auth.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { BrowserWindow } from '@electron/remote';
2-
32
import { format } from 'date-fns';
43
import type {
54
AuthResponse,

src/utils/notifications.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { ipcRenderer } from 'electron';
2-
32
import { mockAccounts, mockSettings } from '../__mocks__/mock-state';
43
import {
54
mockedAccountNotifications,

src/utils/notifications.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { ipcRenderer } from 'electron';
2+
import type { AccountNotifications, AuthState, SettingsState } from '../types';
23
import { Notification } from '../typesGitHub';
34
import {
45
getTokenForHost,
56
isPersonalAccessTokenLoggedIn,
67
openInBrowser,
78
} from '../utils/helpers';
8-
import { updateTrayIcon } from './comms';
9-
10-
import type { AccountNotifications, AuthState, SettingsState } from '../types';
119
import { listNotificationsForAuthenticatedUser } from './api/client';
10+
import { updateTrayIcon } from './comms';
1211
import Constants from './constants';
1312
import { getGitifySubjectDetails } from './subject';
1413

src/utils/subject.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import axios from 'axios';
22
import nock from 'nock';
3-
43
import { mockAccounts } from '../__mocks__/mock-state';
54
import {
65
partialMockNotification,

0 commit comments

Comments
 (0)