Skip to content

feat/라우팅 설정#10

Merged
AndyH0ng merged 5 commits intodevelopfrom
feat/routing#9
Dec 30, 2025
Merged

feat/라우팅 설정#10
AndyH0ng merged 5 commits intodevelopfrom
feat/routing#9

Conversation

@AndyH0ng
Copy link
Member

@AndyH0ng AndyH0ng commented Dec 30, 2025

📌 관련 이슈

✨ 변경 내용

  • 헤더 레이아웃 리팩토링
  • 네이밍 컨벤션을 준수하기 위해 GNB 컴포넌트를 Gnb로 rename
  • navigation.ts에 path 속성 및 PATH_TO_TAB, DEFAULT_TAB 중앙 관리
  • react-router-dom을 사용한 라우팅 구현
  • 페이지 컴포넌트 추가 (SlidePage, VideoPage, InsightPage)

💡 참고 사항

스크린샷, 참고 링크, 추가 설명 등 (없으면 생략 가능)

@AndyH0ng AndyH0ng self-assigned this Dec 30, 2025
@AndyH0ng AndyH0ng linked an issue Dec 30, 2025 that may be closed by this pull request
5 tasks
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @AndyH0ng, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 react-router-dom을 도입하여 애플리케이션에 클라이언트 측 라우팅 기능을 추가합니다. 이는 사용자가 다양한 섹션으로 이동할 수 있는 기반을 마련하며, 메인 레이아웃 컴포넌트, 특히 헤더를 더욱 모듈화하고 유연하게 재구성합니다. 또한, 내비게이션 관련 상수를 표준화하여 관리 효율성을 높였습니다. 전반적으로 다중 페이지 애플리케이션의 핵심 구조를 구축하는 데 중점을 둡니다.

Highlights

  • 라우팅 구현: react-router-dom 라이브러리를 사용하여 클라이언트 측 라우팅을 구현했습니다. 이를 통해 애플리케이션 내에서 페이지 간 이동이 가능해졌습니다.
  • 헤더 레이아웃 리팩토링: HeaderLayout 컴포넌트를 리팩토링하여 left, center, right 영역에 유연하게 콘텐츠를 배치할 수 있도록 개선했습니다.
  • GNB 컴포넌트 개선 및 네이밍 컨벤션 준수: GNB 컴포넌트의 이름을 Gnb로 변경하여 네이밍 컨벤션을 따랐으며, react-router-domLink 컴포넌트를 사용하여 내비게이션 기능을 통합했습니다.
  • 내비게이션 상수 중앙 관리: navigation.ts 파일에서 탭별 path 속성, PATH_TO_TAB 매핑, DEFAULT_TAB 등 내비게이션 관련 상수를 중앙에서 관리하도록 설정했습니다.
  • 새로운 페이지 컴포넌트 추가: 슬라이드, 영상, 인사이트 콘텐츠를 표시할 SlidePage, VideoPage, InsightPage 컴포넌트를 추가했습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이번 PR은 react-router-dom을 사용한 라우팅 설정, 헤더 레이아웃 리팩토링, 네비게이션 상수 중앙 관리 등 중요한 개선 사항을 포함하고 있습니다. 전반적으로 코드 구조가 명확해지고 확장성이 좋아졌습니다. 다만, 일부 코드에서 유지보수성을 더욱 향상시킬 수 있는 부분이 있어 몇 가지 제안을 드립니다. src/main.tsx에서 라우팅 설정을 동적으로 생성하고, src/App.tsx에서 UI 요소를 컴포넌트로 분리하면 코드가 더욱 견고하고 재사용 가능해질 것입니다. 자세한 내용은 아래의 개별 댓글을 참고해주세요.

Comment on lines +11 to +22
const router = createBrowserRouter([
{
path: '/',
element: <App />,
children: [
{ index: true, element: <SlidePage /> }, // DEFAULT_TAB 변경 시 동기화 필요
{ path: 'slide', element: <SlidePage /> },
{ path: 'video', element: <VideoPage /> },
{ path: 'insight', element: <InsightPage /> },
],
},
]);
Copy link
Contributor

Choose a reason for hiding this comment

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

high

라우팅 설정이 src/constants/navigation.ts에 정의된 TABS 배열과 동기화되지 않고 하드코딩되어 있습니다. 이로 인해 TABS가 변경될 때마다 라우트 설정을 수동으로 업데이트해야 하며, 이는 유지보수성을 저해하고 잠재적인 버그를 유발할 수 있습니다. (// DEFAULT_TAB 변경 시 동기화 필요 주석 참고)

TABSDEFAULT_TAB 상수를 사용하여 라우트를 동적으로 생성하면 이 문제를 해결하고 코드를 더 견고하게 만들 수 있습니다.

아래 제안을 적용하기 전에 파일 상단에 다음 import 구문을 추가하거나 수정해주세요.

import { StrictMode, type ReactElement } from 'react';
import { TABS, DEFAULT_TAB, type Tab } from './constants/navigation';
Suggested change
const router = createBrowserRouter([
{
path: '/',
element: <App />,
children: [
{ index: true, element: <SlidePage /> }, // DEFAULT_TAB 변경 시 동기화 필요
{ path: 'slide', element: <SlidePage /> },
{ path: 'video', element: <VideoPage /> },
{ path: 'insight', element: <InsightPage /> },
],
},
]);
const pageComponentMap: Record<Tab, ReactElement> = {
slide: <SlidePage />,
video: <VideoPage />,
insight: <InsightPage />,
};
const router = createBrowserRouter([
{
path: '/',
element: <App />,
children: [
{ index: true, element: pageComponentMap[DEFAULT_TAB] },
...TABS.map((tab) => ({
path: tab.path.substring(1),
element: pageComponentMap[tab.key],
})),
],
},
]);

Copy link
Member Author

@AndyH0ng AndyH0ng Dec 30, 2025

Choose a reason for hiding this comment

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

동적으로 만들어봤자 TABSpageComponentMap을 건드려야 합니다.
TABSchildren을 수정해야 하는 현행과 크게 다를 바 없으며,
라우팅이 명시적으로 보이지 않아서 가독성도 떨어집니다.

이에 현행으로 유지합니다.

Comment on lines +13 to +15
headerLeft={<div>로고</div>}
headerCenter={<Gnb activeTab={activeTab} />}
headerRight={<div>로그인</div>}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

로고와 로그인 UI가 div 태그로 직접 작성되어 있습니다. 이를 각각의 컴포넌트(예: <Logo />, <UserAuth />)로 분리하는 것을 고려해보세요. 이렇게 하면 App 컴포넌트가 더 선언적으로 되고, 각 UI 요소의 재사용성과 관리 용이성이 향상됩니다.

Copy link
Member Author

Choose a reason for hiding this comment

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

로고와 공유, 로그인 버튼은 추후 추가될 예정이므로 현행을 유지합니다.

@AndyH0ng AndyH0ng merged commit 4059c91 into develop Dec 30, 2025
0 of 2 checks passed
@AndyH0ng AndyH0ng deleted the feat/routing#9 branch January 12, 2026 13:03
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.

feat: 라우팅 설정

1 participant