aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-10-23 20:35:12 -0700
committerAdam Soltys <[email protected]>2024-10-23 20:35:12 -0700
commit2a2ad2dbd1d1a52a13bfd3147886fe2fa696b5d1 (patch)
tree1eaeca66d7dc750db137f4853c086361c140d857 /src/routes
parentfc20de6b6da4f851c8753314b2ac28587c45f87f (diff)
downloadcoinos-ui-2a2ad2dbd1d1a52a13bfd3147886fe2fa696b5d1.tar.gz
coinos-ui-2a2ad2dbd1d1a52a13bfd3147886fe2fa696b5d1.zip
expose max fee
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/(app)/payments/[...page]/+page.svelte12
-rw-r--r--src/routes/(app)/send/lightning/[payreq]/+page.svelte24
2 files changed, 16 insertions, 20 deletions
diff --git a/src/routes/(app)/payments/[...page]/+page.svelte b/src/routes/(app)/payments/[...page]/+page.svelte
index 55e6c914..f0ee1393 100644
--- a/src/routes/(app)/payments/[...page]/+page.svelte
+++ b/src/routes/(app)/payments/[...page]/+page.svelte
@@ -211,13 +211,15 @@
</div>
</div>
{:else}
- <div class="text-secondary flex">
- {#if [types.ecash, types.lightning].includes(p.type)}
+ <div class="text-secondary flex gap-2">
+ {#if p.type === types.lightning}
<div class="text-3xl">⚡️</div>
+ {:else if p.type === types.ecash}
+ <img src="/images/cash.png" class="w-12" />
{:else if p.type === types.reconcile}
- <Icon icon="balance" style="w-6 mr-2" />
+ <Icon icon="balance" style="w-6" />
{:else if p.type === types.bitcoin}
- <div class="my-auto mr-1">
+ <div class="my-auto">
<img
src="/images/bitcoin.svg"
class="w-12 border-4 border-transparent"
@@ -225,7 +227,7 @@
/>
</div>
{:else if p.type === types.liquid}
- <div class="my-auto mr-1">
+ <div class="my-auto">
<img
src="/images/liquid.svg"
class="w-12 border-4 border-transparent"
diff --git a/src/routes/(app)/send/lightning/[payreq]/+page.svelte b/src/routes/(app)/send/lightning/[payreq]/+page.svelte
index 132874a0..7324c4f1 100644
--- a/src/routes/(app)/send/lightning/[payreq]/+page.svelte
+++ b/src/routes/(app)/send/lightning/[payreq]/+page.svelte
@@ -32,19 +32,8 @@
};
$: amount = form?.amount || data.amount;
- $: maxfee = Math.round(
- amount < 100
- ? amount * 5
- : amount < 1000
- ? amount
- : amount < 10000
- ? amount * 0.5
- : amount < 100000
- ? amount * 0.1
- : amount < 1000000
- ? amount * 0.05
- : amount * 0.01,
- );
+ $: maxfee = Math.round(amount * 0.01) || 1;
+ let showMax;
let loading;
let submit = () => (loading = true);
@@ -108,12 +97,16 @@
<input name="amount" value={amount} type="hidden" />
<input name="pin" value={$pin} type="hidden" />
- {#if form?.message}
- <div class="w-40 mx-auto">
+ {#if form?.message || showMax}
+ <div class="mx-auto space-y-2">
<label for="maxfee" class="text-lg text-secondary"
>{$t("payments.maxfee")}</label
>
+ <div class="text-secondary">
+ {$t("payments.maxFeeDesc")}
+ </div>
+
<div class="flex">
<input
id="maxfee"
@@ -129,6 +122,7 @@
</div>
</div>
{:else}
+ <button on:click={() => (showMax = !showMax)}>Advanced settings</button>
<input name="maxfee" type="hidden" bind:value={maxfee} />
{/if}