Skip to content

Commit

Permalink
fix: 뒤로가기 모달 버튼 순서변경
Browse files Browse the repository at this point in the history
  • Loading branch information
hwanheejung committed Jan 10, 2025
1 parent 6878408 commit ab6bfc2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/app/board/[boardId]/decorate/_components/GoBackModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ const GoBackModal = ({ isOpen, onClose, goBack }: GoBackModalProps) => (
}
</Modal.Content>
<Modal.CenterConfirmCancel
confirmText="계속 꾸미기"
cancelText="뒤로 가기"
onCancel={goBack}
confirmText="뒤로 가기"
cancelText="계속 꾸미기"
onConfirm={goBack}
/>
</Modal.CenterModal>
</Modal>
Expand Down
13 changes: 3 additions & 10 deletions src/components/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,31 +202,24 @@ const CenterConfirmCancel = ({
cancelText,
confirmText,
onConfirm = () => {},
onCancel = () => {},
}: {
cancelText: string
confirmText: string
onConfirm?: () => void
onCancel?: () => void
}) => {
const { onClose } = useContext(ModalContext)

const confirmHandler = () => {
const clickHandler = () => {
onClose()
onConfirm()
}

const cancelHandler = () => {
onClose()
onCancel()
}

return (
<div className="my-4 flex gap-1.5">
<Button variant="secondary" size="sm" onClick={cancelHandler}>
<Button variant="secondary" size="sm" onClick={onClose}>
{cancelText}
</Button>
<Button variant="primary" size="sm" onClick={confirmHandler}>
<Button variant="primary" size="sm" onClick={clickHandler}>
{confirmText}
</Button>
</div>
Expand Down

0 comments on commit ab6bfc2

Please sign in to comment.