-
Notifications
You must be signed in to change notification settings - Fork 40
[강수민] Sprint12 #344
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
[강수민] Sprint12 #344
The head ref may contain hidden characters: "Next-\uAC15\uC218\uBBFC-sprint12"
Conversation
jyh0521
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 imgUrl = files[0]; | ||
| const imgPath = URL.createObjectURL(imgUrl); | ||
| setImg(imgPath); | ||
| setImg(imgUrl); |
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.
imgUrl을 사용하는 곳이 한 군데 뿐이라면 따로 변수를 만들지 않고 setImg(files[0]) 이런식으로 작성하셔도 됩니다.
| localStorage.removeItem("accessToken"); | ||
| localStorage.removeItem("refreshToken"); | ||
| localStorage.removeItem("userId"); |
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.
localStorage의 키 값들도 상수로 관리해주셔도 좋습니다.
| images: u_images, | ||
| name: u_name, | ||
| description: u_description, | ||
| price: u_price, | ||
| tags: u_tags, |
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.
여기도 카멜 케이스 그대로 활용해주셔도 괜찮습니다. uImages, uName 이런식으로요!
| </div> | ||
| </div> | ||
| </div> | ||
| <Modal isOpen={isOpen} closeModal={handleCloseModal}> |
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.
모달 컴포넌트 내부의 코드가 은근히 길어져서 따로 컴포넌트로 만드셔서 사용해주셔도 좋습니다.
|
|
||
| interface DropDownInquiryProps { | ||
| setIsEditting: (value: boolean) => void; | ||
| onDelete: () => void; |
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.
setState 하는 함수 대신 handler 함수를 받아오게 하신 점 좋네요~ 더 유연하게 사용할 수 있을 것 같습니다.
| const { data } = useQuery({ | ||
| queryKey: ["products", currentPage, productsPerPage, order, keyword], | ||
| queryFn: () => | ||
| fetchProducts({ |
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.
fetchProducts 함수를 사용하는 useQuery가 또 있는 것 같은데, 두 경우 모두 사용할 수 있는 훅을 만들어보는 것은 어떨까요?
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.
모달 컴포넌트 잘 만들어주셨네요!
| // 추후 POST API 연동 예정 | ||
| // console.log(e); | ||
| postProduct({ content: userInput }); | ||
| const { id } = await postProduct({ content: userInput }); |
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.
post 하는 함수는 useMutation 함수를 활용해보시면 어떨까요?
| onUpdate={() => {}} | ||
| onDelete={() => {}} |
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.
아직 handler 함수가 개발되지 않은 것이라면 괜찮지만, 그게 아니라 만약 빈 함수를 넣어야 하는 상황이라면 해당 컴포넌트의 핸들러 함수들을 nullable하게 타입 지정해주시는 것도 좋을 것 같습니다.
요구사항
기본
중고마켓
상품 상세
상품 등록
심화
주요 변경사항
스크린샷
판다마켓
멘토에게