Skip to content

✨Feat: main페이지 board판#51

Merged
jjangminii merged 9 commits intodevelopfrom
feat/#49/main-board
Oct 26, 2025
Merged

✨Feat: main페이지 board판#51
jjangminii merged 9 commits intodevelopfrom
feat/#49/main-board

Conversation

@jjangminii
Copy link
Copy Markdown
Contributor

@jjangminii jjangminii commented Oct 25, 2025

🔥 작업 내용

  • main페이지 board판
  • 네비 컴포넌트 연결
  • 라우팅

🤔 추후 작업 사항

  • 레이아웃 세팅
  • 세부 페이지
  • 비회원시 모달

🔗 이슈

PR Point (To Reviewer)

보드판

원래는 보드판을 집적 만드려고했는데 괜한 생각이었어요. 디자이너님계 요청하여 그리드 형식으로 만들어달라 요청후 보드판에 맞게 그리드 만들엇습니다.
추가로 보드판 디자인이 바뀔 것을 염두하여 boardData.ts 파일에서 수정하면 그리드 안에 값 유동적으로 바꿀 수 있게 하였습니다.

boardData.ts 파일 위치 에러

원래 이 파일은 pages/main/components/boardData.ts에 위치해 있었는데, Next.js에서 pages 디렉토리 내부의 모든 파일은 자동으로 라우트로 인식되기 때문에 문제가 발생했습니다. boardData.ts는 단순히 보드 데이터 배열을 export하는 모듈 파일일 뿐 컴포넌트를 기본으로 내보내는 페이지가 아니어서 빌드 과정에서 “Found page without a React Component as default export” 오류가 발생했습니다.
Next.js의 라우팅 시스템이 pages 디렉토리 내부 파일을 모두 페이지로 처리하기 때문에 생긴 문제였어요.

그래서 boardData.ts를 pages 디렉토리 밖 예를 들어 src/main/components/main/boardData.ts의 경로로 이동시켰습니다. 이렇게 하면 Next.js가 해당 파일을 라우트로 인식하지 않고 일반 모듈로 처리하게 되면서 오류도 해결했습니다.

Next.js 공식 문서에서도 pages 폴더는 실제 라우트 페이지 전용으로 사용하고, 재사용 가능한 컴포넌트나 데이터, 유틸리티 파일은 별도의 디렉토리로 분리할 것을 권장하고있어요. 이러한 구조는 라우팅 트리를 단순화하고 모듈화와 유지보수성을 높이는 데 도움이 된다고합니다.
넥스트는 처음이라.. 아직 어렵네요 좀 더 공부해 오도록 하겠습니다-!
수민님이 찾아주셨어요

📸 피그마 스크린샷 or 기능 GIF

(작업 내역 스크린샷)

2025-10-26.3.15.14.mov

Summary by CodeRabbit

주요 변경 사항

  • New Features

    • 보드 게임 인터페이스가 포함된 새로운 보드 페이지 추가
    • 대화형 그리드 기반 게임보드 구현
    • 스탐프 보드 항목 확장 (8개 → 10개)
    • 라우팅 기반 네비게이션 개선
  • Style

    • 스탐프 크기 및 아이콘 최적화
    • 하단 네비게이션 바 위치 및 레이아웃 조정

@jjangminii jjangminii linked an issue Oct 25, 2025 that may be closed by this pull request
@vercel
Copy link
Copy Markdown

vercel bot commented Oct 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
af-fe Ready Ready Preview Comment Oct 25, 2025 7:06pm

@github-actions
Copy link
Copy Markdown

🏷️ Labeler has automatically applied labels based on your PR title, branch name, or commit message.
Please verify that they are correct before merging.

@github-actions github-actions bot added the docs 문서 수정 label Oct 25, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Oct 25, 2025

Walkthrough

메인 보드 기능을 구현하는 변경입니다. 4x8 그리드 기반의 Board 페이지와 Boardgame 컴포넌트를 신규 추가했습니다. boardData 상수 모듈을 정의하고, 기존 스탬프 크기를 조정하며, 메인 페이지의 레이아웃, 라우팅, BottomNav를 통합했습니다.

