aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Lnurlw.svelte
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/components/Lnurlw.svelte
parentbe5aa52cea1d57c875cfb22d25c6a866b8de2239 (diff)
downloadcoinos-ui-32fcc461cd43c8907df5e306d520bb671307eab1.tar.gz
coinos-ui-32fcc461cd43c8907df5e306d520bb671307eab1.zip
svelte 5
Diffstat (limited to 'src/components/Lnurlw.svelte')
-rw-r--r--src/components/Lnurlw.svelte17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/components/Lnurlw.svelte b/src/components/Lnurlw.svelte
index d0fbf3b4..50aa1488 100644
--- a/src/components/Lnurlw.svelte
+++ b/src/components/Lnurlw.svelte
@@ -1,4 +1,6 @@
<script>
+ import { run } from 'svelte/legacy';
+
import { sats, f, s } from "$lib/utils";
import { t } from "$lib/translations";
import { enhance } from "$app/forms";
@@ -6,7 +8,7 @@
import Spinner from "$comp/Spinner.svelte";
import { pin } from "$lib/store";
- export let data, form;
+ let { data, form } = $props();
let { currency, username } = data.user;
let {
@@ -17,13 +19,16 @@
callback,
rates,
} = data;
- $: rate = rates[currency];
+ let rate;
+ run(() => {
+ rate = rates[currency];
+ });
- let amount = Math.round(minWithdrawable / 1000),
- loading;
+ let amount = $state(Math.round(minWithdrawable / 1000)),
+ loading = $state();
let submit = () => (loading = true);
- $: amountFiat = parseFloat(((amount * rate) / sats).toFixed(2));
+ let amountFiat = $derived(parseFloat(((amount * rate) / sats).toFixed(2)));
</script>
<div class="container px-4 mt-20 max-w-xl mx-auto">
@@ -56,7 +61,7 @@
<Numpad bind:amount {currency} bind:rate />
{/if}
- <form action="?/withdraw" method="POST" use:enhance on:submit={submit}>
+ <form action="?/withdraw" method="POST" use:enhance onsubmit={submit}>
<input name="amount" value={amount} type="hidden" />
<input name="username" value={username} type="hidden" />
<input name="currency" value={currency} type="hidden" />