Skip to content

Commit 1c853b3

Browse files
authored
Merge pull request #120 from codeit-2team/feat/119
feat/119 404, 에러 페이지 제작
2 parents d5609e8 + 632bd68 commit 1c853b3

File tree

4 files changed

+42
-13
lines changed

4 files changed

+42
-13
lines changed

public/assets/img/404-image.png

122 KB
Loading

src/app/error.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
'use client';
2+
3+
import Button from '@/components/Button';
4+
5+
export default function errorPage() {
6+
return (
7+
<main
8+
className="relative flex h-screen w-screen items-center justify-center px-10 md:justify-end bg-none md:bg-[url('/assets/img/404-image.png')] bg-no-repeat bg-cover md:bg-center"
9+
>
10+
<div className="relative z-10 w-full max-w-1200 mx-auto px-6 md:px-12 flex justify-center md:justify-end">
11+
<div className="flex flex-col items-center md:items-start gap-8 md:gap-20 text-center md:text-left max-w-xl">
12+
<h1 className="text-5xl md:text-8xl font-extrabold text-nomad">OPPS!</h1>
13+
<p className="text-base md:text-xl text-nomad mb-6 leading-relaxed">
14+
서비스 이용에 불편을 드려 죄송합니다.<br />
15+
잠시 후 다시 시도해 주세요.
16+
</p>
17+
<Button
18+
className="w-full max-w-200 px-30 py-16 rounded-[10px] shadow-lg hover:opacity-80 transition-colors duration-300 bg-nomad text-white text-base"
19+
variant="primary"
20+
onClick={() => (window.location.href = '/')}
21+
>
22+
홈으로 돌아가기
23+
</Button>
24+
</div>
25+
</div>
26+
</main>
27+
);
28+
}

src/app/not-found.tsx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,25 @@ import Button from '@/components/Button';
44

55
export default function NotFoundPage() {
66
return (
7-
<div className='fixed inset-0 z-[9999] flex h-screen w-screen flex-col items-center justify-center overflow-hidden bg-gray-300 text-center'>
8-
<div className='z-10 w-full max-w-xl items-center justify-center space-y-6'>
9-
<div className='mb-2 flex w-full items-center justify-center'></div>
10-
<div className='space-y-6'>
11-
<h1 className='text-primary-100 text-3xl font-bold'>
12-
존재하지 않는 페이지입니다
13-
</h1>
14-
</div>
15-
<div className='mt-12 flex w-full items-center justify-center'>
7+
<main
8+
className="relative flex h-screen w-screen items-center justify-center px-10 md:justify-end bg-none md:bg-[url('/assets/img/404-image.png')] bg-no-repeat bg-cover md:bg-center"
9+
>
10+
<div className="relative z-10 w-full max-w-1200 mx-auto px-6 md:px-12 flex justify-center md:justify-end">
11+
<div className="flex flex-col items-center md:items-start gap-8 md:gap-20 text-center md:text-left max-w-xl">
12+
<h1 className="text-5xl md:text-8xl font-extrabold text-nomad">404 ERROR</h1>
13+
<p className="text-base md:text-xl text-nomad mb-6 leading-relaxed">
14+
존재하지 않는 주소를 입력하셨거나,<br />
15+
요청하신 페이지의 주소가 변경 또는 삭제되었을 수 있습니다.
16+
</p>
1617
<Button
17-
className='cursor-pointer rounded-lg border border-gray-300 bg-gray-700 py-4 text-xl font-bold text-gray-100 transition-colors hover:bg-gray-600 focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 focus:outline-none'
18-
variant='primary'
18+
className="w-full max-w-200 px-30 py-16 rounded-[10px] shadow-lg hover:opacity-80 transition-colors duration-300 bg-nomad text-white text-base"
19+
variant="primary"
1920
onClick={() => (window.location.href = '/')}
2021
>
2122
홈으로 돌아가기
2223
</Button>
2324
</div>
2425
</div>
25-
</div>
26+
</main>
2627
);
2728
}

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
},
3434
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
3535
"exclude": ["node_modules"]
36-
}
36+
}

0 commit comments

Comments
 (0)