aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Lnurlp.svelte
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-12-01 20:04:13 -0800
committerAdam Soltys <[email protected]>2023-12-01 20:04:13 -0800
commit216a600224fde22ce76b367557a02094ec693886 (patch)
treed1189bbaa39db204633523132a7d4767b952717d /src/components/Lnurlp.svelte
parent7d9bc1f54dfd04172e8d6d43ebc2efd6f407e833 (diff)
downloadcoinos-ui-216a600224fde22ce76b367557a02094ec693886.tar.gz
coinos-ui-216a600224fde22ce76b367557a02094ec693886.zip
prettier
Diffstat (limited to 'src/components/Lnurlp.svelte')
-rw-r--r--src/components/Lnurlp.svelte96
1 files changed, 48 insertions, 48 deletions
diff --git a/src/components/Lnurlp.svelte b/src/components/Lnurlp.svelte
index 9918a3f4..427e4c07 100644
--- a/src/components/Lnurlp.svelte
+++ b/src/components/Lnurlp.svelte
@@ -1,60 +1,60 @@
<script>
- import { t } from '$lib/translations';
- import { enhance } from '$app/forms';
- import { Numpad, Spinner } from '$comp';
- import { pin } from '$lib/store';
+ import { t } from "$lib/translations";
+ import { enhance } from "$app/forms";
+ import { Numpad, Spinner } from "$comp";
+ import { pin } from "$lib/store";
- export let data, form;
- let { currency } = data.user;
- let { minSendable, maxSendable, callback, metadata, rates } = data;
+ export let data, form;
+ let { currency } = data.user;
+ let { minSendable, maxSendable, callback, metadata, rates } = data;
- $: rate = rates[currency];
+ $: rate = rates[currency];
- let amount = Math.round(minSendable / 1000),
- loading;
- let submit = () => (loading = true);
+ let amount = Math.round(minSendable / 1000),
+ loading;
+ let submit = () => (loading = true);
</script>
<div class="container px-4 mt-20 max-w-xl mx-auto">
- <div class="text-center mb-8">
- {#each JSON.parse(metadata) as m}
- <div>
- {#if m[0] === 'text/plain'}
- <h1 class="text-3xl md:text-4xl font-semibold mb-2">{m[1]}</h1>
- {/if}
- {#if m[0].includes('image')}
- <img src={`data:image/png;base64,${m[1]}`} alt="Recipient" />
- {/if}
- </div>
- {/each}
- </div>
+ <div class="text-center mb-8">
+ {#each JSON.parse(metadata) as m}
+ <div>
+ {#if m[0] === "text/plain"}
+ <h1 class="text-3xl md:text-4xl font-semibold mb-2">{m[1]}</h1>
+ {/if}
+ {#if m[0].includes("image")}
+ <img src={`data:image/png;base64,${m[1]}`} alt="Recipient" />
+ {/if}
+ </div>
+ {/each}
+ </div>
- {#if form?.error}
- <div class="text-red-600 text-center mb-5">
- {form.error}
- </div>
- {/if}
+ {#if form?.error}
+ <div class="text-red-600 text-center mb-5">
+ {form.error}
+ </div>
+ {/if}
- <Numpad bind:amount bind:rate {currency} />
+ <Numpad bind:amount bind:rate {currency} />
- <form action="?/pay" method="POST" use:enhance on:submit={submit}>
- <input name="amount" value={amount} type="hidden" />
- <input name="minSendable" value={minSendable} type="hidden" />
- <input name="maxSendable" value={maxSendable} type="hidden" />
- <input name="callback" value={callback} type="hidden" />
- <input name="pin" value={$pin} type="hidden" />
+ <form action="?/pay" method="POST" use:enhance on:submit={submit}>
+ <input name="amount" value={amount} type="hidden" />
+ <input name="minSendable" value={minSendable} type="hidden" />
+ <input name="maxSendable" value={maxSendable} type="hidden" />
+ <input name="callback" value={callback} type="hidden" />
+ <input name="pin" value={$pin} type="hidden" />
- <div class="flex w-full">
- <button
- type="submit"
- class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"
- >
- {#if loading}
- <Spinner />
- {:else}
- {$t('payments.send')}
- {/if}
- </button>
- </div>
- </form>
+ <div class="flex w-full">
+ <button
+ type="submit"
+ class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"
+ >
+ {#if loading}
+ <Spinner />
+ {:else}
+ {$t("payments.send")}
+ {/if}
+ </button>
+ </div>
+ </form>
</div>