Skip to content

Commit 4ee4fe0

Browse files
committed
fix: theme loading on startup
Signed-off-by: Adam Setch <[email protected]>
1 parent 9c25904 commit 4ee4fe0

22 files changed

+455
-52
lines changed

src/renderer/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const App = () => {
3939
<BaseStyles>
4040
<AppProvider>
4141
<Router>
42-
<div className="flex h-full overflow-y-auto flex-col pl-12 bg-gitify-background">
42+
<div className="flex h-screen overflow-y-auto flex-col pl-12 bg-gitify-background">
4343
<Loading />
4444
<Sidebar />
4545
<Routes>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { render } from '@testing-library/react';
2+
import { Contents } from './Contents';
3+
4+
describe('renderer/components/primitives/Contents.tsx', () => {
5+
it('should render itself & its children', () => {
6+
const tree = render(<Contents>Test</Contents>);
7+
8+
expect(tree).toMatchSnapshot();
9+
});
10+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import type { FC, ReactNode } from 'react';
2+
3+
interface IContents {
4+
children: ReactNode;
5+
}
6+
7+
export const Contents: FC<IContents> = (props: IContents) => {
8+
return (
9+
<div className="flex-grow overflow-x-auto px-8 pb-4">{props.children}</div>
10+
);
11+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { render } from '@testing-library/react';
2+
import { Footer } from './Footer';
3+
4+
describe('renderer/components/primitives/Footer.tsx', () => {
5+
it('should render itself & its children - justify-between', () => {
6+
const tree = render(<Footer justify="justify-between">Test</Footer>);
7+
8+
expect(tree).toMatchSnapshot();
9+
});
10+
11+
it('should render itself & its children - justify-end', () => {
12+
const tree = render(<Footer justify="justify-end">Test</Footer>);
13+
14+
expect(tree).toMatchSnapshot();
15+
});
16+
});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import type { FC, ReactNode } from 'react';
2+
import { cn } from '../../utils/cn';
3+
4+
interface IFooter {
5+
children: ReactNode;
6+
justify: 'justify-end' | 'justify-between';
7+
}
8+
9+
export const Footer: FC<IFooter> = (props: IFooter) => {
10+
return (
11+
<div
12+
className={cn(
13+
'flex items-center px-3 py-1 text-sm bg-gitify-footer',
14+
props.justify,
15+
)}
16+
>
17+
{props.children}
18+
</div>
19+
);
20+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { render } from '@testing-library/react';
2+
import { Page } from './Page';
3+
4+
describe('renderer/components/primitives/Page.tsx', () => {
5+
it('should render itself & its children', () => {
6+
const tree = render(<Page id="test">Test</Page>);
7+
8+
expect(tree).toMatchSnapshot();
9+
});
10+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { FC, ReactNode } from 'react';
2+
3+
interface IPage {
4+
children: ReactNode;
5+
id: string;
6+
}
7+
8+
export const Page: FC<IPage> = (props: IPage) => {
9+
return (
10+
<div className="flex h-screen flex-col" data-testid={props.id}>
11+
{props.children}
12+
</div>
13+
);
14+
};

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

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

src/renderer/components/primitives/__snapshots__/Footer.test.tsx.snap

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

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

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

0 commit comments

Comments
 (0)