diff --git a/src/lib/components/Modals.svelte b/src/lib/components/Modals.svelte new file mode 100644 index 00000000..da2dbad9 --- /dev/null +++ b/src/lib/components/Modals.svelte @@ -0,0 +1,190 @@ + + + + { + if (e.key === "Escape" && modal?.canBeDismissedByUser) + modal.dismiss(true) +}} /> + +{#snippet closeButton(isSecretAndForAccessibilityOnlyEvenThoughYouCanJustHitEscape: boolean)} + {#if modal && modal.canBeDismissedByUser} + + {/if} +{/snippet} +{#if modal} + + + + +{/if} + + \ No newline at end of file diff --git a/src/lib/components/testmodal.svelte b/src/lib/components/testmodal.svelte new file mode 100644 index 00000000..38c91908 --- /dev/null +++ b/src/lib/components/testmodal.svelte @@ -0,0 +1,9 @@ + + +Hello world! I wanted to tell you this: {modal.data.message} \ No newline at end of file diff --git a/src/routes/(app)/(nonuser)/home/+page.svelte b/src/routes/(app)/(nonuser)/home/+page.svelte index 54f4b902..1129ce21 100644 --- a/src/routes/(app)/(nonuser)/home/+page.svelte +++ b/src/routes/(app)/(nonuser)/home/+page.svelte @@ -4,6 +4,8 @@ import Announcement from "$lib/components/generic/Announcement.svelte" import Banner from "$lib/components/generic/Banner.svelte" import Song from "$lib/components/generic/Song.svelte" + import { Modal } from "$lib/components/Modals.svelte" + import Testmodal from "$lib/components/testmodal.svelte" import LL from "$lib/i18n/i18n-svelte"; @@ -37,6 +39,16 @@ }}> {/each} + + +