diff options
Diffstat (limited to 'src/routes/(app)/send/fund')
| -rw-r--r-- | src/routes/(app)/send/fund/[name]/[...amount]/+page.svelte | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/routes/(app)/send/fund/[name]/[...amount]/+page.svelte b/src/routes/(app)/send/fund/[name]/[...amount]/+page.svelte index b6a4aa0c..d1c3b204 100644 --- a/src/routes/(app)/send/fund/[name]/[...amount]/+page.svelte +++ b/src/routes/(app)/send/fund/[name]/[...amount]/+page.svelte @@ -1,4 +1,6 @@ <script> + import { run } from 'svelte/legacy'; + import { t } from "$lib/translations"; import { enhance } from "$app/forms"; import Icon from "$comp/Icon.svelte"; @@ -8,25 +10,29 @@ import { back } from "$lib/utils"; import { pin } from "$lib/store"; - export let data; - export let form; + let { data, form } = $props(); - let { amount, name } = $page.params; + let { amount, name } = $state($page.params); let { rates } = data; let { currency } = data.user; - let loading; + let loading = $state(); - $: rate = rates[currency]; let submit = () => (loading = true); - $: update(form); let update = () => { if (form?.message?.includes("pin")) $pin = undefined; loading = false; }; + let rate; + run(() => { + rate = rates[currency]; + }); + run(() => { + update(form); + }); </script> -<button class="ml-5 md:ml-20 mt-5 md:mt-10 hover:opacity-80" on:click={back}> +<button class="ml-5 md:ml-20 mt-5 md:mt-10 hover:opacity-80" onclick={back}> <Icon icon="arrow-left" style="w-10" /> </button> @@ -39,7 +45,7 @@ <div class="container px-4 mt-20 max-w-xl mx-auto"> <Numpad bind:amount {currency} bind:rate /> - <form method="POST" use:enhance on:submit={submit}> + <form method="POST" use:enhance onsubmit={submit}> <input name="name" value={name} type="hidden" /> <input name="amount" value={amount} type="hidden" /> <input name="pin" value={$pin} type="hidden" /> |
