-
Notifications
You must be signed in to change notification settings - Fork 6
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
홈 화면 - 네비게이션 바 + 태그 추가 개발 w/ 공용 훅 #140
Conversation
Codecov Report
@@ Coverage Diff @@
## main #140 +/- ##
==========================================
- Coverage 15.58% 14.76% -0.83%
==========================================
Files 108 118 +10
Lines 943 1009 +66
Branches 143 152 +9
==========================================
+ Hits 147 149 +2
- Misses 771 829 +58
- Partials 25 31 +6
|
export default function usePreventScroll(condition: boolean = true) { | ||
useEffect(() => { | ||
if (typeof document === 'undefined') return; | ||
if (condition) document.body.style.overflow = 'hidden'; | ||
else document.body.style.overflow = 'unset'; | ||
|
||
return () => { | ||
document.body.style.overflow = 'unset'; | ||
}; | ||
}, [condition]); | ||
} |
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.
오호~! 이 훅 좋은 방법인 것 같아요!!
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.
추가해주셔서 감사합니다 :)
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.
👍👍👍👍👍👍 LGTM~!
filteredTags 변경 |
Deploying with
|
Latest commit: |
237e0ae
|
Status: | ✅ Deploy successful! |
Preview URL: | https://f227f162.ygt.pages.dev |
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.
고생하셨습니다 :)
export default function HomeNavigationBar() { | ||
return ( | ||
<nav css={navCss}> | ||
<Link href="/?modal=tag" as="/tag" scroll={false}> |
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.
👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻
export default function usePreventScroll(condition: boolean = true) { | ||
useEffect(() => { | ||
if (typeof document === 'undefined') return; | ||
if (condition) document.body.style.overflow = 'hidden'; | ||
else document.body.style.overflow = 'unset'; | ||
|
||
return () => { | ||
document.body.style.overflow = 'unset'; | ||
}; | ||
}, [condition]); | ||
} |
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.
추가해주셔서 감사합니다 :)
⛳️작업 내용
작업 기간이 기간이니,,, 나눠서 개발할 수도 있었지만 개발 진척도를 위해 뭉쳐서 개발했슴다
홈화면에 대한 부분
/tag
route를 홈 화면에서 사용되는 태그 관리 route로 사용했습니다 + Route as modal로써 사용했습니다components/home/TagFormRouteAsModal
에서 query param을 기준으로 모달을 보여주었습니다. (children으로 page 컴포넌트를 렌더링합니다)공통되는 부분
TagForm
이TagFrom
으로 돼 있어서 오타 수정했슴다useQueryParam
훅을 개발했습니다usePreventScroll
훅을 개발했슴니다📸스크린샷
⚡️사용 방법
📎공유
NOTE:
달아놨어용appliedTags
를 사용하고 있어요. 영감 추가나 편집시에 태그가 비어있어야 한다면 특정 라우트 진입하거나, 언마운트시에 리셋하는 로직을 추가해야합니다!! (리코일 리셋 훅)