diff --git a/app/components/Common/ConfirmationModal.vue b/app/components/Common/ConfirmationModal.vue index c57b2a9..16111b6 100644 --- a/app/components/Common/ConfirmationModal.vue +++ b/app/components/Common/ConfirmationModal.vue @@ -48,6 +48,7 @@ onUnmounted(() => { diff --git a/app/composables/useConfirmationModal.ts b/app/composables/useConfirmationModal.ts index 32adb3e..983e8fd 100644 --- a/app/composables/useConfirmationModal.ts +++ b/app/composables/useConfirmationModal.ts @@ -15,16 +15,22 @@ const state = useState("confirmationModal", () => modalButtonsYOffset: BUTTONS_MAX_Y_OFFSET, isVisible: false, isClosing: false, + showButtons: true, }), ); -const open = (text: string, onConfirm?: (() => void) | null) => { +const open = ( + options: { + text: string; + } & ({ showButtons?: true; onConfirm: () => void } | { showButtons: false }), +) => { gsap.killTweensOf(state.value); - state.value.text = text; - state.value.onConfirm = onConfirm || null; + state.value.text = options.text; + state.value.onConfirm = options.showButtons ? options.onConfirm : null; state.value.isVisible = true; state.value.isClosing = false; state.value.isOpen = true; + state.value.showButtons = options.showButtons ?? false; gsap .timeline()