Skip to content

Commit 8da0785

Browse files
committed
refactor: layout components
Signed-off-by: Adam Setch <[email protected]>
1 parent 0124da3 commit 8da0785

13 files changed

+35
-24
lines changed

src/renderer/components/layout/AppLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface IAppLayout {
1313
*/
1414
export const AppLayout: FC<IAppLayout> = ({ children }) => {
1515
return (
16-
<Box className="flex flex-col max-h-screen bg-gitify-background">
16+
<Box className="flex flex-col min-h-screen bg-gitify-background">
1717
<Sidebar />
1818
{/* Content area with left padding to make space for the sidebar */}
1919
<Box className="flex-1 pl-sidebar">{children}</Box>

src/renderer/components/layout/Contents.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,27 @@ import { cn } from '../../utils/cn';
44

55
interface IContents {
66
children: ReactNode;
7-
padding?: boolean;
7+
paddingHorizontal?: boolean;
8+
paddingBottom?: boolean;
89
}
910

1011
/**
1112
* Contents component holds the main content of a page.
1213
* It provides proper padding and handles scrolling.
1314
*/
14-
export const Contents: FC<IContents> = ({ children, padding = true }) => {
15+
export const Contents: FC<IContents> = ({
16+
children,
17+
paddingHorizontal = true,
18+
paddingBottom = false,
19+
}) => {
1520
return (
16-
<Box className={cn('grow overflow-y-auto mb-4', padding && 'px-8')}>
21+
<Box
22+
className={cn(
23+
'grow overflow-x-hidden overflow-y-auto',
24+
paddingHorizontal && 'px-8',
25+
paddingBottom && 'pb-4',
26+
)}
27+
>
1728
{children}
1829
</Box>
1930
);

src/renderer/components/layout/__snapshots__/AppLayout.test.tsx.snap

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

src/renderer/components/layout/__snapshots__/Contents.test.tsx.snap

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

src/renderer/routes/Filters.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const FiltersRoute: FC = () => {
2323
Filters
2424
</Header>
2525

26-
<Contents>
26+
<Contents paddingBottom>
2727
<Stack direction="vertical" gap="spacious">
2828
<UserTypeFilter />
2929
<UserHandleFilter />

src/renderer/routes/Notifications.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const NotificationsRoute: FC = () => {
3838

3939
return (
4040
<Page id="notifications">
41-
<Contents padding={false}>
41+
<Contents paddingHorizontal={false}>
4242
{notifications.map((accountNotifications) => (
4343
<AccountNotifications
4444
key={getAccountUUID(accountNotifications.account)}

src/renderer/routes/Settings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const SettingsRoute: FC = () => {
1919
Settings
2020
</Header>
2121

22-
<Contents>
22+
<Contents paddingBottom>
2323
<Stack direction="vertical" gap="spacious">
2424
<AppearanceSettings />
2525
<NotificationSettings />

src/renderer/routes/__snapshots__/Accounts.test.tsx.snap

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

src/renderer/routes/__snapshots__/Filters.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/routes/__snapshots__/LoginWithOAuthApp.test.tsx.snap

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

0 commit comments

Comments
 (0)