Skip to content

Commit

Permalink
JRA-26 #done Implement 404 Page (#26)
Browse files Browse the repository at this point in the history
* Implemented authguard class and tests

* Added unauthguard components.

* Finalized UnAuthGuard component.

* Stage commit for 404 page

* Added supabase functionality

* Created base 404 page.

* Implemented Not Found page

* Removed unneccesary page

* Fixed merge conflicts

---------

Co-authored-by: Joseph Dvorak <[email protected]>
  • Loading branch information
CaptainExtremis and dvorakjt committed Aug 16, 2024
1 parent 78021e0 commit ab8ff69
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 0 deletions.
Binary file added public/static/images/pages/not-found/404.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions src/__tests__/unit/app/__snapshots__/not-found.snapshot.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Not Found renders 404 page 1`] = `
<div>
<div
class="outer_container"
data-testid="page-container"
>
<div
class="inner_container"
>
<section
class="container"
>
<img
alt="404, page not found"
data-nimg="1"
decoding="async"
height="40"
loading="lazy"
src="/_next/image?url=%2Fimg.jpg&w=96&q=75"
srcset="/_next/image?url=%2Fimg.jpg&w=48&q=75 1x, /_next/image?url=%2Fimg.jpg&w=96&q=75 2x"
style="color: transparent;"
width="40"
/>
<h1>
Not Found
</h1>
</section>
</div>
</div>
</div>
`;
11 changes: 11 additions & 0 deletions src/__tests__/unit/app/not-found.snapshot.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { render, cleanup } from '@testing-library/react';
import NotFound from '@/app/not-found';

describe('Not Found', () => {
afterEach(cleanup);

it('renders 404 page', () => {
const { container } = render(<NotFound />);
expect(container).toMatchSnapshot();
});
});
8 changes: 8 additions & 0 deletions src/app/not-found.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.container {
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
15 changes: 15 additions & 0 deletions src/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Image from 'next/image';
import { PageContainer } from '@/components/utils/page-container';
import notFound from '@/../public/static/images/pages/not-found/404.png';
import styles from './not-found.module.scss';

export default function NotFound() {
return (
<PageContainer>
<section className={styles.container}>
<Image src={notFound} alt="404, page not found" />
<h1>Not Found</h1>
</section>
</PageContainer>
);
}
19 changes: 19 additions & 0 deletions src/stories/pages/not-found.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Meta, StoryObj } from '@storybook/react';
import NotFound from '@/app/not-found';
import { GlobalStylesProvider } from '@/stories/global-styles-provider';

const meta: Meta<typeof NotFound> = { component: NotFound, parameters: { layout: 'fullscreen' } };

export default meta;

type Story = StoryObj<typeof NotFound>;

export const Default: Story = {
render: () => {
return (
<GlobalStylesProvider>
<NotFound></NotFound>
</GlobalStylesProvider>
)
}
};

0 comments on commit ab8ff69

Please sign in to comment.