-
Notifications
You must be signed in to change notification settings - Fork 18
[김원] Sprint 12 #186
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
[김원] Sprint 12 #186
The head ref may contain hidden characters: "Next-\uAE40\uC6D0"
Conversation
dongqui
left a comment
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 { pathname } = request.nextUrl; | ||
|
|
||
| // 인증이 필요한 페이지 목록 (비공개 페이지) | ||
| const privatePages = ["/addArticle", "/addItem"]; |
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.
미들웨어로 인가를 처리하셨군요 👍
| }; | ||
|
|
||
| // 드롭다운 외부 클릭 처리 | ||
| useEffect(() => { |
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.
드랍다운을 컴포넌트화 하고 해당 로직을 넣으면 좀 더 깔끔할 거 같아요!
| setIsEditing(false); | ||
| } catch (error) { | ||
| console.error("댓글 수정 실패:", error); | ||
| setAlertMessage("댓글 수정에 실패했습니다."); |
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.
alert상태를 하나로 관리해보는 것은 어떨까요!? 🤔
| if (isLoading) return; | ||
| // Intersection Observer 설정 | ||
| const observer = useRef<IntersectionObserver | null>(null); | ||
| const lastCommentRef = useCallback( |
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.
observer disconnect할 수 있는 ㅂ부분이 필요하겠네요!
|
|
||
| return ( | ||
| <> | ||
| <div className="py-6 relative"> |
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.
컴포넌화하면 jsx부분도 훨씬 깔끔해질 거 같습니다!
| import { ArticleSchema } from "@/zod/articleSchema"; | ||
| import { ArticleSortOption } from "@/types/article"; | ||
|
|
||
| export const useArticle = () => { |
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.
안티패턴으로 보입니다..!
모든 훅을 한 곳에 모으다보니 사용하지 않은 곳에서도 훅이 실행되죠! 가령 AllArticleSection에서는 useArticles만 필요하지만 아래 모든 훅들이 다 들어가게 됩니다..!
| const { data: articleDetail } = useArticleDetail(articleId); | ||
|
|
||
| // 초기 좋아요 상태 설정 | ||
| useEffect(() => { |
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.
mutation 내부에서 처리하시는 게 좀 더 깔끔할 거 같아요
| }, [productDetail?.images]); | ||
|
|
||
| // 드롭다운 외부 클릭 처리 | ||
| useEffect(() => { |
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.
계속 반복 되는군요 🤣 컴포넌트화를 해보죠!
배포 사이트
https://next-panda-market.vercel.app
기본 요구사항
체크리스트 [기본]
중고마켓
상품 상세
상품 등록
자유게시판
게시글 상세
게시글 등록
체크리스트 [심화]
주요 변경사항
스크린샷
멘토에게