-
Notifications
You must be signed in to change notification settings - Fork 0
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 #122 from DDD-Community/feature/119
[Feature/119] 폴라로이드 상세 Carousel, 폴라로이드 삭제
- Loading branch information
Showing
13 changed files
with
232 additions
and
43 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 14 additions & 12 deletions
26
src/app/board/[boardId]/_components/PolaroidList/index.tsx
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
51 changes: 51 additions & 0 deletions
51
src/components/Polaroid/PolaroidDetail/PolaroidDeleteBtn.tsx
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,51 @@ | ||
'use client' | ||
|
||
import Modal from '@/components/Modal' | ||
import Icon from 'public/icons/polaroid_fire.svg' | ||
import TrashIcon from 'public/icons/trash.svg' | ||
import { useState } from 'react' | ||
|
||
interface PolaroidDeleteBtnProps { | ||
onDetailModalClose: () => void | ||
onDelete: () => void | ||
} | ||
|
||
const PolaroidDeleteBtn = ({ | ||
onDetailModalClose, | ||
onDelete, | ||
}: PolaroidDeleteBtnProps) => { | ||
const [showDeleteModal, setShowDeleteModal] = useState<boolean>(false) | ||
|
||
const handleDelete = () => { | ||
onDelete() // delete polaroid | ||
setShowDeleteModal(false) // close delete modal | ||
onDetailModalClose() // close polaroid detail modal | ||
} | ||
|
||
return ( | ||
<> | ||
<button | ||
type="button" | ||
onClick={() => setShowDeleteModal(true)} | ||
className="mx-auto rounded-full bg-gray-800 p-2.5" | ||
aria-label="Delete" | ||
> | ||
<TrashIcon className="cursor-pointer text-gray-0" /> | ||
</button> | ||
<Modal isOpen={showDeleteModal} onClose={() => setShowDeleteModal(false)}> | ||
<Modal.CenterModal icon={<Icon />}> | ||
<Modal.Close /> | ||
<Modal.Title>정말로 삭제하시겠습니까?</Modal.Title> | ||
<Modal.Content>삭제된 폴라로이드는 되돌릴 수 없어요.</Modal.Content> | ||
<Modal.CenterConfirmCancel | ||
cancelText="아니요" | ||
confirmText="예" | ||
onConfirm={handleDelete} | ||
/> | ||
</Modal.CenterModal> | ||
</Modal> | ||
</> | ||
) | ||
} | ||
|
||
export default PolaroidDeleteBtn |
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,36 @@ | ||
import { Polaroid } from '@/types' | ||
import PolaroidDescription from '../Base/PolaroidDescription' | ||
import PolaroidFrame from '../Base/PolaroidFrame' | ||
import PolaroidImage from '../Base/PolaroidImage' | ||
import PolaroidMessage from '../Base/PolaroidMessage' | ||
import PolaroidNickname from '../Base/PolaroidNickname' | ||
|
||
interface PolaroidItemProps { | ||
polaroid: Polaroid | ||
} | ||
|
||
const PolaroidItem = ({ polaroid }: PolaroidItemProps) => { | ||
return ( | ||
<PolaroidFrame | ||
className="mx-auto flex w-[272px] touch-pinch-zoom flex-col overflow-y-hidden" | ||
themaKey={polaroid.options.THEMA} | ||
fontKey={polaroid.options.FONT} | ||
> | ||
<div className="mt-5 px-3"> | ||
<PolaroidImage imageUrl={polaroid.imageUrl} /> | ||
</div> | ||
<PolaroidDescription themaKey={polaroid.options.THEMA}> | ||
<PolaroidMessage | ||
className="min-h-6 text-xl" | ||
message={polaroid.oneLineMessage} | ||
/> | ||
<PolaroidNickname | ||
className="min-h-5 text-lg" | ||
nickName={polaroid.nickname} | ||
/> | ||
</PolaroidDescription> | ||
</PolaroidFrame> | ||
) | ||
} | ||
|
||
export default PolaroidItem |
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
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