-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #639 from jiphyeonjeon-42/develop
build: 자잘한 버그 수정, 리렌더링 최적화 배포
- Loading branch information
Showing
27 changed files
with
338 additions
and
214 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
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { memo } from 'react'; | ||
import { Book } from "../../type"; | ||
import BookInformationWithCover from "../utils/BookInformationWithCover"; | ||
import TextWithLabel from "../utils/TextWithLabel"; | ||
import TextareaWithLabel from "../utils/TextareaWithLabel"; | ||
|
||
interface RentModalBooksProps { | ||
selectedBooks: Book[]; | ||
handleRemarkChange: (index: number, value: string) => void; | ||
remarksRef: React.MutableRefObject<string[]>; | ||
} | ||
|
||
const RentModalBooks = ({ selectedBooks, handleRemarkChange, remarksRef }: RentModalBooksProps) => { | ||
return ( | ||
<div className="rent-modal__books"> | ||
{selectedBooks.map((selectBook, index) => ( | ||
<div | ||
key={selectBook.bookId} | ||
className={`rent-modal__book-info ${index}`} | ||
> | ||
<BookInformationWithCover | ||
bookCoverAlt={selectBook.title} | ||
bookCoverImg={selectBook.image} | ||
> | ||
<TextWithLabel | ||
wrapperClassName="rent-modal__book" | ||
topLabelText="도서정보" | ||
mainText={selectBook.title} | ||
bottomLabelText={`청구기호 : ${selectBook.callSign}`} | ||
/> | ||
<TextareaWithLabel | ||
wrapperClassName="rent-modal__remark" | ||
topLabelText="비고" | ||
textareaPlaceHolder="비고를 입력해주세요. (책 상태 등)" | ||
setTextareaValue={(value: string) => handleRemarkChange(index, value)} | ||
isTextareaFocusedOnMount={index === 0} | ||
isVisibleBottomMessage={!remarksRef.current[index]?.length} | ||
bottomMessageText="비고를 입력해주세요" | ||
bottomMessageColor="red" | ||
/> | ||
</BookInformationWithCover> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default memo(RentModalBooks); |
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.