-
Notifications
You must be signed in to change notification settings - Fork 3
[feat/#76] products api 연동 및 더보기 버튼 핸들러 추가 #90
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
✅ 빌드에 성공했습니다! 🎉 |
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.
src/pages/home/Home.tsx
Outdated
const searchedList = useMemo(() => { | ||
return productListData?.productMainInfos ?? []; | ||
}, [productListData]); |
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.
여기 useMemo로 감싼 이유가 있나요?
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.
단순한 값이라 불필요하지 않을까 했는데, 사용하신 기준이 궁금합니다
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.
수정했습니다!
src/pages/home/Home.tsx
Outdated
/> | ||
))} | ||
</div> | ||
{!isProductListLoading && !isProductListError && ( |
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.
Loading이랑 error일때 렌더링 처리도 고려하면 더 좋을 것 같아요!
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 handleShowMore = () => { | ||
setVisibleCount(prev => prev + 9); | ||
}; |
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.
더보기 처리너무 깔끔하고 좋아요 👍
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(() => { | ||
if (!isLoading) { | ||
const filtered = productList.filter(card => card.categoryList.includes(selectedTag)); | ||
setFilteredCards(filtered); | ||
} | ||
}, [productList, selectedTag, isLoading]); |
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.
선택된 태그와 리스트에 따라 필터링된 데이터를 상태로 관리하는 로직인가요? filteredCards는 이미 productList와 selectedTag에서 계산된 결과라, 별도의 상태가 아닌 렌더링 시점에 계산하는게 직관적인 것 같은데 useEffect에 추가적인 state값으로 작성하신 이유가 있나요? 동일한 값에 대해 계속해서 필터링 함수를 적용해야 한다면 오히려 useMemo도 사용해 볼 수 있을것 같아요.
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.
넵넵!!
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.
useMemo로 바꾸겠습니당
✅ 빌드에 성공했습니다! 🎉 |
✅ 빌드에 성공했습니다! 🎉 |
✅ 빌드에 성공했습니다! 🎉 |
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.
최고인데요???
src/pages/home/Home.tsx
Outdated
@@ -6,13 +7,90 @@ import Banner from '@/../public/img/banner_familymonth.png'; | |||
import Tag from '@/pages/home/components/Tag'; | |||
import Text from '@shared/components/text/Text'; | |||
import Card from '@shared/components/card/Card'; | |||
import CardSkeleton from '@shared/components/card/CardSkeleton'; | |||
import ProductActionButton from '@shared/components/ProductActionButton/ProductActionButton'; | |||
import { useGetProductList } from '@api/queries'; | |||
import { dummyCardsL } from '@/pages/home/mockHomeData'; |
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 handleShowMore = () => { | ||
setVisibleCount(prev => prev + 9); | ||
}; |
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.
진짜 깔끔함👍
✅ 빌드에 성공했습니다! 🎉 |
📌 Related Issues
✅ 체크 리스트
📄 Tasks
⭐ PR Point (To Reviewer)
📷 Screenshot
🔔 ETC