aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/send/+page.svelte
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-10-03 23:13:49 -0700
committerAdam Soltys <[email protected]>2022-10-03 23:13:49 -0700
commit63f1a6780bab85ebb48ca1fc142cc6beaf772faa (patch)
treeb498ac8dd1a8ac5ffd517e6a8050399d9d7a86a1 /src/routes/send/+page.svelte
parent8906099f391acf19f7b8eb91527b027cedd65b5e (diff)
downloadcoinos-ui-63f1a6780bab85ebb48ca1fc142cc6beaf772faa.tar.gz
coinos-ui-63f1a6780bab85ebb48ca1fc142cc6beaf772faa.zip
refactoring
Diffstat (limited to 'src/routes/send/+page.svelte')
-rw-r--r--src/routes/send/+page.svelte14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/routes/send/+page.svelte b/src/routes/send/+page.svelte
index 8963345a..8a695ac6 100644
--- a/src/routes/send/+page.svelte
+++ b/src/routes/send/+page.svelte
@@ -1,16 +1,16 @@
<script>
+ import { enhance } from '$app/forms';
import { onMount } from 'svelte';
import { browser } from '$app/environment';
import { t } from '$lib/translations';
- import { AppHeader, Icon, Spinner } from '$comp';
+ import { Icon, Spinner } from '$comp';
import { back, failure } from '$lib/utils';
export let form;
let el;
let placeholder = 'Address, Invoice, Username';
- let text = placeholder,
- loading;
+ let text = placeholder;
let focus = () => text === placeholder && (text = '');
let keypress = (e) => e.key === 'Enter' && e.preventDefault() && el.submit();
@@ -26,7 +26,7 @@
<Icon icon="arrow-left" style="w-10" />
</button>
-<form method="POST" class="container px-4 mt-20 max-w-xl mx-auto" bind:this={el}>
+<form method="POST" class="container px-4 mt-20 max-w-xl mx-auto" bind:this={el} use:enhance>
<div class="mb-2">
<label for="invoice" class="font-bold mb-1 block">Destination</label>
<input type="hidden" name="text" bind:value={text} />
@@ -70,11 +70,7 @@
? 'opacity-50'
: 'opacity-100 hover:opacity-80'} bg-black text-white border rounded-full px-6 py-2 font-bold"
>
- {#if loading}
- <Spinner />
- {:else}
- Next
- {/if}
+ Next
</button>
</div>
</form>