-
Notifications
You must be signed in to change notification settings - Fork 0
[URH-49] useScrollLock 신규 #44
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
Conversation
✨ feat: 페이지를 고정하고 스크롤을 저장하는 형태의 scrollLock구현 ✅ test: useScrollLock 테스트 코드 추가 ✨ feat: window 관련 client환경 구분 추가 📝 docs: useScrollLock jsdocs 작성 🐛 fix: 테스트코드 window관련 mock 수정
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]
if (isLocked) {
lockScroll();
} else {
unlockScroll();
}
return () => {
unlockScroll();
};
메인 로직이 쉽게 읽힐 수 있도록 로직을 함수로 묶어보는건 어떠세요?
saveScrollPosition, restoreScrollPosition, lockScroll....
이런식으로 정의해두고 호출하는 방식으로 하면 가독성이 더 좋아질거 같아요!
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.
고생하셨어요 소현 님!👏🏻👏🏻
추후에 스크롤을 고정시킬 요소들을 스택 형식으로 받아서 중복 레이어들에 대한 처리도 해보면 더 멋진 훅이 될 것 같네요 ㅎㅎ
@bicochan 서비스 화면상에서 중복레이어를 받는 처리를 적용할 수 있는 실제 사례를 혹시 알수 있을까요? 당장 떠오르지가 않아 질문드립니다. 그리고 혹 해당 기능을 추가한 훅을 만든다면 이 훅안에 추가하는게 나을지 아니면 |
@Choozii a866cf4 해당 커밋에서 반영했습니다. |
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.
수고하셨어용 ✨
👾 Pull Request
1️⃣ Spec
2️⃣ 변경 사항
3️⃣ 예시 코드
위 예시처럼 isOpen과 같이 modal이 열리고 닫히는 경우 등에 해당 boolean값을 넣으면 scollLock 처리가 됨
ddd.mp4
4️⃣ 관련 문서 (선택 사항)