Skip to content

Conversation

@kwondongwoo0424
Copy link

@kwondongwoo0424 kwondongwoo0424 commented Nov 7, 2025

변경 내용

  • src/404.tsx 파일을 src/pages/NotFound/index.tsx 로 이동 및 이름 변경했습니다.
  • 이에 따라 src/router/router.tsx 내 import 경로를 수정했습니다.
  • 기존 export const NotFound = () => 형태를 const NotFound = ... export default NotFound 로 변경하여 다른 페이지 컴포넌트와 동일한 export 형식으로 맞췄습니다.

변경 이유

폴더 구조 및 컴포넌트 네이밍의 일관성을 유지하고 유지보수성을 향상시키기 위해 구조와 export 방식을 통일했습니다.

Summary by CodeRabbit

릴리스 노트

  • Refactor
    • 404 페이지 코드 구조 최적화

주의: 본 변경사항은 내부 코드 구조 개선이며, 사용자가 인지할 수 있는 기능상 변화는 없습니다. 404 페이지의 모든 기능은 동일하게 작동합니다.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 7, 2025

Walkthrough

NotFound 컴포넌트를 src/404.tsx에서 src/pages/notFound/index.tsx로 이동했습니다. 라우터 import 경로가 새 위치에 맞게 업데이트되었으며, 컴포넌트 기능은 변경되지 않았습니다.

Changes

Cohort / File(s) 변경 요약
NotFound 컴포넌트 재배치
src/404.tsx, src/pages/notFound/index.tsx
src/404.tsx에서 NotFound 컴포넌트 및 styled Container 제거. 동일한 기능을 가진 NotFound 컴포넌트를 새 위치 src/pages/notFound/index.tsx에 추가. 메인 페이지로 이동하는 버튼 포함.
라우터 import 경로 업데이트
src/router/router.tsx
NotFound import를 @/404 (named export)에서 @/pages/notFound (default export)로 변경. 라우팅 로직은 동일하게 유지됨.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

404를 새 집으로 이사 보냈네 🐰✨
pages/notFound로 쏙 들어갔네
라우터도 따라 경로 바꿨고
기능은 그대론데 정리됐네!
구조가 깔끔해졌어, 좋아!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 파일 이동(src/404.tsx → src/pages/notFound/index.tsx), 컴포넌트 이름 변경(404 → NotFound), 익스포트 스타일 통일(named → default export)을 정확히 요약합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@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: 1

🧹 Nitpick comments (1)
src/pages/notFound/index.tsx (1)

6-6: 변수명 컨벤션을 준수해주세요.

useNavigate() 훅의 반환값을 router로 명명하는 것보다 navigate로 명명하는 것이 React Router의 일반적인 컨벤션입니다.

다음 diff를 적용하여 변수명을 수정하세요:

-  const router = useNavigate();
+  const navigate = useNavigate();
   return (
     <Container>
       <h1>404 Not Found</h1>
-      <Button width="100" onClick={() => router("/main")}>
+      <Button width="100" onClick={() => navigate("/main")}>
         메인으로 가기
       </Button>
     </Container>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 59892fb and abdb6f7.

📒 Files selected for processing (3)
  • src/404.tsx (0 hunks)
  • src/pages/notFound/index.tsx (1 hunks)
  • src/router/router.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • src/404.tsx
🔇 Additional comments (2)
src/router/router.tsx (1)

1-1: LGTM!

import 경로와 export 스타일이 올바르게 업데이트되었습니다. 다른 페이지 컴포넌트들과 동일한 패턴을 따르고 있어 일관성이 유지됩니다.

src/pages/notFound/index.tsx (1)

1-26: 폴더명 케이싱은 일관성 있게 유지되고 있습니다.

프로젝트의 src/pages 디렉토리 분석 결과:

  • 단어 폴더명: lowercase (bug, login, main, meals, attendance)
  • 복합어 폴더명: camelCase (moveClassRoom, notFound, outAccept, outList, preList, selfStudy)

notFound는 복합어 폴더명으로서 moveClassRoom, outAccept, preList, selfStudy 등과 동일한 camelCase 패턴을 따르고 있으므로 기존 컨벤션과 일치합니다. PR 설명에서 "NotFound"로 표기한 것은 문서상 표기일 뿐, 실제 폴더 구조는 올바르게 유지되고 있습니다.

return (
<Container>
<h1>404 Not Found</h1>
<Button width="100" onClick={() => router("/main")}>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Button의 width 속성값을 확인해주세요.

width="100"에서 단위가 명시되지 않았습니다. Button 컴포넌트의 API에 따라 "100%" 또는 "100px" 등의 명시적인 단위가 필요할 수 있습니다.

다음 스크립트를 실행하여 Button 컴포넌트의 width prop 타입을 확인하세요:


🏁 Script executed:

#!/bin/bash
# Description: Button 컴포넌트의 width prop 타입 정의 확인

# Button 컴포넌트 파일 찾기 및 props 타입 확인
fd -e tsx -e ts "button" src/components | xargs cat | rg -A 10 -B 2 "width"

Length of output: 2690


Button 컴포넌트의 width prop에 CSS 단위 명시 필요

Button 컴포넌트의 width prop은 string 타입으로 정의되어 있으며, 이 값이 styled-components를 통해 CSS width 속성으로 직접 적용됩니다. CSS는 0이 아닌 길이 값에 단위를 요구하므로, width="100"은 유효하지 않은 CSS입니다.

스토리의 예시에서 확인할 수 있듯이 width: "100px"처럼 명시적인 단위를 포함해야 합니다. 현재 코드를 width="100px" 또는 width="100%" 등으로 수정하세요.

🤖 Prompt for AI Agents
In src/pages/notFound/index.tsx around line 10, the Button is passed width="100"
which lacks CSS units; update the prop to include units such as width="100px" or
width="100%" so the styled-component receives a valid CSS length string (e.g.,
change width="100" to width="100px").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant