-
Notifications
You must be signed in to change notification settings - Fork 0
feat/공통 레이아웃 컴포넌트 개발 #8
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b39692b
perf: 폰트 로딩 방식 최적화 및 preconnect 추가 (#6)
AndyH0ng 85b168c
feat: 헤더 레이아웃 구현 (#6)
AndyH0ng 28aba23
feat: GNB 메뉴 레이아웃 구현 (#6)
AndyH0ng 19eb47f
style: props 재정렬 (#6)
AndyH0ng 3d6d8d7
chore: ESLint parserOptions.project 설정 추가 (#6)
AndyH0ng 9c37655
refactor: 탭 데이터 및 타입 상수화 (#6)
AndyH0ng 4395d53
chore: 이슈/PR 템플릿 업데이트 (#6)
AndyH0ng a7aac44
chore: Copilot 코드 리뷰 지침 업데이트 (#6)
AndyH0ng 625ffd2
refactor: Tab 타입 및 TABS 상수 분리 (#6)
AndyH0ng 866e2cf
refactor: 조건부 스타일링 clsx로 지정 (#6)
AndyH0ng 81199d2
feat: aria-controls 라벨 추가 (#6)
AndyH0ng d0ae0fa
chore: Copilot 코드 리뷰 지침 업데이트 (#6)
AndyH0ng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,9 @@ | |
|
|
||
| ## ✨ 변경 내용 | ||
|
|
||
| 어떤 기능/수정이 포함되었는지 간단 요약 | ||
| - | ||
| - | ||
| - | ||
|
|
||
| ## 💡 참고 사항 | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,38 +1,135 @@ | ||
| # Copilot 코드 리뷰 지침 | ||
|
|
||
| ## 언어 | ||
| > 한글로 리뷰해주세요 | ||
|
|
||
| - 한글로 리뷰해주세요 | ||
| --- | ||
|
|
||
| ## 기술 스택 | ||
|
|
||
| - **Framework:** React 18 + TypeScript | ||
| - **Build:** Vite | ||
| - **Styling:** Tailwind CSS v4 | ||
| - **Routing:** React Router | ||
|
|
||
| --- | ||
|
|
||
| ## 네이밍 컨벤션 | ||
|
|
||
| - 폴더명: `kebab-case` | ||
| - 일반 파일(.ts): `camelCase` | ||
| - 컴포넌트 파일(.tsx): `PascalCase` | ||
| - 변수/함수명: `camelCase` | ||
| - 상수명: `UPPER_SNAKE_CASE` | ||
| - 컴포넌트명: `PascalCase` | ||
| - 페이지 컴포넌트: `PascalCase + Page` (예: `MainPage`) | ||
| | 대상 | 규칙 | 예시 | | ||
| | -------------------- | ------------------- | ----------------- | | ||
| | 폴더명 | `kebab-case` | `user-profile` | | ||
| | 일반 파일 (.ts) | `camelCase` | `useAuth.ts` | | ||
| | 컴포넌트 파일 (.tsx) | `PascalCase` | `UserCard.tsx` | | ||
| | 변수/함수명 | `camelCase` | `getUserName` | | ||
| | 상수명 | `UPPER_SNAKE_CASE` | `MAX_RETRY_COUNT` | | ||
| | 컴포넌트명 | `PascalCase` | `UserCard` | | ||
| | 페이지 컴포넌트 | `PascalCase + Page` | `MainPage` | | ||
| | 타입/인터페이스 | `PascalCase` | `UserProps` | | ||
|
|
||
| --- | ||
|
|
||
| ## 폴더 구조 | ||
|
|
||
| ``` | ||
| src/ | ||
| ├── components/ # 재사용 컴포넌트 | ||
| │ └── layout/ # 레이아웃 컴포넌트 | ||
| ├── constants/ # 상수 | ||
| ├── hooks/ # 커스텀 훅 | ||
| ├── pages/ # 페이지 컴포넌트 | ||
| ├── router/ # 라우터 설정 | ||
| ├── styles/ # 글로벌 스타일, 디자인 토큰 | ||
| └── utils/ # 유틸 함수 | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Export 규칙 | ||
|
|
||
| - 컴포넌트: `export default` | ||
| - 유틸 함수: `named export` | ||
| - **컴포넌트:** `export function` (named export) | ||
| - **페이지:** `export default` | ||
| - **유틸 함수:** `named export` | ||
| - **타입:** `export type` / `export interface` | ||
|
|
||
| --- | ||
|
|
||
| ## 스타일링 | ||
|
|
||
| ### Tailwind CSS | ||
|
|
||
| - `style` 속성보다 Tailwind 유틸리티 클래스를 우선 사용해주세요 | ||
| - 임의 값(`w-[35px]`) 사용을 지양하고, 테마에 정의된 값을 사용해주세요 | ||
| - 색상은 디자인 시스템 팔레트를 사용해주세요 (`text-gray-600`, `bg-main`) | ||
|
|
||
| ### 디자인 토큰 | ||
|
|
||
| ```css | ||
| /* 색상 */ | ||
| --color-main, --color-gray-{100-900}, --color-error, --color-success | ||
|
|
||
| /* 타이포그래피 */ | ||
| .text-body-m, .text-body-s, .text-caption | ||
| ``` | ||
|
|
||
| ### 단위 | ||
|
|
||
| - `px` 대신 `rem`을 사용해주세요 | ||
|
|
||
| --- | ||
|
|
||
| ## React | ||
|
|
||
| ### 컴포넌트 | ||
|
|
||
| - Props는 `interface`로 정의해주세요 | ||
| - 비즈니스 로직(Custom Hooks)과 UI(Component)를 분리해주세요 | ||
|
|
||
| ### Hooks | ||
|
|
||
| - `useEffect` 의존성 배열이 올바른지 확인해주세요 | ||
| - 불필요한 리렌더링이 발생할 수 있는 코드인지 확인해주세요 | ||
|
|
||
| ### 라우팅 | ||
|
|
||
| - `<a>` 태그 대신 `<Link>` 또는 `useNavigate`를 사용해주세요 (SPA 동작 보장) | ||
|
|
||
| --- | ||
|
|
||
| ## 코드 품질 | ||
|
|
||
| - 불필요한 `console.log`가 있는지 확인해주세요 | ||
| - 사용하지 않는 import가 있는지 확인해주세요 | ||
| - TypeScript 타입이 `any`로 되어있는지 확인해주세요 | ||
| - 하드코딩된 값이 상수로 분리되어야 하는지 확인해주세요 | ||
| - 매직 넘버는 의미 있는 상수명으로 분리해주세요 | ||
|
|
||
| ## React | ||
| --- | ||
|
|
||
| - 컴포넌트 props는 interface로 정의해주세요 | ||
| - useEffect 의존성 배열이 올바른지 확인해주세요 | ||
| - 불필요한 리렌더링이 발생할 수 있는 코드인지 확인해주세요 | ||
| ## 접근성 (Accessibility) | ||
|
|
||
| - 의미 없는 `<div>` 대신 시맨틱 태그를 적극 사용해주세요 | ||
| - 모든 이미지(`<img>`)에는 적절한 `alt` 텍스트를 제공해주세요 | ||
| - 버튼과 링크는 명확한 레이블을 가져야 합니다 | ||
| - `role`, `aria-*` 속성을 적절히 사용해주세요 | ||
|
|
||
| --- | ||
|
|
||
| ## 보안 | ||
|
|
||
| - API 키나 민감한 정보가 하드코딩되어 있는지 확인해주세요 | ||
| - 환경변수는 `VITE_` 접두사를 사용해야 합니다 | ||
|
|
||
| --- | ||
|
|
||
| ## Git 커밋 컨벤션 | ||
|
|
||
| ``` | ||
| <type>: <subject> (#issue) | ||
|
|
||
| feat: 새로운 기능 | ||
| fix: 버그 수정 | ||
| refactor: 리팩토링 | ||
| style: 코드 포맷팅 | ||
| chore: 기타 작업 | ||
| docs: 문서 수정 | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import { TABS, type Tab } from '../../constants/navigation'; | ||
|
|
||
| interface GNBProps { | ||
| activeTab?: Tab; | ||
| onTabChange?: (tab: Tab) => void; | ||
| } | ||
|
|
||
| export function GNB({ activeTab = 'slide', onTabChange }: GNBProps) { | ||
| return ( | ||
| <nav | ||
| className="absolute left-1/2 flex h-15 -translate-x-1/2 items-center justify-center" | ||
| role="tablist" | ||
| > | ||
| {TABS.map(({ key, label }) => { | ||
| const isActive = activeTab === key; | ||
| return ( | ||
| <button | ||
| key={key} | ||
| type="button" | ||
| role="tab" | ||
| aria-selected={isActive} | ||
| onClick={() => onTabChange?.(key)} | ||
| className={`flex h-full w-25 items-end justify-center px-2.5 pb-4 pt-4 text-body-m-bold border-b-2 ${ | ||
AndyH0ng marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| isActive ? 'border-main text-main' : 'border-transparent text-gray-600' | ||
| }`} | ||
AndyH0ng marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| > | ||
| {label} | ||
| </button> | ||
AndyH0ng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ); | ||
| })} | ||
| </nav> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import type { ReactNode } from 'react'; | ||
|
|
||
| interface HeaderProps { | ||
| children?: ReactNode; | ||
| } | ||
|
|
||
| export function Header({ children }: HeaderProps) { | ||
| return ( | ||
| <header className="fixed top-0 left-0 right-0 z-50 flex h-15 items-center justify-center border-b border-gray-200 bg-white px-18"> | ||
AndyH0ng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| {children} | ||
| </header> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import type { ReactNode } from 'react'; | ||
|
|
||
| import { Header } from './Header'; | ||
|
|
||
| interface LayoutProps { | ||
| header: ReactNode; | ||
| children?: ReactNode; | ||
| } | ||
|
|
||
| export function Layout({ children, header }: LayoutProps) { | ||
| return ( | ||
| <div className="min-h-screen bg-gray-100"> | ||
| <Header>{header}</Header> | ||
| <main className="pt-15">{children}</main> | ||
AndyH0ng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </div> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| export { GNB } from './GNB'; | ||
| export { Header } from './Header'; | ||
| export { Layout } from './Layout'; | ||
| export { type Tab } from '../../constants/navigation'; | ||
AndyH0ng marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| export type Tab = 'slide' | 'video' | 'insight'; | ||
|
|
||
| export const TABS: { key: Tab; label: string }[] = [ | ||
| { key: 'slide', label: '슬라이드' }, | ||
| { key: 'video', label: '영상' }, | ||
| { key: 'insight', label: '인사이트' }, | ||
| ]; | ||
AndyH0ng marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| @import "tailwindcss"; | ||
| @import "./fonts.css"; | ||
| @import "./theme.css"; | ||
| @import "./typography.css"; | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.