-
Notifications
You must be signed in to change notification settings - Fork 4
Modal
Jay edited this page May 10, 2025
·
8 revisions
-
iconType에 따라 체크 또는 경고 아이콘이 동적으로 렌더링됩니다. - 버튼 클릭 시 각 콜백 함수(
onClick,onConfirm,onClose) 호출 후closeModal()도 함께 처리됩니다. - 반응형 Tailwind 스타일이 적용되어 있어 모바일/PC 환경에 적절히 대응합니다.
- 단일 버튼을 갖는 알림/메시지용 모달입니다.
| 이름 | 타입 | 설명 |
|---|---|---|
type |
"alert" | "message"
|
메시지 유형 |
iconType? |
"check" | "warning" | "none"
|
아이콘 종류 |
message |
string |
표시할 메시지 |
button |
{ label: string; style: "primary" | "white"; onClick: () => void } |
버튼 정보 |
- 취소/확인 버튼이 있는 확인용 모달입니다.
| 이름 | 타입 | 설명 |
|---|---|---|
iconType? |
"check" | "warning" | "none"
|
아이콘 종류 |
message |
string |
표시할 메시지 |
onClose |
() => void |
취소 시 호출 함수 |
onConfirm |
() => void |
확인 시 호출 함수 |
cancelText |
string |
취소 버튼 텍스트 |
confirmText |
string |
확인 버튼 텍스트 |

Zustand 기반 전역 상태를 통해 알림/확인 모달을 제어합니다.
-
useModalStore()에서isOpen,options,openModal(),closeModal()을 가져옵니다. -
options.type에 따라AlertModalLayout또는ConfirmModalLayout을 내부적으로 조건 렌더링합니다. - Enter 키 이벤트로 확인 동작을 수행합니다. (
handleKeyDown)
openModal({
type: "confirm",
iconType: "warning",
message: "정말 삭제하시겠습니까?",
onConfirm: () => { ... },
onClose: () => { ... },
confirmText: "삭제",
cancelText: "취소"
});

