Skip to content

Commit 7541769

Browse files
authored
refactor: layout components (#1868)
* refactor: layout components Signed-off-by: Adam Setch <adam.setch@outlook.com> * refactor: layout components Signed-off-by: Adam Setch <adam.setch@outlook.com> * refactor: layout components Signed-off-by: Adam Setch <adam.setch@outlook.com> * refactor: layout components Signed-off-by: Adam Setch <adam.setch@outlook.com> * refactor: layout components Signed-off-by: Adam Setch <adam.setch@outlook.com> * refactor: layout components Signed-off-by: Adam Setch <adam.setch@outlook.com> * refactor: layout components Signed-off-by: Adam Setch <adam.setch@outlook.com> --------- Signed-off-by: Adam Setch <adam.setch@outlook.com>
1 parent 3717f40 commit 7541769

35 files changed

+1741
-378
lines changed

src/renderer/App.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import {
77
useLocation,
88
} from 'react-router-dom';
99

10-
import { BaseStyles, Box, ThemeProvider } from '@primer/react';
10+
import { BaseStyles, ThemeProvider } from '@primer/react';
1111

12-
import { Sidebar } from './components/Sidebar';
12+
import { AppLayout } from './components/layout/AppLayout';
1313
import { AppContext, AppProvider } from './context/App';
1414
import { AccountsRoute } from './routes/Accounts';
1515
import { FiltersRoute } from './routes/Filters';
@@ -38,8 +38,7 @@ export const App = () => {
3838
<BaseStyles>
3939
<AppProvider>
4040
<Router>
41-
<Box className="flex flex-col min-h-screen overflow-x-hidden overflow-y-auto pl-sidebar bg-gitify-background">
42-
<Sidebar />
41+
<AppLayout>
4342
<Routes>
4443
<Route
4544
path="/"
@@ -83,7 +82,7 @@ export const App = () => {
8382
element={<LoginWithOAuthAppRoute />}
8483
/>
8584
</Routes>
86-
</Box>
85+
</AppLayout>
8786
</Router>
8887
</AppProvider>
8988
</BaseStyles>

src/renderer/components/fields/Checkbox.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { Stack } from '@primer/react';
12
import type { FC, ReactNode } from 'react';
23

3-
import { CounterLabel, Stack } from '@primer/react';
4-
54
import { cn } from '../../utils/cn';
5+
import { CustomCounter } from '../primitives/CustomCounter';
66
import { Tooltip } from './Tooltip';
77

88
export interface ICheckbox {
@@ -20,7 +20,7 @@ export const Checkbox: FC<ICheckbox> = ({
2020
visible = true,
2121
...props
2222
}: ICheckbox) => {
23-
const counter = props.counter > 0 ? props.counter : undefined;
23+
const counter = props?.counter === 0 ? '0' : props.counter;
2424

2525
return (
2626
visible && (
@@ -54,11 +54,12 @@ export const Checkbox: FC<ICheckbox> = ({
5454
<Tooltip name={`tooltip-${props.name}`} tooltip={props.tooltip} />
5555
)}
5656

57-
{counter ? (
58-
<CounterLabel scheme={props.checked ? 'primary' : 'secondary'}>
59-
{counter}
60-
</CounterLabel>
61-
) : null}
57+
{counter && (
58+
<CustomCounter
59+
scheme={props.checked ? 'primary' : 'secondary'}
60+
value={counter}
61+
/>
62+
)}
6263
</Stack>
6364
)
6465
);

src/renderer/components/fields/__snapshots__/Checkbox.test.tsx.snap

Lines changed: 14 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/components/filters/ReasonFilter.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ export const ReasonFilter: FC = () => {
1717
const { updateFilter, settings, notifications } = useContext(AppContext);
1818

1919
return (
20-
<fieldset id="filter-reasons" className="mb-3">
20+
<fieldset id="filter-reasons">
2121
<Title icon={NoteIcon}>Reason</Title>
22+
2223
<Stack direction="vertical" gap="condensed">
2324
{Object.keys(FORMATTED_REASONS).map((reason: Reason) => {
2425
const reasonDetails = getReasonDetails(reason);

src/renderer/components/filters/StateFilter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export const StateFilter: FC = () => {
1919
const { updateFilter, settings, notifications } = useContext(AppContext);
2020

2121
return (
22-
<fieldset id="filter-state" className="mb-3">
23-
<Stack direction="horizontal" gap="condensed" align="baseline">
22+
<fieldset id="filter-state">
23+
<Stack direction="horizontal" gap="condensed">
2424
<Title icon={IssueOpenedIcon}>State</Title>
2525
<Tooltip
2626
name="tooltip-filter-state"

src/renderer/components/filters/SubjectTypeFilter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const SubjectTypeFilter: FC = () => {
1919
const { updateFilter, settings, notifications } = useContext(AppContext);
2020

2121
return (
22-
<fieldset id="filter-subject-type" className="mb-3">
22+
<fieldset id="filter-subject-type">
2323
<Stack direction="horizontal" gap="condensed" align="baseline">
2424
<Title icon={BellIcon}>Type</Title>
2525
<Tooltip

src/renderer/components/filters/UserHandleFilter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export const UserHandleFilter: FC = () => {
119119
};
120120

121121
return (
122-
<fieldset id="filter-user-handles" className="mb-3">
122+
<fieldset id="filter-user-handles">
123123
<Stack direction="horizontal" gap="condensed" align="baseline">
124124
<Title icon={MentionIcon}>Handles</Title>
125125
<Tooltip

src/renderer/components/filters/UserTypeFilter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export const UserTypeFilter: FC = () => {
2525
const { updateFilter, settings, notifications } = useContext(AppContext);
2626

2727
return (
28-
<fieldset id="filter-user-types" className="mb-3">
29-
<Stack direction="horizontal" gap="condensed" align="baseline">
28+
<fieldset id="filter-user-types">
29+
<Stack direction="horizontal" gap="condensed">
3030
<Title icon={FeedPersonIcon}>User Type</Title>
3131
<Tooltip
3232
name="tooltip-filter-user-type"

0 commit comments

Comments
 (0)