ActionModal 레이아웃 및 Props 이름 관련 리팩토링

This commit is contained in:
static
2025-01-24 21:58:51 +09:00
parent fea9cd729c
commit 38a1c8d7e0
6 changed files with 18 additions and 16 deletions

View File

@@ -14,5 +14,5 @@
title="새 카테고리"
placeholder="카테고리 이름"
submitText="만들기"
onsubmit={oncreate}
onSubmitClick={oncreate}
/>

View File

@@ -4,11 +4,11 @@
interface Props {
isOpen: boolean;
onbeforeclose?: () => void;
onrename: (newName: string) => Promise<boolean>;
onRenameClick: (newName: string) => Promise<boolean>;
originalName: string | undefined;
}
let { isOpen = $bindable(), onbeforeclose, onrename, originalName }: Props = $props();
let { isOpen = $bindable(), onbeforeclose, onRenameClick, originalName }: Props = $props();
</script>
<TextInputModal
@@ -18,5 +18,5 @@
placeholder="이름"
defaultValue={originalName}
submitText="바꾸기"
onsubmit={onrename}
onSubmitClick={onRenameClick}
/>

View File

@@ -6,7 +6,7 @@
defaultValue?: string;
isOpen: boolean;
onbeforeclose?: () => void;
onsubmit: (value: string) => ReturnType<ConfirmHandler>;
onSubmitClick: (value: string) => ReturnType<ConfirmHandler>;
placeholder: string;
submitText: string;
title: string;
@@ -16,7 +16,7 @@
defaultValue = "",
isOpen = $bindable(),
onbeforeclose,
onsubmit,
onSubmitClick,
placeholder,
submitText,
title,
@@ -36,7 +36,7 @@
{onbeforeclose}
{title}
confirmText={submitText}
onconfirm={() => onsubmit(value)}
onConfirmClick={() => onSubmitClick(value)}
>
<TextInput bind:value {placeholder} class="mb-5" />
<TextInput bind:value {placeholder} class="mb-3" />
</ActionModal>