Changes

Cohort / File(s) 설명
보드 페이지 및 컴포넌트
src/pages/main/Board.tsx, src/pages/main/components/board/Boardgame.tsx
보드 페이지 컴포넌트와 4x8 그리드 보드 인터페이스 신규 추가. Header와 라우터 통합, 셀 클릭 로깅 기능 포함
보드 데이터 상수
src/shared/constants/main/boardData.ts
셀 활성화 상태와 라벨을 정의하는 보드 그리드 데이터 구조(8x4) 신규 추가
메인 페이지 레이아웃 및 라우팅 통합
src/pages/main/index.tsx
보드 페이지로의 라우팅 추가, BottomNav 컴포넌트 통합, 레이아웃 패딩/높이 조정, StampBoard total 확장(8 → 10)
스탬프 크기 조정
src/pages/main/components/stampBoard/Stamp.tsx
획득/미획득 스탬프 크기 축소(3rem → 2.8rem), Icon 크기 조정(30 → 28)
하단 네비게이션 스타일 조정
src/shared/components/tab/BottomNav.tsx
하단 위치 재설정(bottom-[2rem] → bottom-[5.3rem]), 따옴표 스타일 통일

Sequence Diagram

sequenceDiagram
    actor User
    participant Main as Main Page
    participant Board as Board Page
    participant Boardgame as Boardgame
    participant boardData as boardData

    User->>Main: 클릭 (보드 항목)
    Main->>Board: router.push('/main/Board')
    Board->>Board: Header 렌더링
    Board->>Boardgame: 렌더링
    Boardgame->>boardData: boardData 조회
    boardData-->>Boardgame: 그리드 데이터 반환
    Boardgame->>Boardgame: 4x8 그리드 렌더링
    User->>Boardgame: 셀 클릭 (active=true)
    Boardgame->>Boardgame: 셀 라벨 로그 출력
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 분

  • 주의 필요 사항:
    • 새로운 Boardgame 컴포넌트의 그리드 렌더링 로직 및 셀 데이터 매핑 검토
    • boardData 구조와 4x8 그리드 차원 검증 (AI 요약에서 "4x8 grid"와 "8x4 grid"의 불일치 확인 필요)
    • 메인 페이지의 레이아웃 패딩 변경이 다른 컴포넌트 정렬에 영향을 미치지 않는지 확인
    • BottomNav 위치 재설정(bottom-[5.3rem])이 레이아웃 구성과 일관성 있는지 검토
    • Board 페이지의 router.back() 동작 및 네비게이션 흐름 검증

Possibly related PRs

Suggested labels

feat

Suggested reviewers

  • skyblue1232
  • KongMezu

Poem

🐰 보드판이 짠 하고 나타났어,
네모난 셀들이 반짝반짝,
누르면 로그가 쏘옥 남겨져,
메인에서 쏜살같이 출발해,
새로운 모험의 시작이야! 🎮

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Out of Scope Changes Check ✅ Passed 모든 변경사항이 메인 보드판 기능 구현 및 통합과 관련이 있습니다. Board.tsx와 Boardgame.tsx는 핵심 보드 기능을 구현하고, index.tsx 변경사항은 메인 페이지에서 보드로의 라우팅과 레이아웃 조정을 다룹니다. Stamp.tsx의 크기 조정, BottomNav.tsx의 위치 조정, 그리고 스페이싱 변경사항은 새로운 레이아웃 통합을 위한 지원 변경사항으로 범위 내에 있습니다. boardData.ts는 보드 그리드 구성을 위한 필수 데이터 구조이므로 범위 내 변경입니다.
Title Check ✅ Passed PR 제목 "✨Feat: main페이지 board판"은 changeset의 주요 변경 사항을 명확하고 구체적으로 요약하고 있습니다. raw_summary에서 확인할 수 있듯이, 이 PR의 핵심은 main 페이지에 board 판 기능을 구현한 것이며, 제목이 이를 직접적으로 반영하고 있습니다. 이모지 사용은 약간의 noise이지만, 핵심 메시지("main페이지 board판")는 충분히 명확하며, 라우팅 및 네비게이션 컴포넌트 추가와 같은 보조적 변경 사항은 제목에 모두 포함될 필요가 없습니다.
Description Check ✅ Passed PR 설명이 repository의 템플릿에서 요구하는 모든 필수 섹션을 충족하고 있습니다. 🔥 작업 내용, 🤔 추후 작업 사항, 🔗 이슈, PR Point (To Reviewer), 그리고 📸 피그마 스크린샷/기능 GIF가 모두 포함되어 있으며, 특히 PR Point 섹션에서 보드판 구현 방식, boardData.ts 파일 위치 오류 발생 원인, Next.js pages 디렉토리의 라우팅 제약 및 해결책을 상세하게 설명하고 있어 리뷰어에게 매우 도움이 됩니다. 동영상 링크도 함께 제공되어 변경 사항을 시각적으로 확인할 수 있습니다.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/#49/main-board

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.

