-
Notifications
You must be signed in to change notification settings - Fork 1
feat/119 404, 에러 페이지 제작 #120
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| 'use client'; | ||
|
|
||
| import Button from '@/components/Button'; | ||
|
|
||
| export default function errorPage() { | ||
| return ( | ||
| <main | ||
| 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" | ||
| > | ||
| <div className="relative z-10 w-full max-w-1200 mx-auto px-6 md:px-12 flex justify-center md:justify-end"> | ||
| <div className="flex flex-col items-center md:items-start gap-8 md:gap-20 text-center md:text-left max-w-xl"> | ||
| <h1 className="text-5xl md:text-8xl font-extrabold text-nomad">OPPS!</h1> | ||
| <p className="text-base md:text-xl text-nomad mb-6 leading-relaxed"> | ||
| 서비스 이용에 불편을 드려 죄송합니다.<br /> | ||
| 잠시 후 다시 시도해 주세요. | ||
| </p> | ||
| <Button | ||
| 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" | ||
| variant="primary" | ||
| onClick={() => (window.location.href = '/')} | ||
| > | ||
| 홈으로 돌아가기 | ||
| </Button> | ||
|
Comment on lines
+17
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 라우팅 방식 개선 및 스타일 중복 제거 필요
+'use client';
+
+import { useRouter } from 'next/navigation';
import Button from '@/components/Button';
export default function ErrorPage() {
+ const router = useRouter();
+
return (
// ... other code
<Button
- 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"
+ className="w-full max-w-200 px-30 py-16 rounded-[10px] shadow-lg hover:opacity-80 transition-opacity duration-300"
variant="primary"
- onClick={() => (window.location.href = '/')}
+ onClick={() => router.push('/')}
>
홈으로 돌아가기
</Button>🤖 Prompt for AI Agents |
||
| </div> | ||
| </div> | ||
| </main> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,24 +4,25 @@ import Button from '@/components/Button'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export default function NotFoundPage() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <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'> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className='z-10 w-full max-w-xl items-center justify-center space-y-6'> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className='mb-2 flex w-full items-center justify-center'></div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className='space-y-6'> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <h1 className='text-primary-100 text-3xl font-bold'> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 존재하지 않는 페이지입니다 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </h1> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className='mt-12 flex w-full items-center justify-center'> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <main | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className="relative z-10 w-full max-w-1200 mx-auto px-6 md:px-12 flex justify-center md:justify-end"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className="flex flex-col items-center md:items-start gap-8 md:gap-20 text-center md:text-left max-w-xl"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <h1 className="text-5xl md:text-8xl font-extrabold text-nomad">404 ERROR</h1> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <p className="text-base md:text-xl text-nomad mb-6 leading-relaxed"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 존재하지 않는 주소를 입력하셨거나,<br /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 요청하신 페이지의 주소가 변경 또는 삭제되었을 수 있습니다. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </p> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Button | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| variant='primary' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| variant="primary" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| onClick={() => (window.location.href = '/')} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 홈으로 돌아가기 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Button> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
17
to
23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 라우팅 방식 개선 및 스타일 중복 제거 필요 error.tsx와 동일한 이슈가 있습니다:
+'use client';
+
+import { useRouter } from 'next/navigation';
import Button from '@/components/Button';
export default function NotFoundPage() {
+ const router = useRouter();
+
return (
// ... other code
<Button
- 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"
+ className="w-full max-w-200 px-30 py-16 rounded-[10px] shadow-lg hover:opacity-80 transition-opacity duration-300"
variant="primary"
- onClick={() => (window.location.href = '/')}
+ onClick={() => router.push('/')}
>
홈으로 돌아가기
</Button>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </main> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+7
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) 코드 중복 제거를 위한 공통 컴포넌트 추출 권장
공통 컴포넌트 예시: // src/components/ErrorPageLayout.tsx
interface ErrorPageLayoutProps {
title: string;
message: string;
}
export default function ErrorPageLayout({ title, message }: ErrorPageLayoutProps) {
const router = useRouter();
return (
<main
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"
>
<div className="relative z-10 w-full max-w-1200 mx-auto px-6 md:px-12 flex justify-center md:justify-end">
<div className="flex flex-col items-center md:items-start gap-8 md:gap-20 text-center md:text-left max-w-xl">
<h1 className="text-5xl md:text-8xl font-extrabold text-nomad">{title}</h1>
<p className="text-base md:text-xl text-nomad mb-6 leading-relaxed">
{message}
</p>
<Button
className="w-full max-w-200 px-30 py-16 rounded-[10px] shadow-lg hover:opacity-80 transition-opacity duration-300"
variant="primary"
onClick={() => router.push('/')}
>
홈으로 돌아가기
</Button>
</div>
</div>
</main>
);
}🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,4 +33,4 @@ | |
| }, | ||
| "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], | ||
| "exclude": ["node_modules"] | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
컴포넌트 함수명 규칙 준수 필요
React 컴포넌트 함수는 Pascal case를 사용해야 합니다.
📝 Committable suggestion
🤖 Prompt for AI Agents