-
Notifications
You must be signed in to change notification settings - Fork 1
Refactor/#247: GNB와 SideDrawer의 HTML구조, 컨벤션, 접근성 리팩토링 #187
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 all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
737d855
refactor: useClickOutside 훅에서 다양한 HTML 태그에 사용 가능한 ref 처리를 위해 제네릭으로 유연…
juyesu 3c76f69
refactor: dropdown 공통 컴포넌트를 사용하는 방식으로 변경
juyesu 5734be5
refactor: gnb 내 html구조 개선
juyesu eab40e6
refactor: 컴포넌트명이 더 명확한 의미를 가지도록 UserDropdown -> UserProfileDropdown 으…
juyesu e559dd0
refactor: sidedrawer 레이아웃 구조 및 상태 관리 방식 변경
juyesu 90eda7c
refactor: header(GNB), SideDrawer, Overlay의 z-index 계층 구조를 UI 표시 순서에 …
juyesu b7fbaa3
refactor: 닫기 버튼에 사용되는 UI를 텍스트에서 svg로 변경
juyesu 75e6d03
refactor: sideDrawer 접근성 개선
juyesu 34aadb9
refactor: gnb 및 프로필 드롭다운 접근성 개선
juyesu 2739c0e
refactor: 컨벤션에 따라 GNB컴포넌트를 export default로 변경
juyesu 87bb85d
refactor: 조건 검사에 사용되는 라우트 주소를 상수로 변경
juyesu 7152586
refactor: 사용되지 않는 스타일 제거, drawer내부의 hover 스타일을 active 스타일로 변경
juyesu b22862e
refactor: gnb관련 컴포넌트의 파일 import를 절대 경로로 변경
juyesu e35e679
Merge branch 'develop' of https://github.com/we-write/fontend into re…
juyesu 9ec8298
refactor: esc 키를 통한 상태관리 로직을 커스텀 훅으로 분리
juyesu d35cf7f
refactor: 중복되는 Escape 키 감지 로직 제거
juyesu 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 |
|---|---|---|
| @@ -1,65 +1,15 @@ | ||
| 'use client'; | ||
|
|
||
| import LoginSection from './LoginSection'; | ||
| import SideDrawer from '../SideDrawer/SideDrawer'; | ||
| import LogoButton from '@/components/layout/GNB/LogoButton'; | ||
| import MenuGroups from '@/components/layout/GNB/MenuGroups'; | ||
| import { APP_ROUTES, APP_ROUTES_LABEL } from '@/constants/appRoutes'; | ||
| import useBoolean from '@/hooks/useBoolean'; | ||
| import { Hamburger } from '@public/assets/icons'; | ||
|
|
||
| // 메뉴 항목 | ||
| const MENU_ITEMS = [ | ||
| { label: APP_ROUTES_LABEL.mypage, href: APP_ROUTES.mypage }, | ||
| { label: APP_ROUTES_LABEL.social, href: APP_ROUTES.social }, | ||
| { label: APP_ROUTES_LABEL.library, href: APP_ROUTES.library }, | ||
| ]; | ||
|
|
||
| export const GNB = () => { | ||
| const { | ||
| value: isDrawerOpen, | ||
| setTrue: setIsDrawerOpen, | ||
| setFalse: setIsDrawerClose, | ||
| } = useBoolean(); | ||
|
|
||
| const GNB = () => { | ||
| return ( | ||
| <> | ||
| <nav className="fixed top-0 z-50 h-15 w-full border-b border-gray-200 bg-white"> | ||
| <div className="flex-center mx-auto h-full w-full max-w-300 px-4 md:justify-between md:pr-6 md:pl-7 lg:px-1"> | ||
| {/* Logo */} | ||
| <div className="flex items-center gap-5 truncate lg:gap-10"> | ||
| <LogoButton /> | ||
| {/* 데스크탑 메뉴 */} | ||
| <MenuGroups /> | ||
| </div> | ||
| {/* 데스크탑 로그인 영역*/} | ||
| <LoginSection /> | ||
| {/* 모바일 햄버거 */} | ||
| <button | ||
| className="absolute top-5 right-5 md:hidden" | ||
| onClick={() => setIsDrawerOpen()} | ||
| > | ||
| <Hamburger | ||
| className="h-6 w-6 text-gray-500" | ||
| fill="currentColor" | ||
| aria-hidden="true" | ||
| /> | ||
| </button> | ||
| </div> | ||
| </nav> | ||
| {/* 오버레이 */} | ||
| {isDrawerOpen && ( | ||
| <div | ||
| className="fixed inset-0 z-50 h-screen bg-black/50 md:hidden" | ||
| onClick={() => setIsDrawerClose()} | ||
| /> | ||
| )} | ||
| {/* 시아드 드로어 (모바일 화면에 표시) */} | ||
| <SideDrawer | ||
| isOpen={isDrawerOpen} | ||
| closeDrawer={() => setIsDrawerClose()} | ||
| menuItems={MENU_ITEMS} | ||
| /> | ||
| </> | ||
| <nav className="flex-center h-full w-full border-b border-gray-200 bg-white"> | ||
| <div className="flex w-full max-w-300 gap-6 px-4 md:pr-6 md:pl-7 lg:gap-10 xl:px-1"> | ||
| <LogoButton /> | ||
| <MenuGroups /> | ||
| </div> | ||
| </nav> | ||
| ); | ||
| }; | ||
|
|
||
| export default GNB; |
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lucide 아이콘으로 통일하는건 어떨까요?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 lucide 아이콘으로 변경할지 생각해보았는데 아직 기존에 사용된 SVGR을 lucide로 대체해자는 논의가 나오지 않은 상황에서 lucide 로 변경하는건 리팩토링보단 취향적인 부분이 될 것 같아서 이번 작업에는 제외됐습니다.
lucide 로 대체 가능한 svg는 lucide로 변경하는 것도 괜찮고, 이미 프로젝트에 사용된 svgr은 변경하지 않는 방법도 있을 것 같아서 위클리 스크럼 때 논의해볼까요?