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/components/Lnurlp.svelte | |
| parent | be5aa52cea1d57c875cfb22d25c6a866b8de2239 (diff) | |
| download | coinos-ui-32fcc461cd43c8907df5e306d520bb671307eab1.tar.gz coinos-ui-32fcc461cd43c8907df5e306d520bb671307eab1.zip | |
svelte 5
Diffstat (limited to 'src/components/Lnurlp.svelte')
| -rw-r--r-- | src/components/Lnurlp.svelte | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/components/Lnurlp.svelte b/src/components/Lnurlp.svelte index 0268e363..74be0571 100644 --- a/src/components/Lnurlp.svelte +++ b/src/components/Lnurlp.svelte @@ -1,19 +1,29 @@ <script> + import { run } from 'svelte/legacy'; + import { t } from "$lib/translations"; import { enhance } from "$app/forms"; import Numpad from "$comp/Numpad.svelte"; import Spinner from "$comp/Spinner.svelte"; import { pin } from "$lib/store"; - export let data, form, send, comment; + let { + data, + form, + send = $bindable(), + comment = $bindable() + } = $props(); let { currency } = data.user; let { minSendable, maxSendable, commentAllowed, callback, metadata, rates } = data; - $: rate = rates[currency]; + let rate; + run(() => { + rate = rates[currency]; + }); - let amount = Math.round(minSendable / 1000), - loading; + let amount = $state(Math.round(minSendable / 1000)), + loading = $state(); let submit = () => (loading = true); </script> @@ -39,7 +49,7 @@ <Numpad bind:amount bind:rate {currency} bind:submit={send} /> - <form action="?/pay" method="POST" use:enhance on:submit={submit}> + <form action="?/pay" method="POST" use:enhance onsubmit={submit}> <input name="amount" value={amount} type="hidden" /> <input name="minSendable" value={minSendable} type="hidden" /> <input name="maxSendable" value={maxSendable} type="hidden" /> @@ -53,7 +63,7 @@ class="w-full p-4 border rounded-xl h-32 text-xl" bind:value={comment} autocapitalize="none" - /> +></textarea> {/if} <div class="flex w-full"> |
