Skip to content

Commit 1aa1cfa

Browse files
committed
fix: page layouts
Signed-off-by: Adam Setch <[email protected]>
1 parent d46e4f3 commit 1aa1cfa

18 files changed

+3014
-2921
lines changed

src/renderer/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const App = () => {
4747
<BaseStyles>
4848
<AppProvider>
4949
<Router>
50-
<div className="flex h-screen overflow-x-hidden overflow-y-auto flex-col pl-10 bg-gitify-background">
50+
<div className="flex flex-col min-h-screen overflow-x-hidden overflow-y-auto pl-10 bg-gitify-background">
5151
<Loading />
5252
<Sidebar />
5353
<Routes>

src/renderer/components/__snapshots__/AllRead.test.tsx.snap

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/components/__snapshots__/Oops.test.tsx.snap

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/components/layout/Centered.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const Centered: FC<ICentered> = ({
1616
align="center"
1717
justify="center"
1818
padding="spacious"
19-
className={fullHeight && 'h-full'}
19+
className={fullHeight && 'h-screen'}
2020
>
2121
{props.children}
2222
</Stack>

src/renderer/components/layout/Page.test.tsx

+16-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,22 @@ import { render } from '@testing-library/react';
22
import { Page } from './Page';
33

44
describe('renderer/components/layout/Page.tsx', () => {
5-
it('should render itself & its children', () => {
6-
const tree = render(<Page id="test">Test</Page>);
5+
it('should render itself & its children - full', () => {
6+
const tree = render(
7+
<Page id="test" type="h-full">
8+
Test
9+
</Page>,
10+
);
11+
12+
expect(tree).toMatchSnapshot();
13+
});
14+
15+
it('should render itself & its children - screen', () => {
16+
const tree = render(
17+
<Page id="test" type="h-screen">
18+
Test
19+
</Page>,
20+
);
721

822
expect(tree).toMatchSnapshot();
923
});

src/renderer/components/layout/Page.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import type { FC, ReactNode } from 'react';
2+
import { cn } from '../../utils/cn';
23

34
interface IPage {
45
children: ReactNode;
56
id: string;
7+
type: 'h-full' | 'h-screen';
68
}
79

810
export const Page: FC<IPage> = (props: IPage) => {
911
return (
10-
<div className="flex flex-col h-full" data-testid={props.id}>
12+
<div className={cn('flex flex-col', props.type)} data-testid={props.id}>
1113
{props.children}
1214
</div>
1315
);

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

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

+76-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)