diff --git a/src/components/Book/BookInfo.tsx b/src/components/Book/BookInfo.tsx index 3e7f00d9..a0b12691 100644 --- a/src/components/Book/BookInfo.tsx +++ b/src/components/Book/BookInfo.tsx @@ -20,6 +20,7 @@ interface Props { /** 도서 상세 페이지, 리뷰/메모 리스트 내 도서 정보 컴포넌트 (도서 커버, 배경 포함) */ function BookInfo({ bookId, bookData, canClick = false }: Props) { const isInFeed = useIsInFeed(); + const isEmpty = !bookData.title; return ( - +
-

{bookData?.title}

- - {bookData?.author} | {bookData?.publisher} - + {isEmpty && ( + <> + + ... + +

+ 책 정보 불러오는 중... +

+ + )} + {!isEmpty && ( + <> +

+ {bookData?.title} +

+ + {bookData?.author} | {bookData?.publisher} + + + )}
); diff --git a/src/features/Feed/components/FeedList/BookInfo.tsx b/src/features/Feed/components/FeedList/BookInfo.tsx index d25da0a0..419a1991 100644 --- a/src/features/Feed/components/FeedList/BookInfo.tsx +++ b/src/features/Feed/components/FeedList/BookInfo.tsx @@ -25,17 +25,22 @@ function BookInfo({ hasToolTip = true, }: Props) { const { bookData } = useBook(feedData.isbn); + if (!bookData) return null; + const fallbackCategory = 'cartoon'; + const { title, author, publisher, category, image } = bookData; return (
{hasToolTip && ( -
+
)}
- {title} + {title || '책 정보 불러오는 중...'}
    -
  • - {author} -
  • -
  • - {publisher} -
  • + {title && ( + <> +
  • + {author} +
  • +
  • + {publisher} +
  • + + )}
@@ -86,8 +95,8 @@ function BookInfo({ ) : ( )}
diff --git a/src/features/Profile/components/Feed/ProfileFeedItem.tsx b/src/features/Profile/components/Feed/ProfileFeedItem.tsx index bbb4a6e0..1b62fdd7 100644 --- a/src/features/Profile/components/Feed/ProfileFeedItem.tsx +++ b/src/features/Profile/components/Feed/ProfileFeedItem.tsx @@ -6,6 +6,7 @@ import React from 'react'; import { getPath } from '@/utils/getPath'; import { useUserId } from '@/store/sessionStore'; import { useCustomRouter } from '@/hooks/useCustomRouter'; +import { IMAGES } from '@/constants/images'; interface Props { feedData: GetProfileFeedItem; @@ -23,16 +24,16 @@ function ProfileFeedItem({ feedData }: Props) {
- {CATEGORY[category].name} + {category ? CATEGORY[category].name : '...'}
book cover navigate(getPath.rootUserMemo(userId!, wellId!, isbn), { from: 'profile', diff --git a/src/features/Well/components/Well/WellItem/WellItem.tsx b/src/features/Well/components/Well/WellItem/WellItem.tsx index e5a19213..c7eb984f 100644 --- a/src/features/Well/components/Well/WellItem/WellItem.tsx +++ b/src/features/Well/components/Well/WellItem/WellItem.tsx @@ -51,6 +51,7 @@ function WellItem({ const height = page > 400 ? page * 0.15 : 55; const isReading = status === 'reading'; const hasMemo = memo_cnt > 0; + const fallbackCategory = 'economic_business'; useEffect(() => { let timeoutId: NodeJS.Timeout; @@ -89,7 +90,7 @@ function WellItem({ newItemId === id && isTopItem ? staggerItemVariants : undefined } style={{ zIndex, height }} - className={`flex h-fit w-full bg-category-bg-${category} relative z-auto box-border justify-center pt-[12px]`} + className={`flex h-fit w-full bg-category-bg-${category || fallbackCategory} relative z-auto box-border justify-center pt-[12px]`} > {isLastItem && (
)} wave {isReading && ( )} {hasMemo && ( - + )} - {title} + {title || '책 정보 불러오는 중...'}
{isFirstMemo && (