-
Notifications
You must be signed in to change notification settings - Fork 1
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
[#412] [북카이브] 북카이브 페이지 (회원) #436
Changes from all commits
53caca1
3395338
08f3460
8fe6865
355857b
dea1521
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,9 +24,9 @@ const getHeaderLabel = (pathname: string) => { | |
const TopHeader = ({ pathname, children }: TopHeaderProps) => { | ||
return ( | ||
<div className="flex w-full items-center justify-between pb-[0.8rem]"> | ||
<p className="text-xl font-bold text-main-900"> | ||
<h1 className="text-xl font-bold text-main-900"> | ||
{getHeaderLabel(pathname)} | ||
</p> | ||
</h1> | ||
Comment on lines
+27
to
+29
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. 너무 좋은데요?? 👍🏻 |
||
{children} | ||
</div> | ||
); | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ const BookCover = ({ src, title, size = 'medium' }: BookCoverProps) => { | |
const sizeClasses = getCoverSizeClasses(size); | ||
|
||
return ( | ||
<span className={`relative ${sizeClasses}`}> | ||
<div className={`relative ${sizeClasses}`}> | ||
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. @gxxrxn 기존 코드에는 감싸는 요소가 BookCover 컴포넌트가 display:inline 이기 때문에 사용하는 곳에서 크기를 명시적으로 정해줘야하는 문제가 있어서 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. 생각해보니 inline 요소에 크기 속성을 주고 있었군요..🫠 |
||
<Image | ||
src={src} | ||
alt={title} | ||
|
@@ -54,7 +54,7 @@ const BookCover = ({ src, title, size = 'medium' }: BookCoverProps) => { | |
className="object-fit rounded-[0.5rem] shadow-bookcover" | ||
fill | ||
/> | ||
</span> | ||
</div> | ||
); | ||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
'use client'; | ||
|
||
import useAuthRecommendedBooks from '@/queries/recommend/useAuthRecommendedBooks'; | ||
import useAuthRecommendedBookshelf from '@/queries/recommend/useAuthRecommendedBookshelf'; | ||
import { APIJobGroup } from '@/types/job'; | ||
import BookCover from '@/v1/book/BookCover'; | ||
import BookShelfCard from '@/v1/bookShelf/BookShelfCard'; | ||
import Link from 'next/link'; | ||
|
||
const BookArchiveForAuth = ({ | ||
userJobGroup, | ||
}: { | ||
userJobGroup: APIJobGroup['name']; | ||
}) => { | ||
const { | ||
data: bookshelfData, | ||
isSuccess: bookshelfIsSuccess, | ||
isLoading: bookshelfIsLoading, | ||
} = useAuthRecommendedBookshelf(userJobGroup); | ||
const { | ||
data: booksData, | ||
isSuccess: booksIsSuccess, | ||
isLoading: booksIsLoading, | ||
} = useAuthRecommendedBooks(userJobGroup); | ||
|
||
const isSuccess = bookshelfIsSuccess && booksIsSuccess; | ||
const isLoading = bookshelfIsLoading && booksIsLoading; | ||
|
||
if (isLoading) { | ||
// TODO: 스켈레톤 컴포넌트로 교체 | ||
return null; | ||
} | ||
|
||
if (!isSuccess) return null; | ||
if (!bookshelfData || !booksData) return null; | ||
|
||
return ( | ||
<div className="flex w-full flex-col gap-[1.5rem] text-md font-bold"> | ||
<h2>👀 이런 책들이 많이 꽂혔어요</h2> | ||
<ul className="flex gap-[1.5rem] overflow-auto"> | ||
{booksData.books.map(({ bookId, imageUrl, title }) => ( | ||
<li key={bookId} className="max-w-[9rem]"> | ||
<Link href={`/book/${bookId}`} className="flex flex-col gap-[1rem]"> | ||
<BookCover src={imageUrl} title={title} size="large" /> | ||
<span className="line-clamp-2 break-keep text-center text-xs font-normal leading-tight"> | ||
{title} | ||
</span> | ||
</Link> | ||
</li> | ||
))} | ||
</ul> | ||
<h2>🔥 인기 책장</h2> | ||
{...bookshelfData.bookshelfResponses.map(bookShelf => ( | ||
<BookShelfCard key={bookShelf.bookshelfId} {...bookShelf} /> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default BookArchiveForAuth; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use client'; | ||
|
||
import useUnAuthRecommendedBookshelfQuery from '@/queries/recommend/useUnAuthRecommendedBookshelfQuery'; | ||
import BookShelfCard from '@/v1/bookShelf/BookShelfCard'; | ||
|
||
const BookArchiveForUnAuth = () => { | ||
const { data, isSuccess, isLoading } = useUnAuthRecommendedBookshelfQuery(); | ||
|
||
if (isLoading) { | ||
// TODO: 스켈레톤 컴포넌트로 교체 | ||
return null; | ||
} | ||
if (!isSuccess) return null; | ||
|
||
return ( | ||
<div className="flex w-full flex-col gap-[1.5rem] text-md font-bold"> | ||
<h2>🔥 인기 책장</h2> | ||
{...data.bookshelfResponses.map(bookShelf => ( | ||
<BookShelfCard key={bookShelf.bookshelfId} {...bookShelf} /> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default BookArchiveForUnAuth; |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,50 @@ | ||
'use client'; | ||
|
||
import { APIBook } from '@/types/book'; | ||
import ColorThief from 'colorthief'; | ||
import Image from 'next/image'; | ||
import { APIBookshelf } from '@/types/bookshelf'; | ||
import { IconArrowRight, IconHeart } from '@public/icons'; | ||
import Link from 'next/link'; | ||
import Badge from '@/ui/Base/Badge'; | ||
import Image from 'next/image'; | ||
import { APIBook } from '@/types/book'; | ||
import { useState } from 'react'; | ||
import ColorThief from 'colorthief'; | ||
|
||
const BookShelf = ({ | ||
bookshelfId, | ||
bookshelfName, | ||
books, | ||
likeCount, | ||
}: APIBookshelf) => { | ||
Comment on lines
+10
to
+15
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. comment; 현재 이후 마크업 및 API연동은 잘 구현해 주신것같아요! 고생하셨어요!! 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. @hanyugeon 재현님 의견에 동의해요. 북카이브와 책장 페이지에서 보여지는 모습이 미세하게 달라서 어떻게 추상화를 할 지 고민하다가 우선 작업 목적에 맞게끔 구현해두었어요. |
||
return ( | ||
<div className="relative rounded-[2rem] pb-[2.5rem] pt-[2rem] shadow-[0px_0px_10px_0px_#D1D1D1]"> | ||
<div className="absolute bottom-0 w-full"> | ||
<div className="h-[3rem] bg-[#F2ECDF] shadow-[0px_-3px_8px_0px_#F1F1F1_inset]" /> | ||
<div className="h-[1rem] rounded-b-[2rem] bg-[#F6F3EC] shadow-[0px_-1px_8px_-4.5px_#494949]" /> | ||
</div> | ||
<div className="flex flex-col gap-[2.6rem] bg-white px-[2rem]"> | ||
<div className="flex flex-col gap-[1rem]"> | ||
<div className="flex items-center justify-between"> | ||
<div className="text-md font-bold">{bookshelfName}</div> | ||
<Link href={`/bookshelf/${bookshelfId}`}> | ||
<IconArrowRight width="1.8rem" height="1.8rem" /> | ||
</Link> | ||
</div> | ||
<Badge colorScheme="red" fontWeight="bold" size="small"> | ||
<div className="flex items-center gap-[0.4rem]"> | ||
<IconHeart fill="white" height="1.3rem" w="1.3rem" /> | ||
<div className="bold text-xs">{likeCount}</div> | ||
</div> | ||
</Badge> | ||
</div> | ||
<ul className="flex justify-between px-[0.5rem]"> | ||
{books.map(book => ( | ||
<li key={book.bookId} className="flex"> | ||
<Book {...book} /> | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
const Book = ({ | ||
imageUrl, | ||
|
@@ -64,4 +104,4 @@ const Book = ({ | |
); | ||
}; | ||
|
||
export default Book; | ||
export default BookShelf; |
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.
p3;
현재
Component/ContextProvider.tsx
에<Layout />
부분이 새로 만든 레이아웃으로 교체되지 않았습니다만약 그부분이 교체된다면
<TopHeader />
컴포넌트와 감싸고 있는<div>
요소는 따로 필요하지 않을 것 같아요!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.
@hanyugeon 혹시 이 부분이 오늘 스크럼 때 이야기 했던 내용과 연결되는 건가요?
ContextProvider
에서 사용되는Layout
컴포넌트가 교체되어야 한다는 말씀이신가요? 👀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.
@minjongbaek
다시 검토해보니 아직 BottomNavigation에 BottomSheet를 띄우는 이벤트가 적용되지않아 부자연스러움이 있네요...!
나중에 새로운 이슈를 통해 일괄적으로 적용하는게 좋을 것 같아 보이네요.
이 부분은 나중에 수정해봅시다!!
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.
@hanyugeon 확인했습니다. 다시 리뷰 부탁드려요~
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.
@minjongbaek @hanyugeon
재현님이 작업하신 Layout 컴포넌트에
TopHeader
컴포넌트가 포함되어있어서 해당 페이지에서는 제거하면 좋을 것 같다는 뜻으로 이해했어요!그런데 문득.. layout에 TopHeader 컴포넌트가 포함되어있는게 어색한것 같기두 하네요..!! 모든 페이지에서 TopHeader가 노출되는 것이 아니기 때문에 매번 pathname을 비교해서 일부 페이지에서만 렌더링하는 것도 비효율적인 것 같다는 생각이 들어요. 혹시 이전에 이와 관련해서 이야기를 나눴던 적이 있을까요? 제가 놓친거라면 죄송해요..🥺
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.
@gxxrxn @hanyugeon
아 재현님이 남긴 코멘트를 이제서야 제대로 이해한 것 같아요 😅
이전에 이야기 했을 때는 layout 에
TopHeader
컴포넌트를 포함하는 방향으로 작업하자고 했던 것 같아요. 이와 관련해서는 이번 주 회의 시간에 다시 이야기 해보는건 어떨까요? 👀