-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 3d 책 컴포넌트 placeholder 적용 - global css에 bg-blur 클래스 추가 * feat: 책장 상세정보 query suspense 적용 - 책장페이지 ssr 되도록 컴포넌트 분리 * style: 책장 padding 수정 * style: BookShelf.Book 컴포넌트 패딩 1 -> 1.5rem으로 수정 * chore: 불필요한 prop, 태그 제거
- Loading branch information
Showing
6 changed files
with
156 additions
and
99 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1,15 +1,20 @@ | ||
import bookshelfAPI from '@/apis/bookshelf'; | ||
import { UseQueryOptions } from '@tanstack/react-query'; | ||
import { APIBookshelfInfo } from '@/types/bookshelf'; | ||
import { useQuery } from '@tanstack/react-query'; | ||
import useQueryWithSuspense from '@/hooks/useQueryWithSuspense'; | ||
import bookshelfAPI from '@/apis/bookshelf'; | ||
import bookShelfKeys from './key'; | ||
|
||
const useBookShelfInfoQuery = ({ | ||
bookshelfId, | ||
}: { | ||
bookshelfId: APIBookshelfInfo['bookshelfId']; | ||
}) => | ||
useQuery(bookShelfKeys.info(bookshelfId), () => | ||
bookshelfAPI.getBookshelfInfo(bookshelfId).then(response => response.data) | ||
const useBookShelfInfoQuery = <TData = APIBookshelfInfo>( | ||
bookshelfId: APIBookshelfInfo['bookshelfId'], | ||
options?: UseQueryOptions<APIBookshelfInfo, unknown, TData> | ||
) => | ||
useQueryWithSuspense( | ||
bookShelfKeys.info(bookshelfId), | ||
() => | ||
bookshelfAPI | ||
.getBookshelfInfo(bookshelfId) | ||
.then(response => response.data), | ||
options | ||
); | ||
|
||
export default useBookShelfInfoQuery; |
This file contains 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 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
Oops, something went wrong.