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

refactor: migrate to app dir #118

Merged
merged 7 commits into from
Dec 28, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
refactor: migrate error & not found page to app dir
DuckyMomo20012 committed Dec 28, 2023
commit dc6d1975165e8cdfc15bc1d8f72fd638a9080acc
29 changes: 15 additions & 14 deletions src/pages/500.tsx → src/app/error.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import { Button, Center, Group, Stack, Text, Title } from '@mantine/core';
import Head from 'next/head';
import Image from 'next/image';
'use client';

function ServerError() {
import {
Button,
Center,
Group,
Image,
Stack,
Text,
Title,
} from '@mantine/core';

function Error() {
return (
<Center className="h-screen">
<Head>
<title>Server Error</title>
<meta
content="Server Error - Something bad just happened..."
name="description"
></meta>
</Head>
<Stack align="center" className="w-3/4 md:w-1/2 lg:w-1/3">
<Center className="@container h-full w-full flex-1">
<Stack align="center" className="min-w-4/5 @lg:w-full w-4/5 max-w-xl">
<Image
alt="500"
className="aspect-[5/4]"
@@ -43,4 +44,4 @@ function ServerError() {
);
}

export default ServerError;
export default Error;
29 changes: 15 additions & 14 deletions src/pages/404.tsx → src/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import { Button, Center, Group, Stack, Text, Title } from '@mantine/core';
import Head from 'next/head';
import Image from 'next/image';
import {
Button,
Center,
Group,
Image,
Stack,
Text,
Title,
} from '@mantine/core';

import Link from 'next/link';

const NotFound = () => {
return (
<Center className="h-screen">
<Head>
<title>404 - Not Found</title>
<meta content="404 - Not Found" name="description"></meta>
</Head>
<Stack align="center" className="w-3/4 md:w-1/2 lg:w-1/3">
<Center className="@container h-full w-full flex-1">
<Stack align="center" className="min-w-4/5 @lg:w-full w-4/5 max-w-xl">
<Image
alt="404"
className="aspect-[5/4]"
@@ -26,11 +29,9 @@ const NotFound = () => {
address, or the page has been moved to another URL.
</Text>
<Group justify="center">
<Link href="/">
<Button size="md" variant="light">
Take me back to home page
</Button>
</Link>
<Button component={Link} href="/" size="md" variant="light">
Take me back to home page
</Button>
</Group>
</Stack>
</Center>