Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/components/guestbook/GuestBookWrite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const GuestBookWrite = ({ onSubmitted }: Props) => {
<div className="relative flex flex-col w-[82%] max-w-[280px] p-[18px]">
{/* To */}
<div className="flex gap-[4px] items-center">
<p className="text-[20px]">To.</p>
<p className="text-[20px] font-['Butler'] ">To.</p>
<input
type="text"
placeholder="λ°›λŠ” μ‚¬λžŒ"
Expand All @@ -72,7 +72,9 @@ const GuestBookWrite = ({ onSubmitted }: Props) => {
{/* From */}
<div className="flex items-center w-full box-border">
<div className="flex items-center gap-[4px] flex-1 min-w-0">
<p className="text-[20px] whitespace-nowrap">From.</p>
<p className="text-[20px] font-['Butler'] whitespace-nowrap">
From.
</p>
<input
type="text"
placeholder="λ³΄λ‚΄λŠ” μ‚¬λžŒ"
Expand All @@ -92,7 +94,7 @@ const GuestBookWrite = ({ onSubmitted }: Props) => {

<button
onClick={handleSubmit}
className={`w-full max-w-[328px] h-[48px] rounded-[40px] text-[#FFF] text-center text-[20px] font-bold ${isFilled ? 'bg-[#56493A] cursor-pointer' : 'bg-[#DDD]'}`}
className={`w-full max-w-[328px] h-[48px] rounded-[40px] text-[#FFF] text-center text-[20px] font-['Butler'] font-bold ${isFilled ? 'bg-[#56493A] cursor-pointer' : 'bg-[#DDD]'}`}
>
Send
</button>
Expand Down
8 changes: 5 additions & 3 deletions src/pages/GuestBookPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const GuestBookPage = () => {
const [showModal, setShowModal] = useState(false)
const [modalContent, setModalContent] = useState('')

const { items, totalPages, reload } = useGuestbook({
const { items, totalPages } = useGuestbook({
page: currentPage,
size: PAGE_SIZE,
keyword,
Expand All @@ -33,14 +33,12 @@ const GuestBookPage = () => {
const handleSubmitted = (fromName: string) => {
setKeyword('')
setCurrentPage(1)
reload()
setModalContent(`${fromName} ν•™μƒμ—κ²Œ\nμ†Œμ€‘ν•œ 마음이 μ „λ‹¬λμŠ΅λ‹ˆλ‹€.`)
setShowModal(true)
}

const triggerSearch = () => {
setCurrentPage(1)
reload()
}

const closeModal = useCallback(() => setSelected(null), [])
Expand All @@ -61,6 +59,10 @@ const GuestBookPage = () => {
}
}, [selected, closeModal])

useEffect(() => {
setCurrentPage(1)
}, [keyword])

return (
<div className="flex flex-col">
<GuestBookWrite onSubmitted={handleSubmitted} />
Expand Down