-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat/#192]: 책정보 없는경우 대체 ui 적용 #193
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
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
693c411
[Feat/#192]: 프로필 피드 아이템 적용
SebellKo 3f8ba47
[Feat/#192]: BookInfo 대체 ui 적용
SebellKo 2e6e6d8
[Feat/#192]: 우물 아이템 대체 ui 적용
SebellKo bed0903
[Feat/#192]: 피드 > 책정보 대체 ui 적용
SebellKo f5a61e3
[Fix/#192]: 분기 추가
SebellKo 1632a45
[Chore/#192]: 이미지 로직 수정
SebellKo 6bfc25f
[Chore/#192]: 대체 텍스트 변경
SebellKo ee2ad8a
[Chore/#192]: empty 로직 변경
SebellKo fb9776d
[Fix/#192]: 린트에러 해결
SebellKo a99c6bd
Merge branch 'dev' into feat/#192
SebellKo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,17 +25,22 @@ function BookInfo({ | |
| hasToolTip = true, | ||
| }: Props) { | ||
| const { bookData } = useBook(feedData.isbn); | ||
|
|
||
| if (!bookData) return null; | ||
|
|
||
| const fallbackCategory = 'cartoon'; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 디자인 시안상 fallback ui 색상이 cartoon이라 이걸로 적용했습니다. |
||
|
|
||
| const { title, author, publisher, category, image } = bookData; | ||
|
|
||
| return ( | ||
| <div className='pt-[30px]'> | ||
| <div | ||
| className={`relative flex h-fit w-full gap-[16px] rounded-t-[20px] bg-category-bg-${category} px-page pt-[24px]`} | ||
| className={`relative flex h-fit w-full gap-[16px] rounded-t-[20px] bg-category-bg-${category || fallbackCategory} px-page pt-[24px]`} | ||
| > | ||
| {hasToolTip && ( | ||
| <div className={`tooltip-feed border-b-category-bg-${category}`} /> | ||
| <div | ||
| className={`tooltip-feed border-b-category-bg-${category || fallbackCategory}`} | ||
| /> | ||
| )} | ||
| <div className='flex'> | ||
| <Image | ||
|
|
@@ -54,19 +59,23 @@ function BookInfo({ | |
| > | ||
| <div className='flex w-full flex-col gap-[4px]'> | ||
| <h5 | ||
| className={`line-clamp-1 w-full text-body-lg-bold text-category-text-${category}`} | ||
| className={`line-clamp-1 w-full text-body-lg-bold text-category-text-${category || fallbackCategory}`} | ||
| > | ||
| {title} | ||
| {title || '책 정보 불러오는 중...'} | ||
| </h5> | ||
| <ul | ||
| className={`line-clamp-1 flex text-caption-bold text-category-text-${category}`} | ||
| className={`line-clamp-1 flex text-caption-bold text-category-text-${category || fallbackCategory}`} | ||
| > | ||
| <li className="after:content-['|']"> | ||
| <span className='pr-[6px]'>{author}</span> | ||
| </li> | ||
| <li> | ||
| <span className='pl-[6px]'>{publisher}</span> | ||
| </li> | ||
| {title && ( | ||
| <> | ||
| <li className='after:content-["|"]'> | ||
| <span className='pr-[6px]'>{author}</span> | ||
| </li> | ||
| <li> | ||
| <span className='pl-[6px]'>{publisher}</span> | ||
| </li> | ||
| </> | ||
| )} | ||
| </ul> | ||
| </div> | ||
| <div className='w-full'> | ||
|
|
@@ -86,8 +95,8 @@ function BookInfo({ | |
| ) : ( | ||
| <Rating | ||
| rating={!isGetMemoRes(feedData) ? feedData.rating : null} | ||
| textClass={`text-heading-lg-bold text-category-text-${category}`} | ||
| categoryId={category} | ||
| textClass={`text-heading-lg-bold text-category-text-${category || fallbackCategory}`} | ||
| categoryId={category || fallbackCategory} | ||
| /> | ||
| )} | ||
| </div> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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'; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기도 마찬가지로 디자인 시안상 fallback ui 카테고리가 이거여서 이걸로 설정했습니다. |
||
|
|
||
| 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 && ( | ||
| <div | ||
|
|
@@ -99,7 +100,9 @@ function WellItem({ | |
| /> | ||
| )} | ||
| <Image | ||
| src={CATEGORY[category].wave} | ||
| src={ | ||
| category ? CATEGORY[category].wave : CATEGORY[fallbackCategory].wave | ||
| } | ||
| alt='wave' | ||
| width={392} | ||
| height={12} | ||
|
|
@@ -108,21 +111,24 @@ function WellItem({ | |
| /> | ||
| {isReading && ( | ||
| <WellBubble | ||
| fill={CATEGORY[category].band} | ||
| fill={CATEGORY[category || fallbackCategory].band} | ||
| className='absolute left-[24px] top-[8px]' | ||
| /> | ||
| )} | ||
| {hasMemo && ( | ||
| <MemoLeaf bg={CATEGORY[category].text} line={CATEGORY[category].bg} /> | ||
| <MemoLeaf | ||
| bg={CATEGORY[category || fallbackCategory].text} | ||
| line={CATEGORY[category || fallbackCategory].bg} | ||
| /> | ||
| )} | ||
| <span | ||
| className={`text-category-text-${category} truncate text-center text-body-sm-bold ${isReading || hasMemo ? 'w-[65%]' : 'w-[90%]'}`} | ||
| className={`text-category-text-${category || fallbackCategory} truncate text-center text-body-sm-bold ${isReading || hasMemo ? 'w-[65%]' : 'w-[90%]'}`} | ||
| > | ||
| {title} | ||
| {title || '책 정보 불러오는 중...'} | ||
| </span> | ||
| </motion.div> | ||
| <div | ||
| className={`absolute h-[20px] w-full bg-category-bg-${category} bottom-0 left-0 z-0`} | ||
| className={`absolute h-[20px] w-full bg-category-bg-${category || fallbackCategory} bottom-0 left-0 z-0`} | ||
| /> | ||
| <AnimatePresence> | ||
| {isFirstMemo && ( | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
author가 unknown으로 렌더링 되는 경우도 있어서 title이 없는 경우를 empty 상태로 판단했습니다.