From 89e4575bbd38030b60d19a254d72e86d2c566879 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Mon, 8 Jul 2024 11:08:45 -0700 Subject: [PATCH] feat: add header icon --- src/components/Header.tsx | 10 +-- .../__snapshots__/Header.test.tsx.snap | 66 +++++++++++-------- .../__snapshots__/Accounts.test.tsx.snap | 33 ++++++---- .../__snapshots__/Filters.test.tsx.snap | 33 ++++++---- .../LoginWithOAuthApp.test.tsx.snap | 66 +++++++++++-------- ...LoginWithPersonalAccessToken.test.tsx.snap | 66 +++++++++++-------- .../__snapshots__/Settings.test.tsx.snap | 33 ++++++---- 7 files changed, 176 insertions(+), 131 deletions(-) diff --git a/src/components/Header.tsx b/src/components/Header.tsx index c5e3c274c..3ecddb9e4 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -1,12 +1,13 @@ import { ArrowLeftIcon, type Icon } from '@primer/octicons-react'; -import { type FC, type ReactNode, useContext } from '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; + icon: Icon; + children: string; fetchOnBack?: boolean; } @@ -36,8 +37,7 @@ export const Header: FC = (props: IHeader) => {

- - {props.children} + {props.children}

); diff --git a/src/components/__snapshots__/Header.test.tsx.snap b/src/components/__snapshots__/Header.test.tsx.snap index 7907956c9..b5bf11c58 100644 --- a/src/components/__snapshots__/Header.test.tsx.snap +++ b/src/components/__snapshots__/Header.test.tsx.snap @@ -32,21 +32,26 @@ exports[`components/Header.tsx should render itself & its children 1`] = `

- - Test Header + + Test Header +

@@ -79,21 +84,26 @@ exports[`components/Header.tsx should render itself & its children 1`] = `

- - Test Header + + Test Header +

, diff --git a/src/routes/__snapshots__/Accounts.test.tsx.snap b/src/routes/__snapshots__/Accounts.test.tsx.snap index b8baa14c9..da96fff28 100644 --- a/src/routes/__snapshots__/Accounts.test.tsx.snap +++ b/src/routes/__snapshots__/Accounts.test.tsx.snap @@ -32,21 +32,26 @@ 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 +