Skip to content

Commit

Permalink
feat: 저장한 제품이 없을 경우 처리 #204
Browse files Browse the repository at this point in the history
  • Loading branch information
seoye0ng committed Feb 23, 2024
1 parent 056f274 commit e58442a
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions src/app/favorite/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ function FavoritePage() {

const { favoriteList, hasNextPage, loadMore } = useFavoriteList();

// TODO: 저장한 제품이 없을 경우 디자인 필요

return (
<>
<div className={cx('headerTitleContainer')}>
Expand All @@ -55,19 +57,23 @@ function FavoritePage() {
/>
</div>
</div>
<InfiniteScroll
dataLength={favoriteList?.length ?? 0}
next={loadMore}
hasMore={hasNextPage}
loader={<div className="loader" key={0}>Loading ...</div>}
inverse={false}
>
<div className={cx('productArticleWrapper')}>
{favoriteList.map((item) => {
return <ProductArticle key={item.productNo} itemData={item} />;
})}
</div>
</InfiniteScroll>
{favoriteList.length === 0
? <p>저장한 제품이 없습니다.</p>
: (
<InfiniteScroll
dataLength={favoriteList?.length ?? 0}
next={loadMore}
hasMore={hasNextPage}
loader={<div className="loader" key={0}>Loading ...</div>}
inverse={false}
>
<div className={cx('productArticleWrapper')}>
{favoriteList.map((item) => {
return <ProductArticle key={item.productNo} itemData={item} />;
})}
</div>
</InfiniteScroll>
)}
</main>
<BottomNav />
</>
Expand Down

0 comments on commit e58442a

Please sign in to comment.