From 0b344a38f92fd95788df116eabe22383e3007d47 Mon Sep 17 00:00:00 2001 From: Misung Kim Date: Fri, 20 Sep 2024 14:38:21 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=82=AC=EC=84=9C=20=EB=B3=B8=EC=9D=B8?= =?UTF-8?q?=EC=9D=98=20=EB=8C=80=EC=B6=9C=20=EC=8B=9C,=204=EA=B6=8C?= =?UTF-8?q?=EA=B9=8C=EC=A7=80=20=EA=B0=80=EB=8A=A5=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20lendingLimit=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/rent/Rent.tsx | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/component/rent/Rent.tsx b/src/component/rent/Rent.tsx index 928f42e7..59b9401e 100644 --- a/src/component/rent/Rent.tsx +++ b/src/component/rent/Rent.tsx @@ -21,6 +21,8 @@ const Rent = () => { const { Modal, setOpen: openModal, setClose: closeModal } = useModal(); const user = useRecoilValue(userAtom); + // 사서의 대출권수 4권으로 설정. 사서 본인의 대출건만 4권으로 적용 + const lendingLimit = (user.isAdmin && user.id === selectedUser?.id) ? 4 : 2; return (
@@ -32,7 +34,6 @@ const Rent = () => { titleKO="카뎃 정보" titleEN="Cadet info" /> - {/* 사서인 경우 옆에 표시해주면 좋을 것 같다! */} { /> {selectedBooks.length > 0 ? selectedBooks.map((book, index) => ( - - )) + + )) : null} - {selectedBooks.length < 4 ? ( + {selectedBooks.length < lendingLimit ? (