Skip to content
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

[FE] refactor: scrollTop에서 ref로 접근하는 방식으로 변경 #639

Merged
merged 13 commits into from
Sep 15, 2023

Conversation

xodms0309
Copy link
Collaborator

Issue

✨ 구현한 기능

  • 홈에서 scrollTop 버튼 삭제
  • 상품 목록, 꿀조합, 상품 상세 페이지에서 scrollTop할 때 mainElement를 찾아가던 방법을 ref를 통해 할 수 있도록 변경
  • 스크롤 버튼 디자인 변경
스크린샷 2023-09-15 오전 11 38 41
  • (리팩터링) 이 기능과 상관 없는데 훅이 최상단에 없는 경우가 있어서 수정했습니다.

📢 논의하고 싶은 내용

x

🎸 기타

x

⏰ 일정

  • 추정 시간 : 1시간
  • 걸린 시간 : 1.5시간

@github-actions
Copy link

github-actions bot commented Sep 15, 2023

Unit Test Results

8 tests   8 ✔️  6s ⏱️
3 suites  0 💤
1 files    0

Results for commit b8afb18.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@Leejin-Yang Leejin-Yang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

타미 수고했어요!
자식 컴포넌트에 ref를 넘겨주는 방식이라면 forwardRef로 감싸는건 어떤가요?

@@ -1,8 +1,8 @@
import type { RefObject } from 'react';

const useScroll = () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

훅의 인자로 ref를 받는건 어떤가요??

Copy link
Collaborator

@hae-on hae-on left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굿 스크롤이 훨씬 예뻐졌네여~

Copy link
Collaborator

@Leejin-Yang Leejin-Yang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

역시 타미 짱 수고했어요!

}, 100);
if (ref.current) {
const timeout = setTimeout(() => {
ref.current?.scrollIntoView({ behavior: 'smooth' });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? 삭제해주세요 ㅎㅎ 제가 안 지웠음 ㅎㅎㅎ..

@xodms0309 xodms0309 merged commit b17c35b into develop Sep 15, 2023
3 checks passed
@xodms0309 xodms0309 deleted the feat/issue-631 branch September 15, 2023 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FE] refactor: scrollTop에서 ref를 접근하는 방식으로 변경
3 participants