@jjangminii jjangminii added feat 새로운 기능 추가 / 퍼블리싱 fix 버그 및 자잘한 오류 수정 labels Oct 25, 2025
@github-actions github-actions bot added the comment 필요한 주석 추가 및 변경 label Oct 25, 2025
@github-actions
Copy link
Copy Markdown

🏷️ Labeler has automatically applied labels based on your PR title, branch name, or commit message.
Please verify that they are correct before merging.

Copy link
Copy Markdown
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: 5

🧹 Nitpick comments (3)
src/pages/main/Board.tsx (1)

8-8: 고정 높이 대신 min-height 사용을 고려하세요.

h-[100vh]overflow-auto를 함께 사용하면 컨텐츠가 뷰포트를 초과할 때만 스크롤됩니다. 하지만 모바일 브라우저의 주소창 크기 변화나 다양한 뷰포트 높이를 고려하면 min-h-screen 사용이 더 적절할 수 있습니다.

-    <div className='relative w-full h-[100vh] bg-[#46d1cd] overflow-auto'>
+    <div className='relative w-full min-h-screen bg-[#46d1cd] overflow-auto'>
src/shared/constants/main/boardData.ts (1)

4-6: 국제화(i18n)를 고려하세요.

레이블이 한국어로 하드코딩되어 있습니다. 향후 다국어 지원이 필요할 경우를 대비하여 i18n 키를 사용하거나 별도의 로케일 파일로 분리하는 것을 고려하세요.

Also applies to: 13-13, 17-19, 23-23, 30-30, 37-37

src/pages/main/components/board/Boardgame.tsx (1)

7-7: 중복된 공백을 제거하세요.

클래스 이름에 불필요한 이중 공백이 있습니다.

-    <div className='relative w-full  h-full bg-[#46d1cd] overflow-hidden'>
+    <div className='relative w-full h-full bg-[#46d1cd] overflow-hidden'>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 193cbc6 and 0ae1cda.

⛔ Files ignored due to path filters (2)
  • public/assets/background_.svg is excluded by !**/*.svg
  • public/assets/bannerMain.svg is excluded by !**/*.svg
📒 Files selected for processing (6)
  • src/pages/main/Board.tsx (1 hunks)
  • src/pages/main/components/board/Boardgame.tsx (1 hunks)
  • src/pages/main/components/stampBoard/Stamp.tsx (1 hunks)
  • src/pages/main/index.tsx (3 hunks)
  • src/shared/components/tab/BottomNav.tsx (2 hunks)
  • src/shared/constants/main/boardData.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/pages/main/components/stampBoard/Stamp.tsx (1)
src/shared/lib/utils.ts (1)
  • cn (71-73)
src/pages/main/index.tsx (2)
src/shared/lib/utils.ts (1)
  • cn (71-73)
src/shared/components/tab/BottomNav.tsx (1)
  • BottomNav (21-54)
🔇 Additional comments (3)
src/pages/main/components/stampBoard/Stamp.tsx (1)

15-15: LGTM!

스탬프 크기를 일관되게 조정했습니다. 획득/미획득 상태 모두 2.8rem으로 통일되어 UI 일관성이 유지됩니다.

