aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-01-31 19:56:31 -0800
committerAdam Soltys <[email protected]>2023-01-31 19:56:31 -0800
commitcf29dcc02e2c9ac593d6e8f0aff2589b80ffa994 (patch)
tree447e4a87e739ba4e53e8f31f6e1883cd54896dde /src
parenteff1fd2b4747d07a6b342d2561785c18ea500bcb (diff)
downloadcoinos-ui-cf29dcc02e2c9ac593d6e8f0aff2589b80ffa994.tar.gz
coinos-ui-cf29dcc02e2c9ac593d6e8f0aff2589b80ffa994.zip
prettier
Diffstat (limited to 'src')
-rw-r--r--src/components/Numpad.svelte3
-rw-r--r--src/components/Password.svelte4
-rw-r--r--src/components/Pin.svelte2
-rw-r--r--src/components/Qr.svelte2
-rw-r--r--src/lib/upload.js2
-rw-r--r--src/lib/utils.js2
-rw-r--r--src/routes/(app)/+layout.server.js6
-rw-r--r--src/routes/(app)/[username]/+layout.server.js4
-rw-r--r--src/routes/(app)/[username]/payments/[...page]/+page.svelte6
-rw-r--r--src/routes/(app)/[username]/payments/[...page]/+server.js2
-rw-r--r--src/routes/(app)/[username]/receive/[...param]/+page.svelte6
-rw-r--r--src/routes/(app)/[username]/settings/[...tab]/+page.svelte4
-rw-r--r--src/routes/(app)/[username]/settings/[...tab]/_account.svelte2
-rw-r--r--src/routes/(app)/invoice/[hash]/tip/+page.svelte2
-rw-r--r--src/routes/(app)/invoice/sent/+page.svelte2
-rw-r--r--src/routes/(app)/ln/[lnurl]/+page.server.js5
-rw-r--r--src/routes/(app)/ln/[lnurl]/+page.svelte4
-rw-r--r--src/routes/(app)/payment/[id]/+page.svelte4
-rw-r--r--src/routes/(app)/pot/[name]/+page.svelte2
-rw-r--r--src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte2
20 files changed, 34 insertions, 32 deletions
diff --git a/src/components/Numpad.svelte b/src/components/Numpad.svelte
index d74255e0..4d869fa3 100644
--- a/src/components/Numpad.svelte
+++ b/src/components/Numpad.svelte
@@ -102,7 +102,8 @@
let sel = getSelection();
let i = sel.focusOffset;
- let clean = html.substr(0,15)
+ let clean = html
+ .substr(0, 15)
.replace(/[^0-9.,]+/g, '')
.replace('.', 'F')
.replace(/\./g, '')
diff --git a/src/components/Password.svelte b/src/components/Password.svelte
index 95a52cac..fd39441c 100644
--- a/src/components/Password.svelte
+++ b/src/components/Password.svelte
@@ -35,7 +35,7 @@
class="bg-primary"
bind:value={password}
autocapitalize="none"
- use:focus
+ use:focus
/>
{:else}
<input
@@ -45,7 +45,7 @@
class="bg-primary"
bind:value={password}
autocapitalize="none"
- use:focus
+ use:focus
/>
{/if}
<button
diff --git a/src/components/Pin.svelte b/src/components/Pin.svelte
index c7889aa9..7225ac37 100644
--- a/src/components/Pin.svelte
+++ b/src/components/Pin.svelte
@@ -1,5 +1,5 @@
<script>
- import { focus } from "$lib/utils";
+ import { focus } from '$lib/utils';
import { pin } from '$lib/store';
let pinCode = '';
diff --git a/src/components/Qr.svelte b/src/components/Qr.svelte
index 5fea7cbd..c67d134e 100644
--- a/src/components/Qr.svelte
+++ b/src/components/Qr.svelte
@@ -10,5 +10,5 @@
on:click={() => screenfull.toggle(qr)}
on:keydown={() => screenfull.toggle(qr)}
>
-<img {src} class="mx-auto" alt="QR Code" />
+ <img {src} class="mx-auto" alt="QR Code" />
</div>
diff --git a/src/lib/upload.js b/src/lib/upload.js
index 899dbb0c..d8b27061 100644
--- a/src/lib/upload.js
+++ b/src/lib/upload.js
@@ -1,5 +1,5 @@
export const upload = async (file, type, progress, token) => {
- console.log("TYPE", type)
+ console.log('TYPE', type);
let url = `/api/upload/${type}`;
let formData = new FormData();
formData.append('file', file);
diff --git a/src/lib/utils.js b/src/lib/utils.js
index e4b1194f..2b5dda90 100644
--- a/src/lib/utils.js
+++ b/src/lib/utils.js
@@ -137,7 +137,7 @@ export const login = async (user, cookies) => {
let expires = new Date();
expires.setSeconds(expires.getSeconds() + maxAge);
- let opts = { path: '/', expires }
+ let opts = { path: '/', expires };
cookies.set('username', user.username, opts);
cookies.set('token', token, opts);
};
diff --git a/src/routes/(app)/+layout.server.js b/src/routes/(app)/+layout.server.js
index 4c09937c..11337c2a 100644
--- a/src/routes/(app)/+layout.server.js
+++ b/src/routes/(app)/+layout.server.js
@@ -15,9 +15,9 @@ export async function load({ cookies, request, url, params }) {
} catch (e) {}
}
- if (user?.needsMigration) {
- throw redirect(307, `/migrate`);
- }
+ if (user?.needsMigration) {
+ throw redirect(307, `/migrate`);
+ }
if (user && ['/', '/login', '/register'].includes(pathname) && request.method === 'GET') {
throw redirect(307, `/${user.username}/dashboard`);
diff --git a/src/routes/(app)/[username]/+layout.server.js b/src/routes/(app)/[username]/+layout.server.js
index 8279698a..27502386 100644
--- a/src/routes/(app)/[username]/+layout.server.js
+++ b/src/routes/(app)/[username]/+layout.server.js
@@ -5,8 +5,8 @@ export let load = async ({ depends, params: { username } }) => {
depends('app:user');
try {
- let subject = await get(`/users/${username}`)
- return { subject };
+ let subject = await get(`/users/${username}`);
+ return { subject };
} catch (e) {
console.log(e);
throw error(500, 'Unable to retrieve user account data');
diff --git a/src/routes/(app)/[username]/payments/[...page]/+page.svelte b/src/routes/(app)/[username]/payments/[...page]/+page.svelte
index 4a3f58f5..b46e31d6 100644
--- a/src/routes/(app)/[username]/payments/[...page]/+page.svelte
+++ b/src/routes/(app)/[username]/payments/[...page]/+page.svelte
@@ -59,9 +59,9 @@
payments = payments.map((p) => ({
...p,
created: new Date(p.created),
- fiat: f((p.amount || 0) * p.rate / sats, p.currency),
- fiatfee: f((p.fee || 0) * p.rate / sats, p.currency),
- fiattip: f((p.tip || 0) * p.rate / sats, p.currency)
+ fiat: f(((p.amount || 0) * p.rate) / sats, p.currency),
+ fiatfee: f(((p.fee || 0) * p.rate) / sats, p.currency),
+ fiattip: f(((p.tip || 0) * p.rate) / sats, p.currency)
}));
let keys = [
diff --git a/src/routes/(app)/[username]/payments/[...page]/+server.js b/src/routes/(app)/[username]/payments/[...page]/+server.js
index c33bd864..c7c5222d 100644
--- a/src/routes/(app)/[username]/payments/[...page]/+server.js
+++ b/src/routes/(app)/[username]/payments/[...page]/+server.js
@@ -12,7 +12,7 @@ export async function GET({ cookies, params }) {
let url = `/payments?start=${start * 1000}`;
if (end) url += `&end=${end * 1000}`;
-
+
let { payments } = await get(url, auth(cookies));
return json({ payments });
}
diff --git a/src/routes/(app)/[username]/receive/[...param]/+page.svelte b/src/routes/(app)/[username]/receive/[...param]/+page.svelte
index 1fbd0584..7ca2770e 100644
--- a/src/routes/(app)/[username]/receive/[...param]/+page.svelte
+++ b/src/routes/(app)/[username]/receive/[...param]/+page.svelte
@@ -18,7 +18,7 @@
let { currency, username } = data.subject;
let { user } = data;
- let submit;
+ let submit;
</script>
<form method="POST" class="flex justify-center items-center mt-24 mb-3 px-3" use:enhance>
@@ -34,9 +34,9 @@
<input type="hidden" name="prompt" value={false} />
<div class="space-y-3 w-[300px] mx-auto">
- <Numpad bind:amount bind:currency {submit} />
+ <Numpad bind:amount bind:currency {submit} />
<button
- bind:this={submit}
+ bind:this={submit}
type="submit"
class="bg-black text-white rounded-xl w-full h-[48px] flex justify-center items-center font-semibold
opacity-100 hover:opacity-80"
diff --git a/src/routes/(app)/[username]/settings/[...tab]/+page.svelte b/src/routes/(app)/[username]/settings/[...tab]/+page.svelte
index e1555248..1e8b31ce 100644
--- a/src/routes/(app)/[username]/settings/[...tab]/+page.svelte
+++ b/src/routes/(app)/[username]/settings/[...tab]/+page.svelte
@@ -60,12 +60,12 @@
if ($avatar) {
await upload($avatar.file, $avatar.type, $avatar.progress, token);
- await fetch(`/api/public/${id}-profile.webp`, {cache: 'reload', mode: 'no-cors'})
+ await fetch(`/api/public/${id}-profile.webp`, { cache: 'reload', mode: 'no-cors' });
}
if ($banner) {
await upload($banner.file, $banner.type, $banner.progress, token);
- await fetch(`/api/public/${id}-banner.webp`, {cache: 'reload', mode: 'no-cors'})
+ await fetch(`/api/public/${id}-banner.webp`, { cache: 'reload', mode: 'no-cors' });
}
let event = {
diff --git a/src/routes/(app)/[username]/settings/[...tab]/_account.svelte b/src/routes/(app)/[username]/settings/[...tab]/_account.svelte
index c38334ec..0ab11b32 100644
--- a/src/routes/(app)/[username]/settings/[...tab]/_account.svelte
+++ b/src/routes/(app)/[username]/settings/[...tab]/_account.svelte
@@ -41,7 +41,7 @@
if (file.size > 10000000) return (tooLarge[type] = true);
- if(type === 'profile') {
+ if (type === 'profile') {
$avatar = { id, file, type, progress };
} else if (type === 'banner') {
$banner = { id, file, type, progress };
diff --git a/src/routes/(app)/invoice/[hash]/tip/+page.svelte b/src/routes/(app)/invoice/[hash]/tip/+page.svelte
index eaa67170..ea0ab903 100644
--- a/src/routes/(app)/invoice/[hash]/tip/+page.svelte
+++ b/src/routes/(app)/invoice/[hash]/tip/+page.svelte
@@ -190,7 +190,7 @@
on:input={(e) => handleCustomTipAmount(e)}
class="pl-10"
placeholder="Custom amount"
- use:focus
+ use:focus
/>
<button
type="submit"
diff --git a/src/routes/(app)/invoice/sent/+page.svelte b/src/routes/(app)/invoice/sent/+page.svelte
index 59233617..ae71eb2e 100644
--- a/src/routes/(app)/invoice/sent/+page.svelte
+++ b/src/routes/(app)/invoice/sent/+page.svelte
@@ -1,6 +1,6 @@
<script>
import { Avatar, Icon } from '$comp';
- import { request } from "$lib/store";
+ import { request } from '$lib/store';
</script>
Invoice sent to
diff --git a/src/routes/(app)/ln/[lnurl]/+page.server.js b/src/routes/(app)/ln/[lnurl]/+page.server.js
index 1b63e975..a12b063c 100644
--- a/src/routes/(app)/ln/[lnurl]/+page.server.js
+++ b/src/routes/(app)/ln/[lnurl]/+page.server.js
@@ -42,9 +42,8 @@ export const actions = {
withdraw: async ({ cookies, fetch, request }) => {
let error;
- let { callback, amount, username, currency, minWithdrawable, maxWithdrawable, k1 } = Object.fromEntries(
- await request.formData()
- );
+ let { callback, amount, username, currency, minWithdrawable, maxWithdrawable, k1 } =
+ Object.fromEntries(await request.formData());
minWithdrawable = Math.round(minWithdrawable / 1000);
maxWithdrawable = Math.round(maxWithdrawable / 1000);
diff --git a/src/routes/(app)/ln/[lnurl]/+page.svelte b/src/routes/(app)/ln/[lnurl]/+page.svelte
index ce73b387..7656c9fb 100644
--- a/src/routes/(app)/ln/[lnurl]/+page.svelte
+++ b/src/routes/(app)/ln/[lnurl]/+page.svelte
@@ -1,7 +1,7 @@
<script>
import { Lnurlp, Lnurlw } from '$comp';
- export let data;
- let { tag } = data;
+ export let data;
+ let { tag } = data;
</script>
{#if tag === 'payRequest'}
diff --git a/src/routes/(app)/payment/[id]/+page.svelte b/src/routes/(app)/payment/[id]/+page.svelte
index bcad7205..a961d14d 100644
--- a/src/routes/(app)/payment/[id]/+page.svelte
+++ b/src/routes/(app)/payment/[id]/+page.svelte
@@ -51,7 +51,9 @@
<div class="font-bold">{$t('payments.id')}</div>
<div class="flex">
<div>
- <a href={`${expl}/tx/${id}`} target="_blank" rel="noreferrer" class="text-blue-600">{id}</a>
+ <a href={`${expl}/tx/${id}`} target="_blank" rel="noreferrer" class="text-blue-600"
+ >{id}</a
+ >
</div>
<button class="flex font-bold hover:opacity-80 mb-auto" on:click={() => copy(id)}
><Icon icon="copy" style="mr-1" />
diff --git a/src/routes/(app)/pot/[name]/+page.svelte b/src/routes/(app)/pot/[name]/+page.svelte
index 53ee9da2..2d93abfc 100644
--- a/src/routes/(app)/pot/[name]/+page.svelte
+++ b/src/routes/(app)/pot/[name]/+page.svelte
@@ -36,7 +36,7 @@
<h1 class="text-2xl md:text-3xl font-semibold">Public Pot</h1>
</div>
<p class="text-secondary">Anyone who knows the URL to this pot can add or take out funds</p>
- <img {src} class="mx-auto" alt={name} />
+ <img {src} class="mx-auto" alt={name} />
<div class="flex justify-center gap-4">
<div class="my-auto">
<h2 class="text-2xl md:text-3xl font-semibold">
diff --git a/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte b/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte
index 0da8ea10..6b216cb3 100644
--- a/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte
+++ b/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte
@@ -40,7 +40,7 @@
<Numpad bind:amount {currency} {submit} />
<form method="POST" use:enhance on:submit={toggle}>
- <input name="ts" value={Date.now()} type="hidden" />
+ <input name="ts" value={Date.now()} type="hidden" />
<input name="address" value={address} type="hidden" />
<input name="amount" value={amount} type="hidden" />
<input name="pin" value={$pin} type="hidden" />