mirror of
https://github.com/AventurasTeam/Aventuras.git
synced 2026-04-29 20:30:17 +00:00
added drawers
This commit is contained in:
parent
994a4adab2
commit
416e3d35cf
70 changed files with 2274 additions and 2566 deletions
|
|
@ -0,0 +1,21 @@
|
|||
<script lang="ts">
|
||||
import * as Dialog from "$lib/components/ui/dialog";
|
||||
import * as Drawer from "$lib/components/ui/drawer";
|
||||
import { createIsMobile } from "$lib/hooks/is-mobile.svelte";
|
||||
import { setResponsiveModalContext } from "./context";
|
||||
|
||||
let { open = $bindable(false), onOpenChange, children, ...props } = $props();
|
||||
|
||||
const isMobile = createIsMobile();
|
||||
setResponsiveModalContext({ isMobile });
|
||||
</script>
|
||||
|
||||
{#if isMobile.current}
|
||||
<Drawer.Root bind:open {onOpenChange} {...props}>
|
||||
{@render children?.()}
|
||||
</Drawer.Root>
|
||||
{:else}
|
||||
<Dialog.Root bind:open {onOpenChange} {...props}>
|
||||
{@render children?.()}
|
||||
</Dialog.Root>
|
||||
{/if}
|
||||
Loading…
Add table
Add a link
Reference in a new issue