Skip to content

Commit

Permalink
fix: page layouts
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Setch <adam.setch@outlook.com>
  • Loading branch information
setchy committed Jan 23, 2025
1 parent d46e4f3 commit 1aa1cfa
Show file tree
Hide file tree
Showing 18 changed files with 3,014 additions and 2,921 deletions.
2 changes: 1 addition & 1 deletion src/renderer/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const App = () => {
<BaseStyles>
<AppProvider>
<Router>
<div className="flex h-screen overflow-x-hidden overflow-y-auto flex-col pl-10 bg-gitify-background">
<div className="flex flex-col min-h-screen overflow-x-hidden overflow-y-auto pl-10 bg-gitify-background">
<Loading />
<Sidebar />
<Routes>
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/components/__snapshots__/AllRead.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/renderer/components/__snapshots__/Oops.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/renderer/components/layout/Centered.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const Centered: FC<ICentered> = ({
align="center"
justify="center"
padding="spacious"
className={fullHeight && 'h-full'}
className={fullHeight && 'h-screen'}
>
{props.children}
</Stack>
Expand Down
18 changes: 16 additions & 2 deletions src/renderer/components/layout/Page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,22 @@ import { render } from '@testing-library/react';
import { Page } from './Page';

describe('renderer/components/layout/Page.tsx', () => {
it('should render itself & its children', () => {
const tree = render(<Page id="test">Test</Page>);
it('should render itself & its children - full', () => {
const tree = render(
<Page id="test" type="h-full">
Test
</Page>,
);

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

it('should render itself & its children - screen', () => {
const tree = render(
<Page id="test" type="h-screen">
Test
</Page>,
);

expect(tree).toMatchSnapshot();
});
Expand Down
4 changes: 3 additions & 1 deletion src/renderer/components/layout/Page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import type { FC, ReactNode } from 'react';
import { cn } from '../../utils/cn';

interface IPage {
children: ReactNode;
id: string;
type: 'h-full' | 'h-screen';
}

export const Page: FC<IPage> = (props: IPage) => {
return (
<div className="flex flex-col h-full" data-testid={props.id}>
<div className={cn('flex flex-col', props.type)} data-testid={props.id}>
{props.children}
</div>
);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 76 additions & 1 deletion src/renderer/components/layout/__snapshots__/Page.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1aa1cfa

Please sign in to comment.