Skip to content

Conversation

@cccwon2
Copy link
Contributor

@cccwon2 cccwon2 commented Dec 14, 2024

  1. 무한 스크롤 에러 수정
  2. 피드백 반영
  3. 댓글 생성, 수정 리액트 쿼리 및 CSS 수정
  4. 알바 토크 > 게시글 이미지 관련 수정
  5. 알바 토크 > 게시글 댓글 관련 수정

게시글 상세

스크린샷 2024-12-14 141344

@cccwon2 cccwon2 added 📦️ Chore 자잘한 수정 🐞 Fix 버그 수정에 대한 커밋 labels Dec 14, 2024
@cccwon2 cccwon2 self-assigned this Dec 14, 2024
@github-actions
Copy link

github-actions bot commented Dec 14, 2024

💄 Storybook: https://673dcf13c9a3a1189a7c6fd4-jqkalbqajq.chromatic.com/ # Chromatic에서 생성된 Storybook URL
🕖 Update: 2024년 12월 14일 14시 21분 06초 # 현재 시간

className="mb-4 h-[132px] w-full lg:h-[160px]"
/>
<div className="mb-12 rounded-lg bg-white p-5">
<div className="mb-4">
Copy link
Collaborator

Choose a reason for hiding this comment

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

mb-12 rounded-lg bg-white p-5를 밑에 div에 추가해도되지않나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

onClick={handleAddComment}
disabled={addComment.isPending || !newComment.trim()}
className="h-[52px] w-[108px] text-base lg:h-[64px] lg:w-[214px] lg:text-xl"
className="h-[52px] w-[108px] rounded-lg text-[14px] font-medium sm:h-[64px] sm:w-[140px]"
Copy link
Collaborator

Choose a reason for hiding this comment

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

sm: 이 필요한가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

수정할께요.


return (
<main className="min-h-screen bg-white py-12">
<div className="min-h-screen bg-white py-12">
Copy link
Collaborator

Choose a reason for hiding this comment

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

여기도 그냥 안쪽 div에 속성 추가하면 되지않을까요?
min-h-screen은 app layout에 적용되어있고 bg는 불필요해보입니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네 바깥 div 는 삭제할께요.

}
return lastPage.nextCursor;
},
getNextPageParam: (lastPage) => lastPage.nextCursor,
Copy link
Collaborator

Choose a reason for hiding this comment

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

이 부분이 무한스크롤 에러 원인이었나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. pageParam 누락
    기존 코드에서는 queryFn에서 pageParam을 받아오지 않았습니다
    queryFn: async ({ pageParam }) =>로 수정하여 페이지 파라미터를 제대로 받아오도록 했습니다

  2. getNextPageParam 로직 미흡
    기존에는 단순히 lastPage.nextCursor만 반환했습니다
    데이터가 없거나 nextCursor가 없는 경우에 대한 처리가 없었습니다
    if (!lastPage.nextCursor || lastPage.data.length === 0) return undefined를 추가하여 더 이상 불러올 데이터가 없을 때 무한 로딩을 방지합니다

  3. 불필요한 파라미터 제거
    cursor 파라미터를 props에서 제거하고 pageParam으로 대체했습니다
    limit에 기본값 10을 설정했습니다

  4. 에러 처리 추가
    toast 메시지를 추가하여 사용자에게 에러 상황을 알립니다
    에러가 발생했을 때 적절한 처리를 할 수 있도록 했습니다

@cccwon2 cccwon2 changed the title fix: 무한 스크롤 에러 수정 fix: 무한 스크롤 에러 수정 등 Dec 14, 2024
@cccwon2 cccwon2 added the 🔨 Refactor 코드 리팩토링 label Dec 14, 2024
Copy link
Collaborator

@hongggyelim hongggyelim 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

@yyezzzy yyezzzy left a comment

Choose a reason for hiding this comment

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

확인했습니다 ~

@yyezzzy yyezzzy merged commit 48bd645 into dev Dec 14, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📦️ Chore 자잘한 수정 🐞 Fix 버그 수정에 대한 커밋 🔨 Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants