forked from coracle/flotilla
Migrate more stuff
This commit is contained in:
@@ -2,12 +2,18 @@
|
||||
import {noop} from "@welshman/lib"
|
||||
import {fade, fly} from "@lib/transition"
|
||||
|
||||
export let onClose: any = noop
|
||||
export let fullscreen = false
|
||||
interface Props {
|
||||
onClose?: any
|
||||
fullscreen?: boolean
|
||||
children?: import("svelte").Snippet
|
||||
}
|
||||
|
||||
$: extraClass =
|
||||
let {onClose = noop, fullscreen = false, children}: Props = $props()
|
||||
|
||||
let extraClass = $derived(
|
||||
!fullscreen &&
|
||||
"card2 bg-alt max-h-[90vh] w-[90vw] overflow-auto text-base-content sm:w-[520px] shadow-xl"
|
||||
"card2 bg-alt max-h-[90vh] w-[90vw] overflow-auto text-base-content sm:w-[520px] shadow-xl",
|
||||
)
|
||||
</script>
|
||||
|
||||
<div class="center fixed inset-0 z-modal">
|
||||
@@ -15,9 +21,9 @@
|
||||
aria-label="Close dialog"
|
||||
class="absolute inset-0 cursor-pointer bg-black opacity-75"
|
||||
transition:fade={{duration: 300}}
|
||||
on:click={onClose}>
|
||||
onclick={onClose}>
|
||||
</button>
|
||||
<div class="scroll-container relative {extraClass}" transition:fly={{duration: 300}}>
|
||||
<slot />
|
||||
{@render children?.()}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user