Skip to content

Conversation

@BokyungCodes
Copy link
Contributor

@BokyungCodes BokyungCodes commented Aug 2, 2025

📌 변경 사항 개요

404, 에러 페이지 제작

📝 상세 내용

  • 404 페이지 제작
  • 공통 에러 페이지 제작

🔗 관련 이슈

🖼️ 스크린샷(선택사항)

globalnomad-404 globalnomad-error

💡 참고 사항

Summary by CodeRabbit

  • 신규 기능

    • 전체 화면에 표시되는 새로운 에러 페이지가 추가되어, 서비스 오류 시 사용자에게 안내 메시지와 홈으로 돌아가는 버튼을 제공합니다.
  • 스타일

    • 404 오류 페이지의 디자인이 개선되어, 배경 이미지와 더 명확한 안내 메시지, 향상된 버튼 스타일이 적용되었습니다.
    • 반응형 레이아웃으로 다양한 화면 크기에서 보기 좋게 표시됩니다.

@BokyungCodes BokyungCodes linked an issue Aug 2, 2025 that may be closed by this pull request
2 tasks
@coderabbitai
Copy link

coderabbitai bot commented Aug 2, 2025

Walkthrough

새로운 전체 화면 에러 페이지 React 컴포넌트가 추가되었고, 기존 NotFound 페이지의 레이아웃과 스타일이 개선되었습니다. 또한, tsconfig.json 파일에서 마지막 줄 개행이 제거되었습니다.

Changes

Cohort / File(s) Change Summary
에러 페이지 신규 추가
src/app/error.tsx
전체 화면 에러 페이지 컴포넌트(errorPage) 추가. 반응형 레이아웃, 배경 이미지, 안내 메시지, 홈으로 이동 버튼 구현.
NotFound 페이지 개선
src/app/not-found.tsx
NotFoundPage 레이아웃 및 스타일 대폭 개선, 배경 이미지 적용, 안내 메시지 및 버튼 스타일 변경, 구조 단순화.
설정 파일 개행 제거
tsconfig.json
파일 마지막 줄의 개행 문자 제거. 내용 및 옵션 변경 없음.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ErrorPage
    participant Browser

    User->>ErrorPage: 에러 발생 시 접근
    ErrorPage->>User: "OPPS!" 메시지, 안내문, 홈으로 돌아가기 버튼 표시
    User->>ErrorPage: 홈으로 돌아가기 버튼 클릭
    ErrorPage->>Browser: window.location.href = "/"
    Browser->>User: 홈(메인 페이지)로 이동
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related issues

Suggested labels

✨ Feature

Suggested reviewers

  • evaain706
  • LeeCh0129

Poem

🐇
에러가 와도 걱정 마,
토끼가 만든 새 하늘 아래
"OPPS!"라 외치며 웃어봐,
홈으로 가는 길도 준비했지!
404도 이제 멋지게,
노마드처럼 다시 뛰어가자!
🌈

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/119

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@minimo-9 minimo-9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 잘만드셨네요 디자인 굿입니다!!

@BokyungCodes BokyungCodes self-assigned this Aug 2, 2025
@BokyungCodes BokyungCodes added 🎨 style 마크업 및 스타일링 ✨ Feature 기능구현 labels Aug 2, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

♻️ Duplicate comments (1)
src/app/not-found.tsx (1)

8-8: 백그라운드 이미지 파일 존재 확인 필요

동일한 백그라운드 이미지를 사용하고 있습니다. 파일 존재 여부를 확인해주세요.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 214c0a8 and 632bd68.

⛔ Files ignored due to path filters (1)
  • public/assets/img/404-image.png is excluded by !**/*.png
📒 Files selected for processing (3)
  • src/app/error.tsx (1 hunks)
  • src/app/not-found.tsx (1 hunks)
  • tsconfig.json (1 hunks)
🔇 Additional comments (2)
tsconfig.json (1)

36-36: 파일 끝 개행 제거 확인 필요

파일 끝 개행 문자가 제거되었습니다. 프로젝트의 ESLint/Prettier 설정이 이 변경사항과 일치하는지 확인해주세요.

src/app/error.tsx (1)

8-8: 백그라운드 이미지 경로 확인 완료

  • public/assets/img/404-image.png 파일이 존재함을 확인했습니다.
  • 경로가 올바르므로 추가 조치는 필요 없습니다.


import Button from '@/components/Button';

export default function errorPage() {
Copy link

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를 사용해야 합니다.

-export default function errorPage() {
+export default function ErrorPage() {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export default function errorPage() {
-export default function errorPage() {
+export default function ErrorPage() {
🤖 Prompt for AI Agents
In src/app/error.tsx at line 5, the React component function name 'errorPage'
does not follow the PascalCase naming convention. Rename the function to
'ErrorPage' to comply with React component naming standards.

Comment on lines +17 to +23
<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>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

라우팅 방식 개선 및 스타일 중복 제거 필요

  1. window.location.href 대신 Next.js의 라우터 사용을 권장합니다.
  2. Button 컴포넌트의 variant와 className에 중복된 스타일이 있습니다.
+'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
In src/app/error.tsx around lines 17 to 23, replace the use of
window.location.href with Next.js router's navigation method to handle routing
properly. Import and use the useRouter hook from 'next/router' and call
router.push('/') inside the onClick handler. Additionally, review the Button
component's variant and className props to remove overlapping styles by
consolidating styles either in the variant or className to avoid duplication.

Comment on lines +7 to +26
<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>
</div>
</div>
</div>
</main>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

코드 중복 제거를 위한 공통 컴포넌트 추출 권장

error.tsxnot-found.tsx가 거의 동일한 구조와 스타일을 공유하고 있습니다. 유지보수성 향상을 위해 공통 에러 페이지 컴포넌트로 추출하는 것을 권장합니다.

공통 컴포넌트 예시:

// 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
In src/app/not-found.tsx around lines 7 to 26, the code duplicates the structure
and styling found in error.tsx. To improve maintainability, extract the shared
layout into a common ErrorPageLayout component that accepts title and message as
props. Replace the current JSX in not-found.tsx with this new component, passing
the appropriate title and message, and update the button's onClick to use
router.push('/') for navigation.

Comment on lines 17 to 23
<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>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

라우팅 방식 개선 및 스타일 중복 제거 필요

error.tsx와 동일한 이슈가 있습니다:

  1. window.location.href 대신 Next.js 라우터 사용 권장
  2. Button 컴포넌트의 스타일 중복 제거 필요
+'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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<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>
'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-opacity duration-300"
variant="primary"
onClick={() => router.push('/')}
>
홈으로 돌아가기
</Button>
);
}
🤖 Prompt for AI Agents
In src/app/not-found.tsx around lines 17 to 23, replace the use of
window.location.href with Next.js router's navigation method (e.g., useRouter's
push) for client-side routing. Also, refactor the Button component's className
to remove redundant or duplicate style definitions, possibly by consolidating
styles or using a shared style variable or class to avoid repetition.

@evaain706
Copy link
Contributor

깔끔하게 잘 만들어주셨네요! 수고하셨습니다!

Copy link
Contributor

@LeeCh0129 LeeCh0129 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다! 디자인이 이쁘네요!

@BokyungCodes BokyungCodes merged commit 1c853b3 into develop Aug 3, 2025
2 checks passed
@BokyungCodes BokyungCodes deleted the feat/119 branch August 3, 2025 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 기능구현 🎨 style 마크업 및 스타일링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] 에러 페이지 제작

5 participants