-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Feat/#47] 누락된 아이콘 활성화 로직 반영 #48
Conversation
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.
문제 없어서 어푸 해두겠습니다~
코멘트 한번만 확인하고 반영할 부분은 반영해주세요!
const extractFirstPath = (): string => { | ||
const pathName = location.pathname; | ||
const parts = pathName.split("/"); | ||
const basePath = `/${parts[1]}`; | ||
|
||
return basePath; | ||
}; |
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.
p3) 이거는 살려두면 어떨까요? 나중에 location 이 만약 /main이 아니라 /main/어쩌구 등등 뒤에 붙는 형식이 되면 pathName이 일치하지 않는다고 인식되어 아이콘이 활성화가 되지 않을 수도 있을 것 같아서요!
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.
아! 확장성 면에서 기존 로직이 좋은거 같아서 해당 브랜치 폭파 완료했습니다 :)
type="button" | ||
onClick={() => handleClick(path)} | ||
className={styles.navItem({ | ||
state: location.pathname === path, |
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.
p3) 만약 위에서 언급한 extractFirstPath 를 살린다면 extractFirstPath() === path 같은 방식으로 아이콘 활성화 여부를 결정하면 좋을 것 같습니다 ~
(아니면 extractFirstPath를 리팩토링해서 인자를 받는 형식으로 한다면, extractFirstPath(location.pathname) === path 으로 활성화 여부를 결정해도 좋을 것 같아요!)
🔥 Related Issues
✅ 작업 리스트
🔧 작업 내용
nav컴포넌트 링크 인식 로직 반영
📣 리뷰어에게 어떠신가요?
번거롭게 해드려 죄송합니다. 머지 과정에서 작업물이 날아간 것 같아서 새로 반영해 두었습니다.
📸 스크린샷 / GIF / Link
2025-01-14.11.11.38.mov