aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/scan
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-11-07 21:16:25 -0800
committerAdam Soltys <[email protected]>2024-11-08 09:27:40 -0800
commit32fcc461cd43c8907df5e306d520bb671307eab1 (patch)
tree0253780c569998b6c1a5f43026586e94916c3fee /src/routes/(app)/scan
parentbe5aa52cea1d57c875cfb22d25c6a866b8de2239 (diff)
downloadcoinos-ui-32fcc461cd43c8907df5e306d520bb671307eab1.tar.gz
coinos-ui-32fcc461cd43c8907df5e306d520bb671307eab1.zip
svelte 5
Diffstat (limited to 'src/routes/(app)/scan')
-rw-r--r--src/routes/(app)/scan/[email protected]10
-rw-r--r--src/routes/(app)/scan/+page.svelte8
2 files changed, 13 insertions, 5 deletions
diff --git a/src/routes/(app)/scan/[email protected] b/src/routes/(app)/scan/[email protected]
index 2dc061a8..14b35465 100644
--- a/src/routes/(app)/scan/[email protected]
+++ b/src/routes/(app)/scan/[email protected]
@@ -1,3 +1,11 @@
+<script lang="ts">
+ interface Props {
+ children?: import('svelte').Snippet;
+ }
+
+ let { children }: Props = $props();
+</script>
+
<main class="min-h-dvh">
- <slot />
+ {@render children?.()}
</main>
diff --git a/src/routes/(app)/scan/+page.svelte b/src/routes/(app)/scan/+page.svelte
index 1acc9b13..edff522e 100644
--- a/src/routes/(app)/scan/+page.svelte
+++ b/src/routes/(app)/scan/+page.svelte
@@ -6,7 +6,7 @@
import { back } from "$lib/utils";
import { goto } from "$app/navigation";
- let scanner, vid, resizing;
+ let scanner, vid = $state(), resizing;
let resize = () => {
if (resizing) clearTimeout(resizing);
@@ -31,19 +31,19 @@
onDestroy(() => scanner?.stop());
</script>
-<svelte:window on:resize={resize} />
+<svelte:window onresize={resize} />
<div class="flex w-full mb-4 p-4">
<div class="mx-auto rounded-3xl">
<video
bind:this={vid}
class="border-4 rounded-3xl border-black max-h-[calc(100vh*0.7)]"
- />
+></video>
</div>
</div>
<div class="flex justify-center">
- <button class="btn !w-auto" on:click={back}>Cancel</button>
+ <button class="btn !w-auto" onclick={back}>Cancel</button>
</div>
<style>