aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/send
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-03-03 14:39:08 -0800
committerAdam Soltys <[email protected]>2026-03-03 14:39:08 -0800
commit6624b19b1d954dc69afbf1a9f6072e791771aff5 (patch)
treeb558d6673be563ee1038abf9c55b7b509097f1b7 /src/routes/(app)/send
parent41c6636efee032a29c380ef0ee7ef73a99f64cd5 (diff)
downloadcoinos-ui-6624b19b1d954dc69afbf1a9f6072e791771aff5.tar.gz
coinos-ui-6624b19b1d954dc69afbf1a9f6072e791771aff5.zip
static page loads
Diffstat (limited to 'src/routes/(app)/send')
-rw-r--r--src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte59
1 files changed, 23 insertions, 36 deletions
diff --git a/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte b/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte
index fcae8598..d5eb0293 100644
--- a/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte
+++ b/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte
@@ -152,14 +152,10 @@
submit: any = $state(),
showSettings = $state();
- let customRate = $state("");
- let showCustom = $state(false);
-
let presets = $derived(fees ? [
- { label: $t("payments.economy"), rate: 0.1 },
+ { label: $t("payments.low"), rate: 0.1 },
{ label: $t("payments.medium"), rate: fees.hourFee },
- { label: $t("payments.fast"), rate: fees.halfHourFee },
- { label: $t("payments.fastest"), rate: fees.fastestFee },
+ { label: $t("payments.high"), rate: fees.fastestFee },
] : []);
let toggleSettings = () => (showSettings = !showSettings);
@@ -169,12 +165,11 @@
let pickRate = (r: number) => {
feeRate = r;
- showCustom = false;
setFee();
};
let applyCustom = () => {
- const r = parseFloat(customRate);
+ const r = parseFloat(String(feeRate));
if (r >= 0.1) {
feeRate = r;
setFee();
@@ -203,43 +198,35 @@
{#if fees}
<div class="text-center">
- <h2 class="text-secondary text-lg">{$t("payments.networkFee")}</h2>
-
- <div class="flex flex-wrap gap-2 justify-center mb-2">
+ <h2 class="text-secondary text-lg">{$t("payments.priority")}</h2>
+ <div class="flex gap-2 justify-center mb-2">
{#each presets as preset}
<button
type="button"
- class="btn btn-sm"
- class:btn-accent={feeRate == preset.rate && !showCustom}
+ class="btn btn-sm !w-auto"
+ class:btn-accent={feeRate == preset.rate}
onclick={() => pickRate(preset.rate)}
>
- {preset.label} ({preset.rate})
+ {preset.label}
</button>
{/each}
- <button
- type="button"
- class="btn btn-sm"
- class:btn-accent={showCustom}
- onclick={() => { showCustom = true; customRate = String(feeRate); }}
- >
- Custom
- </button>
</div>
- {#if showCustom}
- <div class="flex items-center justify-center gap-2 mb-2">
- <input
- type="number"
- min="0.1"
- step="0.1"
- class="input input-bordered w-24 text-center"
- bind:value={customRate}
- onblur={applyCustom}
- onkeydown={(e) => e.key === 'Enter' && applyCustom()}
- />
- <span class="text-secondary text-sm">sat/vB</span>
- </div>
- {/if}
+ <div class="flex items-center justify-center gap-2 mb-2">
+ <input
+ type="number"
+ min="0.1"
+ step="0.1"
+ class="input input-bordered w-24 text-center"
+ value={feeRate}
+ oninput={(e) => {
+ const r = parseFloat(e.currentTarget.value);
+ if (r >= 0.1) { feeRate = r; setFee(); }
+ }}
+ onkeydown={(e) => e.key === 'Enter' && applyCustom()}
+ />
+ <span class="text-secondary text-sm">sat/vB</span>
+ </div>
<Amount amount={fee} rate={$rate} {currency} {locale} />
</div>