mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 06:58:46 +00:00
ActionModal 레이아웃 및 Props 이름 관련 리팩토링
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
confirmText: string;
|
||||
isOpen: boolean;
|
||||
onbeforeclose?: () => void;
|
||||
onconfirm: ConfirmHandler;
|
||||
onConfirmClick: ConfirmHandler;
|
||||
title: string;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
confirmText,
|
||||
isOpen = $bindable(),
|
||||
onbeforeclose,
|
||||
onconfirm,
|
||||
onConfirmClick,
|
||||
title,
|
||||
}: Props = $props();
|
||||
|
||||
@@ -32,15 +32,17 @@
|
||||
};
|
||||
|
||||
const confirmAction = async () => {
|
||||
if ((await onconfirm()) !== false) {
|
||||
if ((await onConfirmClick()) !== false) {
|
||||
closeModal();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<Modal bind:isOpen onclose={closeModal} class="flex flex-col gap-y-2">
|
||||
<p class="text-xl font-bold">{title}</p>
|
||||
{@render children?.()}
|
||||
<Modal bind:isOpen onclose={closeModal} class="space-y-4">
|
||||
<div class="flex flex-col gap-y-2 break-keep">
|
||||
<p class="text-xl font-bold">{title}</p>
|
||||
{@render children?.()}
|
||||
</div>
|
||||
<div class="flex gap-x-2">
|
||||
<Button color="gray" onclick={closeModal} class="flex-1">{cancelText}</Button>
|
||||
<Button onclick={confirmAction} class="flex-1">{confirmText}</Button>
|
||||
|
||||
Reference in New Issue
Block a user