refac: modal

This commit is contained in:
Timothy Jaeryang Baek 2024-11-28 23:49:24 -08:00
parent c1fd1d3490
commit 28ce102a79
2 changed files with 4 additions and 2 deletions

View File

@ -6,6 +6,8 @@
export let show = true;
export let size = 'md';
export let containerClassName = 'p-3';
export let className = 'bg-gray-50 dark:bg-gray-900 rounded-2xl';
let modalElement = null;
@ -65,7 +67,7 @@
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
bind:this={modalElement}
class="modal fixed top-0 right-0 left-0 bottom-0 bg-black/60 w-full h-screen max-h-[100dvh] p-3 flex justify-center z-[9999] overflow-y-auto overscroll-contain"
class="modal fixed top-0 right-0 left-0 bottom-0 bg-black/60 w-full h-screen max-h-[100dvh] {containerClassName} flex justify-center z-[9999] overflow-y-auto overscroll-contain"
in:fade={{ duration: 10 }}
on:mousedown={() => {
show = false;

View File

@ -20,7 +20,7 @@
let voiceInput = false;
</script>
<Modal size="full" className="h-full bg-white dark:bg-gray-900" bind:show>
<Modal size="full" containerClassName="" className="h-full bg-white dark:bg-gray-900" bind:show>
<div class="absolute top-0 right-0 p-5">
<button
class="self-center dark:text-white"