Also applies to: 20-20, 27-30

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

47-47: StampBoard total 값 변경을 확인하세요.

total 속성이 8에서 10으로 증가했습니다. 이 변경이 의도된 것인지, 그리고 실제 스탬프 획득 로직과 일치하는지 확인해주세요.

src/shared/components/tab/BottomNav.tsx (1)

26-27: 하단 네비게이션의 위치 변경이 적절하게 조율되었습니다.

검증 결과, BottomNav는 메인 페이지(src/pages/main/index.tsx)에서만 사용되고 있습니다. 따라서 다른 페이지에서의 콘텐츠 겹침 우려는 해당되지 않습니다.

현재 상태:

  • BottomNav 위치: bottom-[5.3rem] (화면 하단에서 5.3rem 위)
  • 컨테이너 하단 패딩: pb-[12rem] (충분한 여유 공간 제공)
  • 좌측 정렬: left-[2.4rem]이 컨테이너의 px-[2.4rem]과 일치

위치 변경(2rem → 5.3rem)이 의도적으로 메인 페이지의 padding과 올바르게 조율되어 있습니다.

import { Header } from '@/shared/components';

import Boardgame from '@/pages/main/components/board/Boardgame';
import router from 'next/router';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

라우터 import 방식이 잘못되었습니다.

Next.js에서 라우터를 사용하려면 useRouter 훅을 import해야 합니다. 현재 코드는 default export로 router를 import하려고 하는데, next/router는 default export를 제공하지 않습니다.

다음과 같이 수정하세요:

-import router from 'next/router';
+import { useRouter } from 'next/router';

그리고 컴포넌트 내부에서 훅을 사용하세요:

 const Board = () => {
+  const router = useRouter();
+
   return (

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/pages/main/Board.tsx around line 4, the code imports a non-existent
default export "router" from 'next/router'; replace that import with the
useRouter hook (import { useRouter } from 'next/router') and then call
useRouter() inside the component to get the router instance (replace any direct
references to the old "router" variable with the result of useRouter()). Ensure
you remove the default import and update any router usage (push, pathname,
query, etc.) to use the hook-returned object.

Comment on lines +29 to +35
if (!cell.active) {
return <div key={key} className='bg-transparent' />;
}

return (
<div key={key} onClick={() => console.log(cell.label)}></div>
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

활성 셀의 접근성을 개선하세요.

활성 셀이 클릭 가능하지만 시각적 피드백, 키보드 접근성, ARIA 레이블이 없습니다. 사용자에게 인터랙티브 요소임을 알리고 접근성을 향상시켜야 합니다.

다음과 같이 개선하세요:

             return (
               <div 
                 key={key} 
-                onClick={() => console.log(cell.label)}
-              ></div>
+                role="button"
+                tabIndex={0}
+                aria-label={cell.label || '보드 셀'}
+                onClick={() => {
+                  // TODO: 클릭 핸들러 구현
+                }}
+                onKeyDown={(e) => {
+                  if (e.key === 'Enter' || e.key === ' ') {
+                    // TODO: 키보드 핸들러 구현
+                  }
+                }}
+                className="cursor-pointer hover:opacity-80 focus:outline-none focus:ring-2 focus:ring-white"
+              />
             );
📝 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
if (!cell.active) {
return <div key={key} className='bg-transparent' />;
}
return (
<div key={key} onClick={() => console.log(cell.label)}></div>
);
if (!cell.active) {
return <div key={key} className='bg-transparent' />;
}
return (
<div
key={key}
role="button"
tabIndex={0}
aria-label={cell.label || '보드 셀'}
onClick={() => {
// TODO: 클릭 핸들러 구현
}}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
// TODO: 키보드 핸들러 구현
}
}}
className="cursor-pointer hover:opacity-80 focus:outline-none focus:ring-2 focus:ring-white"
/>
);

}

