diff --git a/package.json b/package.json index a93c0dab8..33aaf0ac5 100644 --- a/package.json +++ b/package.json @@ -140,6 +140,7 @@ "@discordapp/twemoji": "15.1.0", "@electron/notarize": "2.5.0", "@primer/octicons-react": "19.14.0", + "@primer/primitives": "^10.3.4", "@primer/react": "36.27.0", "@testing-library/react": "16.2.0", "@types/jest": "29.5.14", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5a730a804..830ba6a15 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,6 +45,9 @@ importers: '@primer/octicons-react': specifier: 19.14.0 version: 19.14.0(react@19.0.0) + '@primer/primitives': + specifier: ^10.3.4 + version: 10.3.4 '@primer/react': specifier: 36.27.0 version: 36.27.0(@types/react-dom@19.0.3(@types/react@19.0.7))(@types/react@19.0.7)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(styled-components@6.1.14(react-dom@19.0.0(react@19.0.0))(react@19.0.0)) @@ -668,6 +671,9 @@ packages: peerDependencies: react: '>=16.3' + '@primer/primitives@10.3.4': + resolution: {integrity: sha512-f4tudg+MFpU4sH73Ha9wFOBwyN2b2WI7BkqMThqRIWQ/LFUturYkgt78YByJ6PJw8ZY0poPiefvBCdduyd20vA==} + '@primer/primitives@7.17.1': resolution: {integrity: sha512-SiPzEb+up1nDpV2NGwNiY8m6sGnF3OUqRb0has5s6T40vq6Li/g3cYVgl+oolEa4DUoNygEPs09jwJt24f/3zg==} @@ -5093,6 +5099,8 @@ snapshots: dependencies: react: 19.0.0 + '@primer/primitives@10.3.4': {} + '@primer/primitives@7.17.1': {} '@primer/react@36.27.0(@types/react-dom@19.0.3(@types/react@19.0.7))(@types/react@19.0.7)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(styled-components@6.1.14(react-dom@19.0.0(react@19.0.0))(react@19.0.0))': diff --git a/src/renderer/App.css b/src/renderer/App.css index a022e056d..3cfdea64d 100644 --- a/src/renderer/App.css +++ b/src/renderer/App.css @@ -1,3 +1,18 @@ +/** GitHub Primer Design System */ +/* Size & Typography */ +@import "@primer/primitives/dist/css/base/size/size.css"; +@import "@primer/primitives/dist/css/base/typography/typography.css"; +@import "@primer/primitives/dist/css/functional/size/border.css"; +@import "@primer/primitives/dist/css/functional/size/breakpoints.css"; +@import "@primer/primitives/dist/css/functional/size/size.css"; +@import "@primer/primitives/dist/css/functional/size/viewport.css"; +@import "@primer/primitives/dist/css/functional/typography/typography.css"; + +/* Themes and Colors */ +/* TODO Add support for setting color modes (dark_dimmed) - see #1748 */ +@import "@primer/primitives/dist/css/functional/themes/light.css"; +@import "@primer/primitives/dist/css/functional/themes/dark.css"; + html, body, #root { diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index 7a4b27822..6ba12d487 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -35,7 +35,8 @@ function RequireAuth({ children }) { export const App = () => { return ( - + // TODO Add support for setting color modes (dark_dimmed) - see #1748 + diff --git a/src/renderer/components/AllRead.tsx b/src/renderer/components/AllRead.tsx index 37b08c7db..56958617f 100644 --- a/src/renderer/components/AllRead.tsx +++ b/src/renderer/components/AllRead.tsx @@ -1,14 +1,15 @@ import { type FC, useContext, useMemo } from 'react'; -import { Stack } from '@primer/react'; - import { AppContext } from '../context/App'; import { Constants } from '../utils/constants'; import { hasFiltersSet } from '../utils/filters'; -import { Centered } from './primitives/Centered'; -import { EmojiText } from './primitives/EmojiText'; +import { EmojiSplash } from './layout/EmojiSplash'; + +interface IAllRead { + fullHeight?: boolean; +} -export const AllRead: FC = () => { +export const AllRead: FC = ({ fullHeight = true }: IAllRead) => { const { settings } = useContext(AppContext); const hasFilters = hasFiltersSet(settings); @@ -21,21 +22,9 @@ export const AllRead: FC = () => { [], ); - return ( - - -
- -
+ const heading = `No new ${hasFilters ? 'filtered ' : ''} notifications`; - {hasFilters ? ( -
- No new filtered notifications -
- ) : ( -
No new notifications
- )} -
-
+ return ( + ); }; diff --git a/src/renderer/components/Oops.tsx b/src/renderer/components/Oops.tsx index 65f4cac66..c23c44cd8 100644 --- a/src/renderer/components/Oops.tsx +++ b/src/renderer/components/Oops.tsx @@ -1,37 +1,25 @@ import { type FC, useMemo } from 'react'; -import { Stack } from '@primer/react'; import type { GitifyError } from '../types'; -import { Centered } from './primitives/Centered'; -import { EmojiText } from './primitives/EmojiText'; +import { EmojiSplash } from './layout/EmojiSplash'; interface IOops { error: GitifyError; + fullHeight?: boolean; } -export const Oops: FC = ({ error }: IOops) => { +export const Oops: FC = ({ error, fullHeight = true }: IOops) => { const emoji = useMemo( () => error.emojis[Math.floor(Math.random() * error.emojis.length)], [error], ); return ( - - -
- -
- -
{error.title}
- {error.descriptions.map((description, i) => { - return ( - // biome-ignore lint/suspicious/noArrayIndexKey: using index for key to keep the error constants clean -
- {description} -
- ); - })} -
-
+ ); }; diff --git a/src/renderer/components/Sidebar.tsx b/src/renderer/components/Sidebar.tsx index eb5d5fccb..2f8ff284b 100644 --- a/src/renderer/components/Sidebar.tsx +++ b/src/renderer/components/Sidebar.tsx @@ -69,80 +69,82 @@ export const Sidebar: FC = () => { }, [notifications]); return ( -
-
- - navigate('/', { replace: true })} - data-testid="sidebar-home" - /> - - 0 ? 'primary' : 'invisible'} - tooltipDirection="e" - onClick={() => openGitHubNotifications(primaryAccountHostname)} - data-testid="sidebar-notifications" - sx={{ color: 'white' }} - /> - - {/* TODO - explore https://primer.style/components/selectpanel/react/alpha/ for a better UI for filters */} - {isLoggedIn && ( - toggleFilters()} - data-testid="sidebar-filter-notifications" - sx={{ color: 'white' }} - /> - )} - + + + navigate('/', { replace: true })} + data-testid="sidebar-home" + /> + + 0 ? 'primary' : 'invisible'} + tooltipDirection="e" + onClick={() => openGitHubNotifications(primaryAccountHostname)} + data-testid="sidebar-notifications" + sx={{ color: 'white' }} + /> + + {/* TODO - explore https://primer.style/components/selectpanel/react/alpha/ for a better UI for filters */} + {isLoggedIn && ( openGitHubIssues(primaryAccountHostname)} - data-testid="sidebar-my-issues" + onClick={() => toggleFilters()} + data-testid="sidebar-filter-notifications" sx={{ color: 'white' }} /> + )} - openGitHubPulls(primaryAccountHostname)} - data-testid="sidebar-my-pull-requests" - sx={{ color: 'white' }} - /> - -
+ openGitHubIssues(primaryAccountHostname)} + data-testid="sidebar-my-issues" + sx={{ color: 'white' }} + /> + + openGitHubPulls(primaryAccountHostname)} + data-testid="sidebar-my-pull-requests" + sx={{ color: 'white' }} + /> + { /> )} -
+ ); }; diff --git a/src/renderer/components/__snapshots__/AllRead.test.tsx.snap b/src/renderer/components/__snapshots__/AllRead.test.tsx.snap index 0c22a0ec6..da19618c6 100644 --- a/src/renderer/components/__snapshots__/AllRead.test.tsx.snap +++ b/src/renderer/components/__snapshots__/AllRead.test.tsx.snap @@ -6,32 +6,46 @@ exports[`renderer/components/AllRead.tsx should render itself & its children - n "baseElement":
- +
🎊 - -
-
- No new notifications +
+
+ No new notifications +
@@ -39,32 +53,46 @@ exports[`renderer/components/AllRead.tsx should render itself & its children - n , "container":
- +
🎊 - -
-
- No new notifications +
+
+ No new notifications +
@@ -129,32 +157,46 @@ exports[`renderer/components/AllRead.tsx should render itself & its children - w "baseElement":
- +
🎊 - -
-
- No new filtered notifications +
+
+ No new filtered notifications +
@@ -162,32 +204,46 @@ exports[`renderer/components/AllRead.tsx should render itself & its children - w , "container":
- +
🎊 - -
-
- No new filtered notifications +
+
+ No new filtered notifications +
diff --git a/src/renderer/components/__snapshots__/Oops.test.tsx.snap b/src/renderer/components/__snapshots__/Oops.test.tsx.snap index 023316eab..efaba1bd1 100644 --- a/src/renderer/components/__snapshots__/Oops.test.tsx.snap +++ b/src/renderer/components/__snapshots__/Oops.test.tsx.snap @@ -6,35 +6,49 @@ exports[`renderer/components/Oops.tsx should render itself & its children 1`] = "baseElement":
- +
🔥 - -
-
- Error title +
+
+ Error title +
Error description
@@ -44,35 +58,49 @@ exports[`renderer/components/Oops.tsx should render itself & its children 1`] = , "container":
- +
🔥 - -
-
- Error title +
+
+ Error title +
Error description
diff --git a/src/renderer/components/__snapshots__/Sidebar.test.tsx.snap b/src/renderer/components/__snapshots__/Sidebar.test.tsx.snap index f5c44582e..2a8d8e967 100644 --- a/src/renderer/components/__snapshots__/Sidebar.test.tsx.snap +++ b/src/renderer/components/__snapshots__/Sidebar.test.tsx.snap @@ -70,262 +70,12 @@ exports[`renderer/components/Sidebar.tsx should render itself & its children (lo "baseElement":
-
-
- - - Home - - - - 4 unread notifications - - - - - -
-
-
- - -
-
-
- , - "container":
-
-
-
-
- - -
-
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/Sidebar.tsx should render itself & its children (logged out) 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
-
-
- - - Home - - - - 4 unread notifications - - - - - -
-
+ + Home + + + + 4 unread notifications + + + + + +
+
+ + +
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/Sidebar.tsx should render itself & its children (logged out) 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+
+
+ + +
+
+
+ , + "container":
+
+
+ + + Home + + + + 4 unread notifications + + + + +
= (props: IPillButton) => { - return ( - - ); -}; diff --git a/src/renderer/components/fields/Checkbox.test.tsx b/src/renderer/components/fields/Checkbox.test.tsx index 7bfd3b22b..ef15490c0 100644 --- a/src/renderer/components/fields/Checkbox.test.tsx +++ b/src/renderer/components/fields/Checkbox.test.tsx @@ -5,7 +5,6 @@ describe('renderer/components/fields/Checkbox.tsx', () => { const props: ICheckbox = { name: 'appearance', label: 'Appearance', - helpText: 'This is some helper text', checked: true, onChange: jest.fn(), }; diff --git a/src/renderer/components/fields/Checkbox.tsx b/src/renderer/components/fields/Checkbox.tsx index 923365eba..d44e24cc8 100644 --- a/src/renderer/components/fields/Checkbox.tsx +++ b/src/renderer/components/fields/Checkbox.tsx @@ -4,7 +4,6 @@ import { Tooltip } from './Tooltip'; export interface ICheckbox { name: string; label: string; - helpText?: ReactNode | string; tooltip?: ReactNode | string; checked: boolean; disabled?: boolean; @@ -39,12 +38,6 @@ export const Checkbox: FC = (props: ICheckbox) => { )}
- - {props.helpText && ( -
- {props.helpText} -
- )}
); }; diff --git a/src/renderer/components/fields/FieldInput.tsx b/src/renderer/components/fields/FieldInput.tsx index e12d2434b..a697fd7e2 100644 --- a/src/renderer/components/fields/FieldInput.tsx +++ b/src/renderer/components/fields/FieldInput.tsx @@ -33,8 +33,8 @@ export const FieldInput: FC = ({ { const props: IRadioGroup = { label: 'Appearance', name: 'appearance', - helpText: 'This is some helper text', options: [ { label: 'Value 1', value: 'one' }, { label: 'Value 2', value: 'two' }, diff --git a/src/renderer/components/fields/RadioGroup.tsx b/src/renderer/components/fields/RadioGroup.tsx index 2c60b6b59..fd48cf9cc 100644 --- a/src/renderer/components/fields/RadioGroup.tsx +++ b/src/renderer/components/fields/RadioGroup.tsx @@ -6,7 +6,6 @@ import { Tooltip } from './Tooltip'; export interface IRadioGroup { name: string; label: string; - helpText?: ReactNode | string; tooltip?: ReactNode | string; options: RadioGroupItem[]; value: string; @@ -66,12 +65,6 @@ export const RadioGroup: FC = (props: IRadioGroup) => { })}
- - {props.helpText && ( -
- {props.helpText} -
- )}
); }; diff --git a/src/renderer/components/fields/__snapshots__/Checkbox.test.tsx.snap b/src/renderer/components/fields/__snapshots__/Checkbox.test.tsx.snap index 9071b946c..da9c5faab 100644 --- a/src/renderer/components/fields/__snapshots__/Checkbox.test.tsx.snap +++ b/src/renderer/components/fields/__snapshots__/Checkbox.test.tsx.snap @@ -28,11 +28,6 @@ exports[`renderer/components/fields/Checkbox.tsx should render 1`] = `
-
- This is some helper text -
, @@ -60,11 +55,6 @@ exports[`renderer/components/fields/Checkbox.tsx should render 1`] = `
-
- This is some helper text -
, "debug": [Function], diff --git a/src/renderer/components/fields/__snapshots__/FieldInput.test.tsx.snap b/src/renderer/components/fields/__snapshots__/FieldInput.test.tsx.snap index 70cc840dc..9d2aa0224 100644 --- a/src/renderer/components/fields/__snapshots__/FieldInput.test.tsx.snap +++ b/src/renderer/components/fields/__snapshots__/FieldInput.test.tsx.snap @@ -16,7 +16,7 @@ exports[`renderer/components/fields/FieldInput.tsx should render 1`] = ` Appearance -
- This is some helper text -
, @@ -130,11 +125,6 @@ exports[`renderer/components/fields/RadioGroup.tsx should render 1`] = ` -
- This is some helper text -
, "debug": [Function], @@ -257,11 +247,6 @@ exports[`renderer/components/fields/RadioGroup.tsx should render as disabled 1`] -
- This is some helper text -
, @@ -327,11 +312,6 @@ exports[`renderer/components/fields/RadioGroup.tsx should render as disabled 1`] -
- This is some helper text -
, "debug": [Function], diff --git a/src/renderer/components/layout/Centered.test.tsx b/src/renderer/components/layout/Centered.test.tsx new file mode 100644 index 000000000..f7103406c --- /dev/null +++ b/src/renderer/components/layout/Centered.test.tsx @@ -0,0 +1,16 @@ +import { render } from '@testing-library/react'; +import { Centered } from './Centered'; + +describe('renderer/components/layout/Centered.tsx', () => { + it('should render itself & its children - full height true', () => { + const tree = render(Test); + + expect(tree).toMatchSnapshot(); + }); + + it('should render itself & its children - full height false', () => { + const tree = render(Test); + + expect(tree).toMatchSnapshot(); + }); +}); diff --git a/src/renderer/components/layout/Centered.tsx b/src/renderer/components/layout/Centered.tsx new file mode 100644 index 000000000..a64fd495e --- /dev/null +++ b/src/renderer/components/layout/Centered.tsx @@ -0,0 +1,24 @@ +import { Stack } from '@primer/react'; +import type { FC, ReactNode } from 'react'; + +interface ICentered { + children: ReactNode; + fullHeight?: boolean; +} + +export const Centered: FC = ({ + fullHeight = true, + ...props +}: ICentered) => { + return ( + + {props.children} + + ); +}; diff --git a/src/renderer/components/primitives/Contents.test.tsx b/src/renderer/components/layout/Contents.test.tsx similarity index 78% rename from src/renderer/components/primitives/Contents.test.tsx rename to src/renderer/components/layout/Contents.test.tsx index 177d5b25b..79b1dc6db 100644 --- a/src/renderer/components/primitives/Contents.test.tsx +++ b/src/renderer/components/layout/Contents.test.tsx @@ -1,7 +1,7 @@ import { render } from '@testing-library/react'; import { Contents } from './Contents'; -describe('renderer/components/primitives/Contents.tsx', () => { +describe('renderer/components/layout/Contents.tsx', () => { it('should render itself & its children', () => { const tree = render(Test); diff --git a/src/renderer/components/primitives/Contents.tsx b/src/renderer/components/layout/Contents.tsx similarity index 100% rename from src/renderer/components/primitives/Contents.tsx rename to src/renderer/components/layout/Contents.tsx diff --git a/src/renderer/components/layout/EmojiSplash.test.tsx b/src/renderer/components/layout/EmojiSplash.test.tsx new file mode 100644 index 000000000..313c95986 --- /dev/null +++ b/src/renderer/components/layout/EmojiSplash.test.tsx @@ -0,0 +1,22 @@ +import { render } from '@testing-library/react'; +import { EmojiSplash } from './EmojiSplash'; + +describe('renderer/components/layout/EmojiSplash.tsx', () => { + it('should render itself & its children - heading only', () => { + const tree = render(); + + expect(tree).toMatchSnapshot(); + }); + + it('should render itself & its children - heading and sub-heading', () => { + const tree = render( + , + ); + + expect(tree).toMatchSnapshot(); + }); +}); diff --git a/src/renderer/components/layout/EmojiSplash.tsx b/src/renderer/components/layout/EmojiSplash.tsx new file mode 100644 index 000000000..84a301f3d --- /dev/null +++ b/src/renderer/components/layout/EmojiSplash.tsx @@ -0,0 +1,42 @@ +import { Box, Stack } from '@primer/react'; +import type { FC } from 'react'; +import { EmojiText } from '../primitives/EmojiText'; +import { Centered } from './Centered'; + +interface IEmojiSplash { + emoji: string; + heading: string; + subHeadings?: string[]; + fullHeight?: boolean; +} + +export const EmojiSplash: FC = ({ + fullHeight = true, + subHeadings = [], + ...props +}: IEmojiSplash) => { + return ( + + + + + {props.heading} + + + {subHeadings.map((description, i) => { + return ( + // biome-ignore lint/suspicious/noArrayIndexKey: using index for key to keep the error constants clean + + {description} + + ); + })} + + + ); +}; diff --git a/src/renderer/components/primitives/Page.test.tsx b/src/renderer/components/layout/Page.test.tsx similarity index 79% rename from src/renderer/components/primitives/Page.test.tsx rename to src/renderer/components/layout/Page.test.tsx index 4d677d2ae..bf51c7ec6 100644 --- a/src/renderer/components/primitives/Page.test.tsx +++ b/src/renderer/components/layout/Page.test.tsx @@ -1,7 +1,7 @@ import { render } from '@testing-library/react'; import { Page } from './Page'; -describe('renderer/components/primitives/Page.tsx', () => { +describe('renderer/components/layout/Page.tsx', () => { it('should render itself & its children', () => { const tree = render(Test); diff --git a/src/renderer/components/primitives/Page.tsx b/src/renderer/components/layout/Page.tsx similarity index 76% rename from src/renderer/components/primitives/Page.tsx rename to src/renderer/components/layout/Page.tsx index 2f05ba501..a3c3242c8 100644 --- a/src/renderer/components/primitives/Page.tsx +++ b/src/renderer/components/layout/Page.tsx @@ -7,7 +7,7 @@ interface IPage { export const Page: FC = (props: IPage) => { return ( -
+
{props.children}
); diff --git a/src/renderer/components/layout/__snapshots__/Centered.test.tsx.snap b/src/renderer/components/layout/__snapshots__/Centered.test.tsx.snap new file mode 100644 index 000000000..086c8d2eb --- /dev/null +++ b/src/renderer/components/layout/__snapshots__/Centered.test.tsx.snap @@ -0,0 +1,167 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renderer/components/layout/Centered.tsx should render itself & its children - full height false 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+ Test +
+
+ , + "container":
+
+ Test +
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/layout/Centered.tsx should render itself & its children - full height true 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+ Test +
+
+ , + "container":
+
+ Test +
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; diff --git a/src/renderer/components/primitives/__snapshots__/Contents.test.tsx.snap b/src/renderer/components/layout/__snapshots__/Contents.test.tsx.snap similarity index 95% rename from src/renderer/components/primitives/__snapshots__/Contents.test.tsx.snap rename to src/renderer/components/layout/__snapshots__/Contents.test.tsx.snap index 5a12ae7a7..1564ecae4 100644 --- a/src/renderer/components/primitives/__snapshots__/Contents.test.tsx.snap +++ b/src/renderer/components/layout/__snapshots__/Contents.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renderer/components/primitives/Contents.tsx should render itself & its children 1`] = ` +exports[`renderer/components/layout/Contents.tsx should render itself & its children 1`] = ` { "asFragment": [Function], "baseElement": diff --git a/src/renderer/components/layout/__snapshots__/EmojiSplash.test.tsx.snap b/src/renderer/components/layout/__snapshots__/EmojiSplash.test.tsx.snap new file mode 100644 index 000000000..11ad0abcb --- /dev/null +++ b/src/renderer/components/layout/__snapshots__/EmojiSplash.test.tsx.snap @@ -0,0 +1,313 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renderer/components/layout/EmojiSplash.tsx should render itself & its children - heading and sub-heading 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+
+
+
+ 🍺 +
+
+ Test Heading +
+
+
+ Test Sub-Heading +
+
+
+
+ , + "container":
+
+
+
+
+ 🍺 +
+
+ Test Heading +
+
+
+ Test Sub-Heading +
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/layout/EmojiSplash.tsx should render itself & its children - heading only 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+
+
+
+ 🍺 +
+
+ Test Heading +
+
+
+
+
+ , + "container":
+
+
+
+
+ 🍺 +
+
+ Test Heading +
+
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; diff --git a/src/renderer/components/primitives/__snapshots__/Page.test.tsx.snap b/src/renderer/components/layout/__snapshots__/Page.test.tsx.snap similarity index 92% rename from src/renderer/components/primitives/__snapshots__/Page.test.tsx.snap rename to src/renderer/components/layout/__snapshots__/Page.test.tsx.snap index 219784848..a6b90a012 100644 --- a/src/renderer/components/primitives/__snapshots__/Page.test.tsx.snap +++ b/src/renderer/components/layout/__snapshots__/Page.test.tsx.snap @@ -1,12 +1,12 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renderer/components/primitives/Page.tsx should render itself & its children 1`] = ` +exports[`renderer/components/layout/Page.tsx should render itself & its children 1`] = ` { "asFragment": [Function], "baseElement":
Test @@ -15,7 +15,7 @@ exports[`renderer/components/primitives/Page.tsx should render itself & its chil , "container":
Test diff --git a/src/renderer/components/notifications/Pills.test.tsx b/src/renderer/components/metrics/MetricGroup.test.tsx similarity index 91% rename from src/renderer/components/notifications/Pills.test.tsx rename to src/renderer/components/metrics/MetricGroup.test.tsx index 38f1d5f54..6be4727f6 100644 --- a/src/renderer/components/notifications/Pills.test.tsx +++ b/src/renderer/components/metrics/MetricGroup.test.tsx @@ -3,9 +3,9 @@ import { mockSettings } from '../../__mocks__/state-mocks'; import { AppContext } from '../../context/App'; import type { Milestone } from '../../typesGitHub'; import { mockSingleNotification } from '../../utils/api/__mocks__/response-mocks'; -import { Pills } from './Pills'; +import { MetricGroup } from './MetricGroup'; -describe('renderer/components/notifications/Pills.tsx', () => { +describe('renderer/components/metrics/MetricGroup.tsx', () => { describe('showPills disabled', () => { it('should not render any pills when showPills is disabled', async () => { const mockNotification = mockSingleNotification; @@ -20,7 +20,7 @@ describe('renderer/components/notifications/Pills.tsx', () => { settings: { ...mockSettings, showPills: false }, }} > - + , ); expect(tree).toMatchSnapshot(); @@ -42,7 +42,7 @@ describe('renderer/components/notifications/Pills.tsx', () => { settings: mockSettings, }} > - + , ); expect(tree).toMatchSnapshot(); @@ -62,7 +62,7 @@ describe('renderer/components/notifications/Pills.tsx', () => { settings: mockSettings, }} > - + , ); expect(tree).toMatchSnapshot(); @@ -84,7 +84,7 @@ describe('renderer/components/notifications/Pills.tsx', () => { settings: mockSettings, }} > - + , ); expect(tree).toMatchSnapshot(); @@ -104,7 +104,7 @@ describe('renderer/components/notifications/Pills.tsx', () => { settings: mockSettings, }} > - + , ); expect(tree).toMatchSnapshot(); @@ -124,7 +124,7 @@ describe('renderer/components/notifications/Pills.tsx', () => { settings: mockSettings, }} > - + , ); expect(tree).toMatchSnapshot(); @@ -146,7 +146,7 @@ describe('renderer/components/notifications/Pills.tsx', () => { settings: mockSettings, }} > - + , ); expect(tree).toMatchSnapshot(); @@ -171,7 +171,7 @@ describe('renderer/components/notifications/Pills.tsx', () => { settings: mockSettings, }} > - + , ); expect(tree).toMatchSnapshot(); @@ -194,7 +194,7 @@ describe('renderer/components/notifications/Pills.tsx', () => { settings: mockSettings, }} > - + , ); expect(tree).toMatchSnapshot(); diff --git a/src/renderer/components/notifications/Pills.tsx b/src/renderer/components/metrics/MetricGroup.tsx similarity index 87% rename from src/renderer/components/notifications/Pills.tsx rename to src/renderer/components/metrics/MetricGroup.tsx index 1cebe4750..f07b5ee4e 100644 --- a/src/renderer/components/notifications/Pills.tsx +++ b/src/renderer/components/metrics/MetricGroup.tsx @@ -6,18 +6,21 @@ import { MilestoneIcon, TagIcon, } from '@primer/octicons-react'; +import { Box } from '@primer/react'; import { AppContext } from '../../context/App'; import { IconColor } from '../../types'; import type { Notification } from '../../typesGitHub'; import { getPullRequestReviewIcon } from '../../utils/icons'; -import { PillButton } from '../buttons/PillButton'; +import { MetricPill } from './MetricPill'; -interface IPills { +interface IMetricGroup { notification: Notification; } -export const Pills: FC = ({ notification }: IPills) => { +export const MetricGroup: FC = ({ + notification, +}: IMetricGroup) => { const { settings } = useContext(AppContext); const commentsPillDescription = `${notification.subject.comments} ${ @@ -34,9 +37,9 @@ export const Pills: FC = ({ notification }: IPills) => { return ( settings.showPills && ( -
+ {notification.subject?.linkedIssues?.length > 0 && ( - = ({ notification }: IPills) => { } return ( - = ({ notification }: IPills) => { ); })} {notification.subject?.comments > 0 && ( - = ({ notification }: IPills) => { /> )} {notification.subject?.labels?.length > 0 && ( - = ({ notification }: IPills) => { /> )} {notification.subject.milestone && ( - = ({ notification }: IPills) => { } /> )} -
+ ) ); }; diff --git a/src/renderer/components/buttons/PillButton.test.tsx b/src/renderer/components/metrics/MetricPill.test.tsx similarity index 64% rename from src/renderer/components/buttons/PillButton.test.tsx rename to src/renderer/components/metrics/MetricPill.test.tsx index 9d446c4e4..ceed253bf 100644 --- a/src/renderer/components/buttons/PillButton.test.tsx +++ b/src/renderer/components/metrics/MetricPill.test.tsx @@ -1,27 +1,27 @@ import { MarkGithubIcon } from '@primer/octicons-react'; import { render } from '@testing-library/react'; import { IconColor } from '../../types'; -import { type IPillButton, PillButton } from './PillButton'; +import { type IMetricPill, MetricPill } from './MetricPill'; -describe('renderer/components/buttons/PillButton.tsx', () => { +describe('renderer/components/metrics/MetricPill.tsx', () => { it('should render with metric', () => { - const props: IPillButton = { + const props: IMetricPill = { title: 'Mock Pill', metric: 1, icon: MarkGithubIcon, color: IconColor.GREEN, }; - const tree = render(); + const tree = render(); expect(tree).toMatchSnapshot(); }); it('should render without metric', () => { - const props: IPillButton = { + const props: IMetricPill = { title: 'Mock Pill', icon: MarkGithubIcon, color: IconColor.GREEN, }; - const tree = render(); + const tree = render(); expect(tree).toMatchSnapshot(); }); }); diff --git a/src/renderer/components/metrics/MetricPill.tsx b/src/renderer/components/metrics/MetricPill.tsx new file mode 100644 index 000000000..9719565fb --- /dev/null +++ b/src/renderer/components/metrics/MetricPill.tsx @@ -0,0 +1,30 @@ +import type { FC } from 'react'; + +import type { Icon } from '@primer/octicons-react'; +import { Label, Stack, Text } from '@primer/react'; + +import { type IconColor, Size } from '../../types'; + +export interface IMetricPill { + key?: string; + title: string; + metric?: number; + icon: Icon; + color: IconColor; +} + +export const MetricPill: FC = (props: IMetricPill) => { + return ( + + ); +}; diff --git a/src/renderer/components/notifications/__snapshots__/Pills.test.tsx.snap b/src/renderer/components/metrics/__snapshots__/MetricGroup.test.tsx.snap similarity index 80% rename from src/renderer/components/notifications/__snapshots__/Pills.test.tsx.snap rename to src/renderer/components/metrics/__snapshots__/MetricGroup.test.tsx.snap index 96270965a..4b2a4cfc2 100644 --- a/src/renderer/components/notifications/__snapshots__/Pills.test.tsx.snap +++ b/src/renderer/components/metrics/__snapshots__/MetricGroup.test.tsx.snap @@ -1,30 +1,30 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renderer/components/notifications/Pills.tsx comment pills should render when 1 comment 1`] = ` +exports[`renderer/components/metrics/MetricGroup.tsx comment pills should render when 1 comment 1`] = ` { "asFragment": [Function], "baseElement":
- - - - +
, "container":
- - - - +
, "debug": [Function], @@ -373,31 +373,31 @@ exports[`renderer/components/notifications/Pills.tsx comment pills should render } `; -exports[`renderer/components/notifications/Pills.tsx comment pills should render when more than 1 comments 1`] = ` +exports[`renderer/components/metrics/MetricGroup.tsx comment pills should render when more than 1 comments 1`] = ` { "asFragment": [Function], "baseElement":
- - - - +
, "container":
- - - - +
, "debug": [Function], @@ -746,31 +746,31 @@ exports[`renderer/components/notifications/Pills.tsx comment pills should render } `; -exports[`renderer/components/notifications/Pills.tsx comment pills should render when no comments 1`] = ` +exports[`renderer/components/metrics/MetricGroup.tsx comment pills should render when no comments 1`] = ` { "asFragment": [Function], "baseElement":
- - - +
, "container":
- - - +
, "debug": [Function], @@ -1045,31 +1045,31 @@ exports[`renderer/components/notifications/Pills.tsx comment pills should render } `; -exports[`renderer/components/notifications/Pills.tsx label pills should render labels pill 1`] = ` +exports[`renderer/components/metrics/MetricGroup.tsx label pills should render labels pill 1`] = ` { "asFragment": [Function], "baseElement":
- - - - - +
, "container":
- - - - - +
, "debug": [Function], @@ -1494,31 +1494,31 @@ exports[`renderer/components/notifications/Pills.tsx label pills should render l } `; -exports[`renderer/components/notifications/Pills.tsx linked issue pills should render issues pill when linked to multiple issues/prs 1`] = ` +exports[`renderer/components/metrics/MetricGroup.tsx linked issue pills should render issues pill when linked to multiple issues/prs 1`] = ` { "asFragment": [Function], "baseElement":
- - - +
, "container":
- - - +
, "debug": [Function], @@ -1793,31 +1793,31 @@ exports[`renderer/components/notifications/Pills.tsx linked issue pills should r } `; -exports[`renderer/components/notifications/Pills.tsx linked issue pills should render issues pill when linked to one issue/pr 1`] = ` +exports[`renderer/components/metrics/MetricGroup.tsx linked issue pills should render issues pill when linked to one issue/pr 1`] = ` { "asFragment": [Function], "baseElement":
- - - +
, "container":
- - - +
, "debug": [Function], @@ -2092,31 +2092,31 @@ exports[`renderer/components/notifications/Pills.tsx linked issue pills should r } `; -exports[`renderer/components/notifications/Pills.tsx milestone pills should render closed milestone pill 1`] = ` +exports[`renderer/components/metrics/MetricGroup.tsx milestone pills should render closed milestone pill 1`] = ` { "asFragment": [Function], "baseElement":
- - - - - - +
, "container":
- - - - - - +
, "debug": [Function], @@ -2605,31 +2605,31 @@ exports[`renderer/components/notifications/Pills.tsx milestone pills should rend } `; -exports[`renderer/components/notifications/Pills.tsx milestone pills should render open milestone pill 1`] = ` +exports[`renderer/components/metrics/MetricGroup.tsx milestone pills should render open milestone pill 1`] = ` { "asFragment": [Function], "baseElement":
- - - - - - +
, "container":
- - - - - - +
, "debug": [Function], @@ -3118,7 +3118,7 @@ exports[`renderer/components/notifications/Pills.tsx milestone pills should rend } `; -exports[`renderer/components/notifications/Pills.tsx showPills disabled should not render any pills when showPills is disabled 1`] = ` +exports[`renderer/components/metrics/MetricGroup.tsx showPills disabled should not render any pills when showPills is disabled 1`] = ` { "asFragment": [Function], "baseElement": diff --git a/src/renderer/components/buttons/__snapshots__/PillButton.test.tsx.snap b/src/renderer/components/metrics/__snapshots__/MetricPill.test.tsx.snap similarity index 87% rename from src/renderer/components/buttons/__snapshots__/PillButton.test.tsx.snap rename to src/renderer/components/metrics/__snapshots__/MetricPill.test.tsx.snap index e95a61ca0..13b64963c 100644 --- a/src/renderer/components/buttons/__snapshots__/PillButton.test.tsx.snap +++ b/src/renderer/components/metrics/__snapshots__/MetricPill.test.tsx.snap @@ -1,27 +1,27 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renderer/components/buttons/PillButton.tsx should render with metric 1`] = ` +exports[`renderer/components/metrics/MetricPill.tsx should render with metric 1`] = ` { "asFragment": [Function], "baseElement":
- +
, "container":
- +
, "debug": [Function], "findAllByAltText": [Function], @@ -137,28 +137,28 @@ exports[`renderer/components/buttons/PillButton.tsx should render with metric 1` } `; -exports[`renderer/components/buttons/PillButton.tsx should render without metric 1`] = ` +exports[`renderer/components/metrics/MetricPill.tsx should render without metric 1`] = ` { "asFragment": [Function], "baseElement":
- +
, "container":
- +
, "debug": [Function], "findAllByAltText": [Function], diff --git a/src/renderer/components/notifications/AccountNotifications.tsx b/src/renderer/components/notifications/AccountNotifications.tsx index 900e63d64..c42452c66 100644 --- a/src/renderer/components/notifications/AccountNotifications.tsx +++ b/src/renderer/components/notifications/AccountNotifications.tsx @@ -70,10 +70,8 @@ export const AccountNotifications: FC = ( {showAccountHeader && (
@@ -136,8 +134,8 @@ export const AccountNotifications: FC = ( {showAccountNotifications && ( <> - {props.error && } - {!hasNotifications && !props.error && } + {props.error && } + {!hasNotifications && !props.error && } {isGroupByRepository ? Object.values(groupedNotifications).map((repoNotifications) => { const repoSlug = repoNotifications[0].repository.full_name; diff --git a/src/renderer/components/notifications/NotificationFooter.tsx b/src/renderer/components/notifications/NotificationFooter.tsx index ca44a26ee..cfe54ddbc 100644 --- a/src/renderer/components/notifications/NotificationFooter.tsx +++ b/src/renderer/components/notifications/NotificationFooter.tsx @@ -9,7 +9,7 @@ import { cn } from '../../utils/cn'; import { isNonHumanUser } from '../../utils/helpers'; import { openUserProfile } from '../../utils/links'; import { formatReason } from '../../utils/reason'; -import { Pills } from './Pills'; +import { MetricGroup } from '../metrics/MetricGroup'; interface INotificationFooter { notification: Notification; @@ -21,7 +21,13 @@ export const NotificationFooter: FC = ({ const reason = formatReason(notification.reason); return ( - + {notification.subject.user ? ( = ({ )} )} - - - {reason.title} - - - - - + + {reason.title} + + + + + ); }; diff --git a/src/renderer/components/notifications/NotificationRow.tsx b/src/renderer/components/notifications/NotificationRow.tsx index 123257ca8..1804947cd 100644 --- a/src/renderer/components/notifications/NotificationRow.tsx +++ b/src/renderer/components/notifications/NotificationRow.tsx @@ -88,7 +88,7 @@ export const NotificationRow: FC = ({
= ({ return ( <>
-
- - - - - - -
-
-
-
-
-
- - 🔥 - -
-
- Error title -
-
- Error description -
-
-
-
- , - "container":
-
- -
-
-
-
- - 🔥 - -
-
- Error title -
-
- Error description +
+
+ 🔥 +
+
+ Error title +
+
+
+ Error description +
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} + , + "container":
+ +
+
+
+
+ 🔥 +
+
+ Error title +
+
+
+ Error description +
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; exports[`renderer/components/notifications/AccountNotifications.tsx should render itself - group notifications by date 1`] = ` @@ -545,7 +565,7 @@ exports[`renderer/components/notifications/AccountNotifications.tsx should rende "baseElement":
-
- - - - + + + + + + +
+ + + +
- -
- - Updated - - - • - - - May 20, 2017 - -
-
+ Updated + + + • + + + May 20, 2017 + +
- - +
-
- - - - - - -
-
-
+ + + + + + + + +
+
- -
- - Authored - - - • - - - May 20, 2017 - -
-
-
-
-
-
-
- - - - - - -
-
-
-
- , - "container":
-
- -
+
+
+
@@ -1494,26 +1289,26 @@ exports[`renderer/components/notifications/AccountNotifications.tsx should rende aria-hidden="true" class="Tooltip__StyledTooltip-sc-e45c7z-0 eELanX" data-direction="s" - id=":r8:" + id=":ro:" popover="auto" > - My Issues + Mark as done @@ -1532,26 +1327,26 @@ exports[`renderer/components/notifications/AccountNotifications.tsx should rende aria-hidden="true" class="Tooltip__StyledTooltip-sc-e45c7z-0 eELanX" data-direction="s" - id=":ra:" + id=":rq:" popover="auto" > - My Pull Requests + Mark as read @@ -1570,16 +1365,217 @@ exports[`renderer/components/notifications/AccountNotifications.tsx should rende aria-hidden="true" class="Tooltip__StyledTooltip-sc-e45c7z-0 eELanX" data-direction="s" - id=":rc:" + id=":rs:" popover="auto" > - Hide account notifications + Unsubscribe from thread
+ , + "container":
+
- -
- - Updated - - - • - - - May 20, 2017 - -
-
+ Updated + + + • + + + May 20, 2017 + +
- - +
-
- - + - - + + + + + +
+ + + +
- -
- - Authored - - - • - - - May 20, 2017 - -
-
+ Authored + + + • + + + May 20, 2017 + +
-
- - - - + + + + + +
+ + + +
, @@ -2264,7 +2244,7 @@ exports[`renderer/components/notifications/AccountNotifications.tsx should rende "baseElement":
-
- - - - - - -
-
-
-
- Repository Notifications -
-
- , - "container":
-
- -
- - - @ - octocat - -
-
- - - -  ( - 2 - ) - - - - -
-
- - @@ -2674,6 +2442,210 @@ exports[`renderer/components/notifications/AccountNotifications.tsx should rende
+
+ Repository Notifications +
+
+ , + "container":
+
Repository Notifications @@ -2739,7 +2711,7 @@ exports[`renderer/components/notifications/AccountNotifications.tsx should rende "baseElement":
-
- - - - - - -
-
-
-
-
-
- - 🎊 - -
-
- No new notifications -
-
-
-
- , - "container":
-
- -
-
-
-
- - 🎊 - -
-
- No new notifications +
+
+ 🎊 +
+
+ No new notifications +
+
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/notifications/AccountNotifications.tsx should toggle account notifications visibility 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
, + "container":
+ - -
-
- - - - + + + +
+ + + + + + +
+
+
+
+
+
+ 🎊 +
+
+ No new notifications
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/notifications/AccountNotifications.tsx should toggle account notifications visibility 1`] = ` +{ + "asFragment": [Function], + "baseElement":
-
- - - - - - + + + + +
-
-
-
- Repository Notifications -
-
- , - "container":
-
-
+
+
+
+ + , + "container":
+
Repository Notifications diff --git a/src/renderer/components/notifications/__snapshots__/NotificationFooter.test.tsx.snap b/src/renderer/components/notifications/__snapshots__/NotificationFooter.test.tsx.snap index fa0890287..3fa98f9c9 100644 --- a/src/renderer/components/notifications/__snapshots__/NotificationFooter.test.tsx.snap +++ b/src/renderer/components/notifications/__snapshots__/NotificationFooter.test.tsx.snap @@ -6,7 +6,7 @@ exports[`renderer/components/notifications/NotificationFooter.tsx security alert "baseElement":
- -
- - Updated - - - • - - - May 20, 2017 - -
-
+ Updated + + + • + + + May 20, 2017 + +
- - +
, "container":
- -
- - Updated - - - • - - - May 20, 2017 - -
-
+ Updated + + + • + + + May 20, 2017 + +
- - +
, @@ -331,7 +323,7 @@ exports[`renderer/components/notifications/NotificationFooter.tsx security alert "baseElement":
- -
- - Updated - - - • - - - May 20, 2017 - -
-
+ Updated + + + • + + + May 20, 2017 + +
- - +
, "container":
- -
- - Updated - - - • - - - May 20, 2017 - -
-
+ Updated + + + • + + + May 20, 2017 + +
- - +
, @@ -656,7 +640,7 @@ exports[`renderer/components/notifications/NotificationFooter.tsx should default "baseElement":
- -
- - Updated - - - • - - - May 20, 2017 - -
-
+ Updated + + + • + + + May 20, 2017 + +
- - +
, "container":
- -
- - Updated - - - • - - - May 20, 2017 - -
-
+ Updated + + + • + + + May 20, 2017 + +
- - +
, @@ -989,7 +965,7 @@ exports[`renderer/components/notifications/NotificationFooter.tsx should render "baseElement":
- -
- - Updated - - - • - - - May 20, 2017 - -
-
+ Updated + + + • + + + May 20, 2017 + +
- - +
, "container":
- -
- - Updated - - - • - - - May 20, 2017 - -
-
+ Updated + + + • + + + May 20, 2017 + +
- - +
, @@ -1314,7 +1282,7 @@ exports[`renderer/components/notifications/NotificationFooter.tsx should render "baseElement":
- -
- - Updated - - - • - - - May 20, 2017 - -
-
+ Updated + + + • + + + May 20, 2017 + +
- - +
, "container":
- -
- - Updated - - - • - - - May 20, 2017 - -
-
+ Updated + + + • + + + May 20, 2017 + +
- - +
, diff --git a/src/renderer/components/notifications/__snapshots__/NotificationRow.test.tsx.snap b/src/renderer/components/notifications/__snapshots__/NotificationRow.test.tsx.snap index d1d271a78..f1e117afa 100644 --- a/src/renderer/components/notifications/__snapshots__/NotificationRow.test.tsx.snap +++ b/src/renderer/components/notifications/__snapshots__/NotificationRow.test.tsx.snap @@ -6,7 +6,7 @@ exports[`renderer/components/notifications/NotificationRow.tsx should render its "baseElement":
- -
- - Updated - - - • - - - May 20, 2017 - -
-
+ Updated + + + • + + + May 20, 2017 + +
- - +
-
- - - - + + + + + +
+ + + +
, "container":
- -
- - Updated - - - • - - - May 20, 2017 - -
-
+ Updated + + + • + + + May 20, 2017 + +
- - +
-
- - - - + + + + + +
+ + + +
, @@ -765,7 +749,7 @@ exports[`renderer/components/notifications/NotificationRow.tsx should render its "baseElement":
- -
- - Updated - - - • - - - May 20, 2017 - -
-
+ Updated + + + • + + + May 20, 2017 + +
- - +
-
- - - - + + + + + +
+ + + +
, "container":
- -
- - Updated - - - • - - - May 20, 2017 - -
-
+ Updated + + + • + + + May 20, 2017 + +
- - +
+ + + + + + +
+ + , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/notifications/NotificationRow.tsx should render itself & its children - hide numbers 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
- - - - - - -
-
-
- , - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/notifications/NotificationRow.tsx should render itself & its children - hide numbers 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
-
- -
- -
- - Updated - - - • - - - May 20, 2017 - -
-
+ Updated + + + • + + + May 20, 2017 + +
- - +
-
+ + + + + + - - - - - -
+ + + +
, "container":
- -
- - Updated - - - • - - - May 20, 2017 - -
-
+ Updated + + + • + + + May 20, 2017 + +
- - +
-
- - - - + + + + + +
+ + + +
, diff --git a/src/renderer/components/notifications/__snapshots__/RepositoryNotifications.test.tsx.snap b/src/renderer/components/notifications/__snapshots__/RepositoryNotifications.test.tsx.snap index e2af1194d..ab5b1a320 100644 --- a/src/renderer/components/notifications/__snapshots__/RepositoryNotifications.test.tsx.snap +++ b/src/renderer/components/notifications/__snapshots__/RepositoryNotifications.test.tsx.snap @@ -6,7 +6,7 @@ exports[`renderer/components/notifications/RepositoryNotifications.tsx should re "baseElement":
-
- - - - - - -
-
-
-
- NotificationRow -
-
- NotificationRow -
-
- , - "container":
-
-
- -
-
-
+
+ NotificationRow +
+
+ NotificationRow +
+
+ , + "container":
+
+
+ +
+
+ + + + + + +
NotificationRow @@ -479,7 +471,7 @@ exports[`renderer/components/notifications/RepositoryNotifications.tsx should to "baseElement":
-
- - - - + + + + + +
+ + + +
-
- - - - - - -
-
-
-
- NotificationRow -
-
- NotificationRow -
-
- , - "container":
-
-
- -
-
-
+
+
+
+ NotificationRow +
+
+ NotificationRow +
+
+ , + "container":
+
+
+ +
+
+ + +
+ + + + + +
@@ -1150,7 +1130,7 @@ exports[`renderer/components/notifications/RepositoryNotifications.tsx should us "baseElement":
-
- - - - - - -
-
-
-
- NotificationRow -
-
- NotificationRow -
-
- , - "container":
-
-
- -
-
-
+
+ NotificationRow +
+
+ NotificationRow +
+
+ , + "container":
+
+
+ +
+
+ + + + + + +
NotificationRow diff --git a/src/renderer/components/primitives/Centered.test.tsx b/src/renderer/components/primitives/Centered.test.tsx deleted file mode 100644 index 58a7b92e7..000000000 --- a/src/renderer/components/primitives/Centered.test.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { render } from '@testing-library/react'; -import { Centered } from './Centered'; - -describe('renderer/components/primitives/Centered.tsx', () => { - it('should render itself & its children', () => { - const tree = render(Test); - - expect(tree).toMatchSnapshot(); - }); -}); diff --git a/src/renderer/components/primitives/Centered.tsx b/src/renderer/components/primitives/Centered.tsx deleted file mode 100644 index 8334e1c8e..000000000 --- a/src/renderer/components/primitives/Centered.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import type { FC, ReactNode } from 'react'; - -interface ICentered { - children: ReactNode; -} - -export const Centered: FC = (props: ICentered) => { - return ( -
- {props.children} -
- ); -}; diff --git a/src/renderer/components/primitives/EmojiText.tsx b/src/renderer/components/primitives/EmojiText.tsx index ef076212c..35c4521d6 100644 --- a/src/renderer/components/primitives/EmojiText.tsx +++ b/src/renderer/components/primitives/EmojiText.tsx @@ -1,5 +1,6 @@ import { type FC, useEffect, useRef } from 'react'; +import { Box } from '@primer/react'; import { convertTextToEmojiImgHtml } from '../../utils/emojis'; export interface IEmojiText { @@ -15,5 +16,5 @@ export const EmojiText: FC = ({ text }) => { } }, [text]); - return ; + return ; }; diff --git a/src/renderer/components/primitives/Footer.test.tsx b/src/renderer/components/primitives/Footer.test.tsx index e29c11075..77e713abd 100644 --- a/src/renderer/components/primitives/Footer.test.tsx +++ b/src/renderer/components/primitives/Footer.test.tsx @@ -2,14 +2,14 @@ import { render } from '@testing-library/react'; import { Footer } from './Footer'; describe('renderer/components/primitives/Footer.tsx', () => { - it('should render itself & its children - justify-between', () => { - const tree = render(
Test
); + it('should render itself & its children - space-between', () => { + const tree = render(
Test
); expect(tree).toMatchSnapshot(); }); - it('should render itself & its children - justify-end', () => { - const tree = render(
Test
); + it('should render itself & its children - end', () => { + const tree = render(
Test
); expect(tree).toMatchSnapshot(); }); diff --git a/src/renderer/components/primitives/Footer.tsx b/src/renderer/components/primitives/Footer.tsx index 0fa49c93c..c1d2d637b 100644 --- a/src/renderer/components/primitives/Footer.tsx +++ b/src/renderer/components/primitives/Footer.tsx @@ -1,20 +1,20 @@ +import { Stack } from '@primer/react'; import type { FC, ReactNode } from 'react'; -import { cn } from '../../utils/cn'; interface IFooter { children: ReactNode; - justify: 'justify-end' | 'justify-between'; + justify: 'end' | 'space-between'; } export const Footer: FC = (props: IFooter) => { return ( -
{props.children} -
+ ); }; diff --git a/src/renderer/components/primitives/Header.tsx b/src/renderer/components/primitives/Header.tsx index 8152d5ab3..189474a11 100644 --- a/src/renderer/components/primitives/Header.tsx +++ b/src/renderer/components/primitives/Header.tsx @@ -2,10 +2,10 @@ import { type FC, useContext } from 'react'; import { useNavigate } from 'react-router-dom'; import { ArrowLeftIcon, type Icon } from '@primer/octicons-react'; -import { Heading, IconButton, Stack } from '@primer/react'; +import { IconButton, Stack } from '@primer/react'; import { AppContext } from '../../context/App'; -import { Size } from '../../types'; +import { Title } from './Title'; interface IHeader { icon: Icon; @@ -19,27 +19,24 @@ export const Header: FC = (props: IHeader) => { const { fetchNotifications } = useContext(AppContext); return ( -
- - { - navigate(-1); - if (props.fetchOnBack) { - fetchNotifications(); - } - }} - data-testid="header-nav-back" - /> + + { + navigate(-1); + if (props.fetchOnBack) { + fetchNotifications(); + } + }} + data-testid="header-nav-back" + /> - - - {props.children} - - -
+ + {props.children} + + ); }; diff --git a/src/renderer/components/primitives/HoverGroup.tsx b/src/renderer/components/primitives/HoverGroup.tsx index 01df53990..a924d6dff 100644 --- a/src/renderer/components/primitives/HoverGroup.tsx +++ b/src/renderer/components/primitives/HoverGroup.tsx @@ -8,10 +8,13 @@ interface IHoverGroup { export const HoverGroup: FC = ({ children }: IHoverGroup) => { return ( -
- - {children} - -
+ + {children} + ); }; diff --git a/src/renderer/components/primitives/Legend.test.tsx b/src/renderer/components/primitives/Legend.test.tsx deleted file mode 100644 index 4a154d36a..000000000 --- a/src/renderer/components/primitives/Legend.test.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { PersonFillIcon } from '@primer/octicons-react'; -import { render } from '@testing-library/react'; -import { Legend } from './Legend'; - -describe('renderer/routes/components/primitives/Legend.tsx', () => { - it('should render the legend', async () => { - const { container } = render(Legend); - - expect(container).toMatchSnapshot(); - }); -}); diff --git a/src/renderer/components/primitives/Legend.tsx b/src/renderer/components/primitives/Legend.tsx deleted file mode 100644 index 788b4f88b..000000000 --- a/src/renderer/components/primitives/Legend.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import type { FC } from 'react'; - -import type { Icon } from '@primer/octicons-react'; - -interface ILegend { - icon: Icon; - children: string; -} - -export const Legend: FC = (props) => { - return ( - - - {props.children} - - ); -}; diff --git a/src/renderer/components/primitives/Title.test.tsx b/src/renderer/components/primitives/Title.test.tsx new file mode 100644 index 000000000..e20d60fd5 --- /dev/null +++ b/src/renderer/components/primitives/Title.test.tsx @@ -0,0 +1,21 @@ +import { PersonFillIcon } from '@primer/octicons-react'; +import { render } from '@testing-library/react'; +import { Title } from './Title'; + +describe('renderer/routes/components/primitives/Title.tsx', () => { + it('should render the title - default size', async () => { + const { container } = render(Legend); + + expect(container).toMatchSnapshot(); + }); + + it('should render the title - specific size', async () => { + const { container } = render( + + Legend + , + ); + + expect(container).toMatchSnapshot(); + }); +}); diff --git a/src/renderer/components/primitives/Title.tsx b/src/renderer/components/primitives/Title.tsx new file mode 100644 index 000000000..953ef596f --- /dev/null +++ b/src/renderer/components/primitives/Title.tsx @@ -0,0 +1,26 @@ +import type { FC } from 'react'; + +import type { Icon } from '@primer/octicons-react'; +import { Heading, Stack } from '@primer/react'; + +interface ITitle { + icon: Icon; + children: string; + size?: number; +} + +export const Title: FC = ({ size = 2, ...props }) => { + return ( + + + + {props.children} + + + ); +}; diff --git a/src/renderer/components/primitives/__snapshots__/Centered.test.tsx.snap b/src/renderer/components/primitives/__snapshots__/Centered.test.tsx.snap deleted file mode 100644 index 3657c201e..000000000 --- a/src/renderer/components/primitives/__snapshots__/Centered.test.tsx.snap +++ /dev/null @@ -1,74 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`renderer/components/primitives/Centered.tsx should render itself & its children 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
- Test -
-
- , - "container":
-
- Test -
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; diff --git a/src/renderer/components/primitives/__snapshots__/EmojiText.test.tsx.snap b/src/renderer/components/primitives/__snapshots__/EmojiText.test.tsx.snap index a890b34c8..697cea39a 100644 --- a/src/renderer/components/primitives/__snapshots__/EmojiText.test.tsx.snap +++ b/src/renderer/components/primitives/__snapshots__/EmojiText.test.tsx.snap @@ -5,25 +5,29 @@ exports[`renderer/components/primitives/Emoji.tsx should render 1`] = ` "asFragment": [Function], "baseElement":
- +
🍺 - +
, "container":
- +
🍺 - +
, "debug": [Function], "findAllByAltText": [Function], diff --git a/src/renderer/components/primitives/__snapshots__/Footer.test.tsx.snap b/src/renderer/components/primitives/__snapshots__/Footer.test.tsx.snap index 1eeb9a1e6..10e487af2 100644 --- a/src/renderer/components/primitives/__snapshots__/Footer.test.tsx.snap +++ b/src/renderer/components/primitives/__snapshots__/Footer.test.tsx.snap @@ -1,12 +1,17 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renderer/components/primitives/Footer.tsx should render itself & its children - justify-between 1`] = ` +exports[`renderer/components/primitives/Footer.tsx should render itself & its children - end 1`] = ` { "asFragment": [Function], "baseElement":
@@ -14,7 +19,12 @@ exports[`renderer/components/primitives/Footer.tsx should render itself & its ch , "container":
@@ -73,13 +83,18 @@ exports[`renderer/components/primitives/Footer.tsx should render itself & its ch } `; -exports[`renderer/components/primitives/Footer.tsx should render itself & its children - justify-end 1`] = ` +exports[`renderer/components/primitives/Footer.tsx should render itself & its children - space-between 1`] = ` { "asFragment": [Function], "baseElement":
@@ -87,7 +102,12 @@ exports[`renderer/components/primitives/Footer.tsx should render itself & its ch , "container":
diff --git a/src/renderer/components/primitives/__snapshots__/Header.test.tsx.snap b/src/renderer/components/primitives/__snapshots__/Header.test.tsx.snap index ee5404191..7c4323457 100644 --- a/src/renderer/components/primitives/__snapshots__/Header.test.tsx.snap +++ b/src/renderer/components/primitives/__snapshots__/Header.test.tsx.snap @@ -6,44 +6,42 @@ exports[`renderer/components/primitives/Header.tsx should render itself & its ch "baseElement":
-
- + + + +
-
+
, "container":
-
- + + + +
-
+
, "debug": [Function], diff --git a/src/renderer/components/primitives/__snapshots__/HoverGroup.test.tsx.snap b/src/renderer/components/primitives/__snapshots__/HoverGroup.test.tsx.snap index 6922656ac..896caa0d2 100644 --- a/src/renderer/components/primitives/__snapshots__/HoverGroup.test.tsx.snap +++ b/src/renderer/components/primitives/__snapshots__/HoverGroup.test.tsx.snap @@ -6,28 +6,7 @@ exports[`renderer/components/primitives/HoverGroup.tsx should render 1`] = ` "baseElement":
-
- Hover Group -
-
-
- , - "container":
-
-
+ , + "container":
+
+ Hover Group +
, "debug": [Function], "findAllByAltText": [Function], diff --git a/src/renderer/components/primitives/__snapshots__/Legend.test.tsx.snap b/src/renderer/components/primitives/__snapshots__/Legend.test.tsx.snap deleted file mode 100644 index f388669f3..000000000 --- a/src/renderer/components/primitives/__snapshots__/Legend.test.tsx.snap +++ /dev/null @@ -1,28 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`renderer/routes/components/primitives/Legend.tsx should render the legend 1`] = ` -
- - - Legend - -
-`; diff --git a/src/renderer/components/primitives/__snapshots__/Title.test.tsx.snap b/src/renderer/components/primitives/__snapshots__/Title.test.tsx.snap new file mode 100644 index 000000000..c0c5afa98 --- /dev/null +++ b/src/renderer/components/primitives/__snapshots__/Title.test.tsx.snap @@ -0,0 +1,81 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renderer/routes/components/primitives/Title.tsx should render the title - default size 1`] = ` +
+ +
+ +

+ Legend +

+
+
+
+`; + +exports[`renderer/routes/components/primitives/Title.tsx should render the title - specific size 1`] = ` +
+ +
+ +

+ Legend +

+
+
+
+`; diff --git a/src/renderer/components/settings/AppearanceSettings.tsx b/src/renderer/components/settings/AppearanceSettings.tsx index f8a103824..c64aa37e7 100644 --- a/src/renderer/components/settings/AppearanceSettings.tsx +++ b/src/renderer/components/settings/AppearanceSettings.tsx @@ -23,7 +23,7 @@ import { getColorModeFromTheme, setTheme } from '../../utils/theme'; import { zoomLevelToPercentage, zoomPercentageToLevel } from '../../utils/zoom'; import { Checkbox } from '../fields/Checkbox'; import { RadioGroup } from '../fields/RadioGroup'; -import { Legend } from '../primitives/Legend'; +import { Title } from '../primitives/Title'; let timeout: NodeJS.Timeout; const DELAY = 200; @@ -62,7 +62,7 @@ export const AppearanceSettings: FC = () => { return (
- Appearance + Appearance { const { settings, updateSetting } = useContext(AppContext); return (
- Notifications + Notifications { }, []); return ( -
+
- on GitHub then paste your + + + + + + on GitHub then paste your + + + client id and client secret below. + - - client id and client secret below. - - - } - /> - - - - - - - - - - - - - - - + } + /> + + + + + + + + + + + + + + + + ); }; diff --git a/src/renderer/routes/LoginWithPersonalAccessToken.tsx b/src/renderer/routes/LoginWithPersonalAccessToken.tsx index af8f0bd7e..6a7a8ac9e 100644 --- a/src/renderer/routes/LoginWithPersonalAccessToken.tsx +++ b/src/renderer/routes/LoginWithPersonalAccessToken.tsx @@ -7,6 +7,7 @@ import { Button, Stack, Text, Tooltip } from '@primer/react'; import { logError } from '../../shared/logger'; import { FieldInput } from '../components/fields/FieldInput'; +import { Page } from '../components/layout/Page'; import { Header } from '../components/primitives/Header'; import { AppContext } from '../context/App'; import type { Hostname, Token } from '../types'; @@ -56,71 +57,73 @@ export const LoginWithPersonalAccessTokenRoute: FC = () => { const { handleSubmit, submitting, pristine, values } = formProps; return ( -
- - - Change only if you are using GitHub Enterprise Server. - - - - on GitHub then paste your token below. + + + + + Change only if you are using GitHub Enterprise Server. + + + + on GitHub then paste your token below. + + + The required scopes will be automatically selected for you. + - - The required scopes will be automatically selected for you. - - - } - /> - - {!isValidToken && ( -
- This token could not be validated with {values.hostname}. -
- )} - - - - + } + /> + + {!isValidToken && ( +
+ This token could not be validated with {values.hostname}. +
+ )} + + + + - - - - - + + + +
+ + ); }; diff --git a/src/renderer/routes/Settings.tsx b/src/renderer/routes/Settings.tsx index ec75d7635..d88485f03 100644 --- a/src/renderer/routes/Settings.tsx +++ b/src/renderer/routes/Settings.tsx @@ -4,9 +4,9 @@ import { GearIcon } from '@primer/octicons-react'; import { Button, Stack } from '@primer/react'; import { Dialog } from '@primer/react/experimental'; -import { Contents } from '../components/primitives/Contents'; +import { Contents } from '../components/layout/Contents'; +import { Page } from '../components/layout/Page'; import { Header } from '../components/primitives/Header'; -import { Page } from '../components/primitives/Page'; import { AppearanceSettings } from '../components/settings/AppearanceSettings'; import { NotificationSettings } from '../components/settings/NotificationSettings'; import { SettingsFooter } from '../components/settings/SettingsFooter'; @@ -34,7 +34,8 @@ export const SettingsRoute: FC = () => { - + + + + + +
-
+
-
- + + + +
-
+
-
- + + + +
-
+
-
- + + + +
-
+
- -
- - - Users + +

+ Users +

+
- -
- - - Reason + +

+ Reason +

+