diff --git a/src/components/Header.test.tsx b/src/components/Header.test.tsx index a381c8be8..7633858c7 100644 --- a/src/components/Header.test.tsx +++ b/src/components/Header.test.tsx @@ -1,3 +1,4 @@ +import { MarkGithubIcon } from '@primer/octicons-react'; import { fireEvent, render, screen } from '@testing-library/react'; import { AppContext } from '../context/App'; import { Header } from './Header'; @@ -16,13 +17,13 @@ describe('components/Header.tsx', () => { }); it('should render itself & its children', () => { - const tree = render(
Test Header
); + const tree = render(
Test Header
); expect(tree).toMatchSnapshot(); }); it('should navigate back', () => { - render(
Test Header
); + render(
Test Header
); fireEvent.click(screen.getByLabelText('Go Back')); @@ -36,7 +37,9 @@ describe('components/Header.tsx', () => { fetchNotifications, }} > -
Test Header
+
+ Test Header +
, ); diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 98698d861..3ecddb9e4 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -1,18 +1,17 @@ -import { ArrowLeftIcon } from '@primer/octicons-react'; -import { type FC, type ReactNode, useContext } from 'react'; +import { ArrowLeftIcon, type Icon } from '@primer/octicons-react'; +import { type FC, useContext } from 'react'; import { useNavigate } from 'react-router-dom'; import { AppContext } from '../context/App'; import { Size } from '../types'; +import { Legend } from './settings/Legend'; interface IHeader { - children: ReactNode; + icon: Icon; + children: string; fetchOnBack?: boolean; } -export const Header: FC = ({ - children, - fetchOnBack = false, -}: IHeader) => { +export const Header: FC = (props: IHeader) => { const navigate = useNavigate(); const { fetchNotifications } = useContext(AppContext); @@ -25,7 +24,7 @@ export const Header: FC = ({ title="Go Back" onClick={() => { navigate(-1); - if (fetchOnBack) { + if (props.fetchOnBack) { fetchNotifications(); } }} @@ -37,7 +36,9 @@ export const Header: FC = ({ /> -

{children}

+

+ {props.children} +

); }; diff --git a/src/components/__snapshots__/Header.test.tsx.snap b/src/components/__snapshots__/Header.test.tsx.snap index 98717155d..b5bf11c58 100644 --- a/src/components/__snapshots__/Header.test.tsx.snap +++ b/src/components/__snapshots__/Header.test.tsx.snap @@ -30,9 +30,28 @@ exports[`components/Header.tsx should render itself & its children 1`] = `

- Test Header + + + Test Header +

@@ -63,9 +82,28 @@ exports[`components/Header.tsx should render itself & its children 1`] = `

- Test Header + + + Test Header +

, diff --git a/src/routes/Accounts.tsx b/src/routes/Accounts.tsx index 41a859ffa..60e77c572 100644 --- a/src/routes/Accounts.tsx +++ b/src/routes/Accounts.tsx @@ -45,7 +45,7 @@ export const AccountsRoute: FC = () => { return (
-
Accounts
+
Accounts
{auth.accounts.map((account) => ( diff --git a/src/routes/Filters.tsx b/src/routes/Filters.tsx index 295044fd9..8e44789ee 100644 --- a/src/routes/Filters.tsx +++ b/src/routes/Filters.tsx @@ -1,5 +1,6 @@ import { FeedPersonIcon, + FilterIcon, FilterRemoveIcon, NoteIcon, } from '@primer/octicons-react'; @@ -33,7 +34,9 @@ export const FiltersRoute: FC = () => { return (
-
Filters
+
+ Filters +
diff --git a/src/routes/LoginWithOAuthApp.tsx b/src/routes/LoginWithOAuthApp.tsx index bd3b26573..9d0e7df3e 100644 --- a/src/routes/LoginWithOAuthApp.tsx +++ b/src/routes/LoginWithOAuthApp.tsx @@ -128,10 +128,7 @@ export const LoginWithOAuthApp: FC = () => { return (
-
- - Login with OAuth App -
+
Login with OAuth App
{ return ( <> -
- - Login with Personal Access Token -
+
Login with Personal Access Token
{ const { resetSettings } = useContext(AppContext); return (
-
Settings
+
+ Settings +
diff --git a/src/routes/__snapshots__/Accounts.test.tsx.snap b/src/routes/__snapshots__/Accounts.test.tsx.snap index 30e6212d1..da96fff28 100644 --- a/src/routes/__snapshots__/Accounts.test.tsx.snap +++ b/src/routes/__snapshots__/Accounts.test.tsx.snap @@ -30,9 +30,28 @@ exports[`routes/Accounts.tsx General should render itself & its children 1`] = `

- Accounts + + + Accounts +

- Filters + + + Filters +

- - Login with OAuth App + + Login with OAuth App +

- - Login with OAuth App + + Login with OAuth App +

- - Login with Personal Access Token + + Login with Personal Access Token +

- - Login with Personal Access Token + + Login with Personal Access Token +

- Settings + + + Settings +