return (
<div key={key} onClick={() => console.log(cell.label)}></div>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

프로덕션 코드에서 console.log를 제거하세요.

클릭 핸들러에 console.log만 있습니다. 이는 플레이스홀더 코드로 보이며 프로덕션 환경에서는 제거되어야 합니다. 실제 클릭 동작(예: 상세 페이지 이동, 모달 표시 등)을 구현하거나 TODO 주석을 추가해주세요.

-              <div key={key} onClick={() => console.log(cell.label)}></div>
+              <div 
+                key={key} 
+                onClick={() => {
+                  // TODO: 셀 클릭 시 상세 페이지 또는 모달 표시
+                }}
+              ></div>
📝 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
<div key={key} onClick={() => console.log(cell.label)}></div>
<div
key={key}
onClick={() => {
// TODO: 셀 클릭 시 상세 페이지 또는 모달 표시
}}
></div>
🤖 Prompt for AI Agents
In src/pages/main/components/board/Boardgame.tsx around line 34 the onClick
handler currently only calls console.log(cell.label); remove this console.log
from production code and replace it with a real action or a clear TODO: either
call a passed-in handler prop (e.g., onCellClick(cell) or navigate to a detail
route / open a modal) or add a TODO comment that explains the intended behavior
and throw a noop or guard to prevent accidental logging; ensure the handler uses
a stable function reference (not inline) if you wire it to props or navigation.

import StampBoard from './components/stampBoard/StampBoard';
import { ControlBar } from '@/shared/components';
import Image from 'next/image';
import router from 'next/router';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

라우터 import 방식이 잘못되었습니다.

Board.tsx와 동일한 문제입니다. next/router에서 default export로 router를 import할 수 없습니다. useRouter 훅을 사용해야 합니다.

다음과 같이 수정하세요:

-import router from 'next/router';
+import { useRouter } from 'next/router';

그리고 컴포넌트 내부에서:

 export default function MainPage() {
+  const router = useRouter();
+
   return (

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/pages/main/index.tsx around line 5, the file incorrectly imports a
default "router" from 'next/router'; change the import to use the useRouter hook
(import { useRouter } from 'next/router') and inside the component call the hook
(const router = useRouter()) so existing router usage still works; update any
references if they assumed a module-level router to use the local router
variable returned from the hook.

Comment on lines +1 to +41
const boardData = [
[{ active: false }, { active: false }, { active: false }, { active: false }],
[
{ active: true, label: '김수환관' },
{ active: true, label: '부천 아트벙커' },
{ active: true, label: '한국 만화박물관' },
{ active: false },
],
[
{ active: false },
{ active: false },
{ active: false },
{ active: true, label: '상동 호수 공원' },
],
[
{ active: false },
{ active: true, label: '부천역' },
{ active: true, label: '다솔관' },
{ active: true, label: '부천 자유 시장' },
],
[
{ active: false },
{ active: true, label: '중앙도서관' },
{ active: false },
{ active: false },
],
[
{ active: false },
{ active: false },
{ active: true, label: '역곡공원' },
{ active: false },
],
[
{ active: false },
{ active: false },
{ active: false },
{ active: true, label: '부천 식물원' },
],
[{ active: false }, { active: false }, { active: false }, { active: false }],
];
export { boardData };
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

TypeScript 타입 정의를 추가하세요.

boardData에 명시적인 타입 정의가 없어 타입 안정성이 보장되지 않습니다. 셀 구조와 배열 차원에 대한 타입을 정의하면 실수를 방지하고 코드 품질을 향상시킬 수 있습니다.

다음과 같이 타입을 추가하세요:

+interface BoardCell {
+  active: boolean;
+  label?: string;
+}
+
+type BoardRow = [BoardCell, BoardCell, BoardCell, BoardCell];
+type BoardData = BoardRow[];
+
-const boardData = [
+const boardData: BoardData = [
   [{ active: false }, { active: false }, { active: false }, { active: false }],
🤖 Prompt for AI Agents
In src/shared/constants/main/boardData.ts lines 1-41, there is no TypeScript
type for boardData which hurts type safety; add a Cell type (e.g. { active:
boolean; label?: string }) and annotate boardData as an array of Cell arrays
(Cell[][]) — optionally export the Cell type — then update the const declaration
to use that type so each cell and the board shape are type-checked.

Copy link
Copy Markdown
Contributor

@KongMezu KongMezu left a comment

Choose a reason for hiding this comment

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

보드판 많이 연구하신게 눈에 보여요 너무..대단하십니다 간단한 질의 정도 남겨두면서 approve 해두겠습니다 !

@@ -0,0 +1,43 @@
'use client';
import Image from 'next/image';
import { boardData } from '@/shared/constants/main/boardData';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

항상 확장성 용이하게 만드는 코드 진짜 배워갑니다..

const key = `cell-${r}-${c}`;

if (!cell.active) {
return <div key={key} className='bg-transparent' />;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

!cell.active일 때 null 반환으로 안하고
bg-transparent 한 특별한 이유가 있을까요??

Copy link
Copy Markdown
Contributor Author

@jjangminii jjangminii Oct 26, 2025

Choose a reason for hiding this comment

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

null로 하게 될 경우 그 자리에 아무 요소도 렌더되지 않기 때문에 그리드의 셀 개수가 줄어들어 전체 배치가 틀어질 수 있어요 grid는 따로 빈 칸이라는 개념이 없어 요소가 없으면 셀 자체도 사라져버립니당
그래서 bg-transparent로 보이지 않는 <div>를 렌더링해서 해당 셀은 비어 있지만 공간은 차지한다는 상태를 만들어 원하는 그리드의 모양 유지했습니다

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

셀 자체가 없어지는걸 생각을 못했네요 설명 감사합니다!

import { Header } from '@/shared/components';

import Boardgame from '@/pages/main/components/board/Boardgame';
import router from 'next/router';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

여기 next/router 보다는
next/navigation 쓰는게 더 좋을거 같아요!

useRouter

Copy link
Copy Markdown
Contributor Author

@jjangminii jjangminii Oct 26, 2025

Choose a reason for hiding this comment

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

음..저희가 next 13버전이후를 사용하고 있긴하지만 pages 라우팅 기반이라 router 방식이 맞지 않을까싶습니다
첨부해주신 링크에도 각 라우팅 기반의 방식이 다르게 담겨있는데 버전도 같이 설정해서 확인해 볼 수 있는거같아요. 이 부분에 대해선 저도 좀 더 찾아보겠습니다-!
image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Pages Router (pages/ 디렉토리)는 전통적인 파일 기반 라우팅 방식으로, 각 파일이 하나의 페이지 컴포넌트 역할을 하고 클라이언트-사이드 라우팅을 기본으로 하며 next/router에서 useRouter() 등을 사용하고
App Router (app/ 디렉토리)는 Next.js 13부터 도입된 방식으로, React Server Components, 중첩 레이아웃, 서버-클라이언트 경계를 고려한 최신 라우팅 구조로 next/navigation에서 useRouter(), usePathname(), useSearchParams()사용해야합니다

두 라우터 방식이 내부적으로 다르게 구현되어 있기 때문에, 라우팅 관련 API 및 훅들도 그 구조에 맞춰야한다고 생각하는데 저희가 Next.js 13 이후 버전을 사용하고 있지만 Pages Router 기반이라 next/router에서 useRouter()를 사용하는게 맞다고 생각이듭니다.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

확인 했습니다! next 더 공부해봐야겠네요.. 겉핥기식으로 알고있다는 느낌을 받아서 답변 감사합니다!

@jjangminii jjangminii changed the title Feat: main페이지 board판 ✨Feat: main페이지 board판 Oct 26, 2025
@skyblue1232
Copy link
Copy Markdown
Contributor

타입 명시 추가에 동의합니다!!
데이터 구조가 명확해지고 자동완성도 되서 유지보수 할 때 오류 가능성도 줄어들 것 같네요!!

@jjangminii jjangminii merged commit a2096df into develop Oct 26, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comment 필요한 주석 추가 및 변경 docs 문서 수정 feat 새로운 기능 추가 / 퍼블리싱 fix 버그 및 자잘한 오류 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 메인 보드판 작업

3 participants