diff options
| author | Adam Soltys <[email protected]> | 2024-11-07 21:16:25 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-11-08 09:27:40 -0800 |
| commit | 32fcc461cd43c8907df5e306d520bb671307eab1 (patch) | |
| tree | 0253780c569998b6c1a5f43026586e94916c3fee /src/routes/(app)/send/fund | |
| parent | be5aa52cea1d57c875cfb22d25c6a866b8de2239 (diff) | |
| download | coinos-ui-32fcc461cd43c8907df5e306d520bb671307eab1.tar.gz coinos-ui-32fcc461cd43c8907df5e306d520bb671307eab1.zip | |
svelte 5
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" /> |
