mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 08:06:56 +00:00
Modal, BeforeContinueModal 컴포넌트 추가
This commit is contained in:
32
src/lib/components/Modal.svelte
Normal file
32
src/lib/components/Modal.svelte
Normal file
@@ -0,0 +1,32 @@
|
||||
<script lang="ts">
|
||||
import type { Snippet } from "svelte";
|
||||
import { fade } from "svelte/transition";
|
||||
|
||||
interface Props {
|
||||
children: Snippet;
|
||||
isOpen: boolean;
|
||||
}
|
||||
|
||||
let { children, isOpen = $bindable() }: Props = $props();
|
||||
|
||||
const closeModal = () => {
|
||||
isOpen = false;
|
||||
};
|
||||
</script>
|
||||
|
||||
{#if isOpen}
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<div
|
||||
onclick={closeModal}
|
||||
class="fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 px-2"
|
||||
>
|
||||
<div
|
||||
onclick={(e) => e.stopPropagation()}
|
||||
class="max-w-full rounded-2xl bg-white p-4"
|
||||
transition:fade={{ duration: 100 }}
|
||||
>
|
||||
{@render children?.()}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
Reference in New Issue
Block a user