Repository navigation
feature(member): 도서 대출 요청 취소 기능 추가 #48
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
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bdc5393
:recycle: (member) 인증 초기화에 id 저장하는 로직 추가
seoJing 3a8255c
:sparkles: (member) 도서 대출 요청 취소 기능 추가
seoJing 8ff39c6
:sparkles: (member) 도서 대출 요청 취소 토스트 추가
seoJing 7776de4
:bug: (member) lint 오류 수정
seoJing 9298856
:sparkles: (member) 도서 대출 신청 토스트 추가
seoJing 7bca844
:recycle: (member) LoanBookCard type 분리
seoJing 73fc6c0
:recycle: (member) Detail 가독성 수정
seoJing 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
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 |
|---|---|---|
| @@ -1,5 +1,11 @@ | ||
| import type { getBooksDetailResponse, getBooksResponse } from "./api.model"; | ||
| import type { | ||
| getBooksDetailResponse, | ||
| getBooksLoanConditionsResponse, | ||
| getBooksResponse, | ||
| } from "./api.model"; | ||
|
|
||
| export type Book = getBooksResponse["data"]["items"][number]; | ||
|
|
||
| export type BookDetail = getBooksDetailResponse["data"]; | ||
| export type BookLoanCondition = | ||
| getBooksLoanConditionsResponse["data"]["items"][number]; |
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 |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { authApi, END_POINT } from "../config"; | ||
| import type { deleteBookLoanRecordRequest } from "./api.model"; | ||
| import type { BaseApiResponse } from "../config/api-base-types"; | ||
|
|
||
| export const deleteBookLoanRecord = ({ | ||
| bookLoanRecordId, | ||
| }: deleteBookLoanRecordRequest) => | ||
| authApi.del<BaseApiResponse<number>>( | ||
| `${END_POINT.LIBRARY.BOOKS_LOAN}/${bookLoanRecordId}`, | ||
| ); |
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
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 |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import type { ReactNode } from "react"; | ||
|
|
||
| interface EmptyStateProps { | ||
| children: ReactNode; | ||
| } | ||
|
|
||
| export default function EmptyState({ children }: EmptyStateProps) { | ||
| return <p className="text-14-regular text-gray-4 py-lg">{children}</p>; | ||
| } |
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 |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| import type { ReactNode } from "react"; | ||
| import { useNavigate } from "react-router"; | ||
|
|
||
| import type { BookLoanCondition } from "@/api/library/api.type"; | ||
| import { ROUTE } from "@/constants"; | ||
|
|
||
| interface LoanBookCardProps { | ||
| loan: BookLoanCondition; | ||
| action?: ReactNode; | ||
| } | ||
|
|
||
| export default function LoanBookCard({ loan, action }: LoanBookCardProps) { | ||
| const navigate = useNavigate(); | ||
|
|
||
| return ( | ||
| <div className="border-gray-1 flex items-center gap-4 border-b py-3"> | ||
| <div | ||
| className="flex min-w-0 flex-1 cursor-pointer items-center gap-4" | ||
| role="button" | ||
| tabIndex={0} | ||
| onClick={() => navigate(`${ROUTE.LIBRARY}/${loan.bookId}`)} | ||
| onKeyDown={(e) => { | ||
| if (e.key === "Enter" || e.key === " ") { | ||
| e.preventDefault(); | ||
| navigate(`${ROUTE.LIBRARY}/${loan.bookId}`); | ||
| } | ||
| }} | ||
| > | ||
| <div className="bg-gray-1 h-20 w-16 flex-shrink-0 overflow-hidden rounded"> | ||
| {loan.bookImageUrl && loan.bookImageUrl !== "없음" ? ( | ||
| <img | ||
| src={loan.bookImageUrl} | ||
| alt={loan.bookTitle} | ||
| className="h-full w-full object-cover" | ||
| /> | ||
| ) : ( | ||
| <div className="flex h-full w-full items-center justify-center"> | ||
| <span className="text-gray-3 text-12-regular text-center"> | ||
| 이미지 없음 | ||
| </span> | ||
| </div> | ||
| )} | ||
| </div> | ||
| <div className="min-w-0 flex-1"> | ||
| <h3 className="text-14-medium line-clamp-2 text-black"> | ||
| {loan.bookTitle} | ||
| </h3> | ||
| <p className="text-12-regular text-gray-4 mt-1"> | ||
| 신청일: {loan.borrowedAt?.split("T")[0] ?? "-"} | ||
| {loan.dueDate && ( | ||
| <> | ||
| <br /> | ||
| 반납 예정일: {loan.dueDate?.split("T")[0] ?? "-"} | ||
| </> | ||
| )} | ||
| </p> | ||
| </div> | ||
| </div> | ||
| {action && <div className="flex-shrink-0">{action}</div>} | ||
| </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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.