Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404, 500 new layout #32

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions client/src/app/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use client';

import ErrorContainer from '@/containers/error';

export default function ErrorPage() {
<ErrorContainer errorType="500" heading="Internal server error" message="Something went wrong and we are working on to fix the problem. Please, try again later." />
}
10 changes: 3 additions & 7 deletions client/src/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import Link from 'next/link';

import { Button } from '@/components/ui/button';
import ErrorContainer from '@/containers/error';

export default function NotFound() {
return (
<div className="flex h-screen w-screen flex-col items-center justify-center">
<h2 className="mb-24 text-[200px] font-extrabold leading-10 text-green-400">404</h2>
<h3 className="mb-4 text-[52px]">Page not found</h3>
<p className="mb-6 text-base font-light">
It looks like the links is broken or the page has been removed.
</p>
<ErrorContainer errorType="404" heading="Page not found" message="It looks like the links is broken or the page has been removed.">
<Link href="/projects">
<Button variant="primary" size="base">
Go to home page
</Button>
</Link>
</div>
</ErrorContainer>
);
}
24 changes: 24 additions & 0 deletions client/src/containers/error/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use client';

import Image from 'next/image';

import ERROR_SVG from '@/svgs/ui/error.svg';

type ErrorTypes = {
errorType: '404' | '500';
heading: string;
message: string;
children?: React.ReactNode;
};

export default function ErrorContainer({ errorType, heading, message, children }: ErrorTypes) {
return (
<div className="flex h-screen w-screen flex-col items-center justify-center space-y-6">
<Image src={ERROR_SVG} alt="error" width={83} height={108} />
<span className="text-[40px] font-bold text-green-400">{errorType}</span>
<h2 className="text-[96px]">{heading}</h2>
<p>{message}</p>
{children}
</div>
);
}
24 changes: 24 additions & 0 deletions client/src/svgs/ui/error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading