aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-12-23 20:30:56 -0800
committerAdam Soltys <[email protected]>2023-12-23 20:30:56 -0800
commita20eb758b7deee700830c0ff346a3121ec82f35c (patch)
treeef973c0f87ebd013af70ffb03785c93f5b21b9a4 /src
parent45547db374033860050b323264e5563c35efe8a9 (diff)
downloadcoinos-ui-a20eb758b7deee700830c0ff346a3121ec82f35c.tar.gz
coinos-ui-a20eb758b7deee700830c0ff346a3121ec82f35c.zip
numpad blur
Diffstat (limited to 'src')
-rw-r--r--src/components/Numpad.svelte10
-rw-r--r--src/routes/(app)/send/[...text]/+page.svelte5
-rw-r--r--src/routes/(app)/send/lightning/[payreq]/+page.server.js2
-rw-r--r--src/routes/(app)/send/lightning/[payreq]/+page.svelte3
-rw-r--r--src/routes/(app)/send/user/[username]/[...amount]/+page.server.js2
5 files changed, 15 insertions, 7 deletions
diff --git a/src/components/Numpad.svelte b/src/components/Numpad.svelte
index fe018dce..713f2e4d 100644
--- a/src/components/Numpad.svelte
+++ b/src/components/Numpad.svelte
@@ -93,9 +93,7 @@
} else if (value !== "<" && parseInt(amount + value) > sats) {
warning($t("user.receive.lessThan1BTCWarning"));
} else {
- console.log("CLICK", amount.toString(), value);
amount = parseInt(amount.toString() + value);
- console.log("AMOUNT", amount);
}
}
};
@@ -171,6 +169,10 @@
sel.addRange(range);
};
+ let blur = () => {
+ if (!html) html = "0";
+ };
+
let keydown = (e) =>
e.key === "Enter" && (e.preventDefault() || submit.click());
</script>
@@ -189,6 +191,7 @@
contenteditable
bind:innerHTML={html}
on:focus={select}
+ on:blur={blur}
on:input={input}
on:keydown={keydown}
class="outline-none my-auto"
@@ -221,7 +224,8 @@
<button
type="button"
class="bg-primary rounded-xl py-4 px-8 font-semibold active:bg-black active:text-white flex justify-center items-center hover:opacity-80"
- on:click={() => handleInput(value)}>
+ on:click={() => handleInput(value)}
+ >
<Left />
</button>
{:else}
diff --git a/src/routes/(app)/send/[...text]/+page.svelte b/src/routes/(app)/send/[...text]/+page.svelte
index effaea60..343bffd5 100644
--- a/src/routes/(app)/send/[...text]/+page.svelte
+++ b/src/routes/(app)/send/[...text]/+page.svelte
@@ -59,7 +59,10 @@
</div>
<div class="grid grid-cols-2 md:grid-cols-4 gap-2">
- <a href={`/qr/${encodeURIComponent(text)}`} class:invisible={!text?.length}>
+ <a
+ href={`/qr/${encodeURIComponent(text)}`}
+ class:invisible={!text?.length}
+ >
<button
type="button"
class="flex border rounded-full px-6 py-2 font-bold hover:opacity-80 mr-1 w-full"
diff --git a/src/routes/(app)/send/lightning/[payreq]/+page.server.js b/src/routes/(app)/send/lightning/[payreq]/+page.server.js
index a2b60356..89bcc3c3 100644
--- a/src/routes/(app)/send/lightning/[payreq]/+page.server.js
+++ b/src/routes/(app)/send/lightning/[payreq]/+page.server.js
@@ -3,7 +3,7 @@ import { fd, auth, post } from "$lib/utils";
export async function load({ cookies, params }) {
return post("/parse", params, auth(cookies));
- }
+}
export const actions = {
setAmount: async ({ cookies, request }) => fd(request),
diff --git a/src/routes/(app)/send/lightning/[payreq]/+page.svelte b/src/routes/(app)/send/lightning/[payreq]/+page.svelte
index 6a5eca87..57a17e01 100644
--- a/src/routes/(app)/send/lightning/[payreq]/+page.svelte
+++ b/src/routes/(app)/send/lightning/[payreq]/+page.svelte
@@ -43,7 +43,8 @@
? amount * 0.1
: amount < 1000000
? amount * 0.05
- : amount * 0.01);
+ : amount * 0.01
+ );
let loading;
let submit = () => (loading = true);
diff --git a/src/routes/(app)/send/user/[username]/[...amount]/+page.server.js b/src/routes/(app)/send/user/[username]/[...amount]/+page.server.js
index 9e586f84..fe004408 100644
--- a/src/routes/(app)/send/user/[username]/[...amount]/+page.server.js
+++ b/src/routes/(app)/send/user/[username]/[...amount]/+page.server.js
@@ -24,7 +24,7 @@ export async function load({ cookies, params, parent }) {
amount,
currency: currency === subject.currency ? currency : undefined,
prompt: false,
- rate: currency === subject.currency ? rate : undefined,
+ rate: currency === subject.currency ? rate : undefined,
type: types.lightning,
},
user: { username },