refactor: only include template in share url if it's custom
This commit is contained in:
parent
bb429d8195
commit
be11c0e57a
6 changed files with 249 additions and 32 deletions
25
src/lib/components/Modal.svelte
Normal file
25
src/lib/components/Modal.svelte
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<script lang="ts">
|
||||
let { onClose, children }: { onClose: () => void; children: any } = $props();
|
||||
|
||||
function handleKeydown(e: KeyboardEvent) {
|
||||
if (e.key === 'Escape') onClose();
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:window onkeydown={handleKeydown} />
|
||||
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<div
|
||||
class="fixed inset-0 z-50 flex items-center justify-center"
|
||||
onmousedown={onClose}
|
||||
>
|
||||
<div class="absolute inset-0 bg-black/50"></div>
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<div
|
||||
class="relative rounded-lg shadow-xl max-w-md w-full mx-4 p-6"
|
||||
style="background: var(--bg-card); color: var(--text);"
|
||||
onmousedown={(e) => e.stopPropagation()}
|
||||
>
|
||||
{@render children()}
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue