aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-02-08 10:13:03 -0800
committerAdam Soltys <[email protected]>2023-02-08 10:13:03 -0800
commit3b7e5e3492684b3d08f37cb078d6eec3fa4da0b2 (patch)
treee22c32c9948e4bacfc14bdc8f95a16c557a916e5 /src/routes
parent38a1046a92a8f6e3168c5054dc7de2cb3fd8e726 (diff)
downloadcoinos-ui-3b7e5e3492684b3d08f37cb078d6eec3fa4da0b2.tar.gz
coinos-ui-3b7e5e3492684b3d08f37cb078d6eec3fa4da0b2.zip
rm uuid route
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/(app)/[username]/(profile)/+page.server.js4
-rw-r--r--src/routes/(app)/[username]/(profile)/+page.svelte27
-rw-r--r--src/routes/(app)/send/[...text]/+page.server.js1
-rw-r--r--src/routes/(app)/send/invoice/[id]/+page.server.js (renamed from src/routes/(app)/send/[uuid=uuid]/+page.server.js)6
-rw-r--r--src/routes/(app)/send/invoice/[id]/+page.svelte (renamed from src/routes/(app)/send/[uuid=uuid]/+page.svelte)0
-rw-r--r--src/routes/(static)/+layout.svelte8
-rw-r--r--src/routes/(static)/bounties/+page.svelte1
7 files changed, 39 insertions, 8 deletions
diff --git a/src/routes/(app)/[username]/(profile)/+page.server.js b/src/routes/(app)/[username]/(profile)/+page.server.js
index 553e2559..c68cfecc 100644
--- a/src/routes/(app)/[username]/(profile)/+page.server.js
+++ b/src/routes/(app)/[username]/(profile)/+page.server.js
@@ -16,7 +16,7 @@ export async function load({ cookies, params, parent, url }) {
e.seen = e.created_at;
});
- let { requests } = await get('/requests', auth(cookies));
+ let { invoices, sent, received } = await get('/requests', auth(cookies));
- return { events, requests };
+ return { invoices, events, sent, received };
}
diff --git a/src/routes/(app)/[username]/(profile)/+page.svelte b/src/routes/(app)/[username]/(profile)/+page.svelte
index ae8add63..557ac9b4 100644
--- a/src/routes/(app)/[username]/(profile)/+page.svelte
+++ b/src/routes/(app)/[username]/(profile)/+page.svelte
@@ -3,7 +3,7 @@
import { t } from '$lib/translations';
export let data;
- let { events, requests, subject, user } = data;
+ let { events, invoices, sent, received, subject, user } = data;
</script>
<div class="flex justify-center lg:justify-start">
@@ -13,7 +13,30 @@
</div>
<div>
- {#each requests as { id, invoice, memo, requester: r }}
+ {#each invoice}
+ <a href={`/${user.username}/receive/${id}`}>
+ <div class="border-b p-2 last:border-b-0 hover:bg-gray-100">
+ <div class="flex">
+ <div>
+ <div class="flex">
+ <Avatar user={r} size={20} />
+ <div class="my-auto text-left">
+ <p class="ml-1 text-lg break-words">{r.username}</p>
+ <p class="ml-1 text-secondary">{memo}</p>
+ </div>
+ </div>
+ </div>
+ <div class="whitespace-nowrap my-auto ml-auto flex gap-2">
+ <button class="rounded-full border py-2 px-4 font-bold hover:opacity-80 w-full"
+ >Invoice</button
+ >
+ </div>
+ </div>
+ </div>
+ </a>
+ {/each}
+
+ {#each received as { id, invoice, memo, requester: r }}
<a href={`/${user.username}/receive/${id}`}>
<div class="border-b p-2 last:border-b-0 hover:bg-gray-100">
<div class="flex">
diff --git a/src/routes/(app)/send/[...text]/+page.server.js b/src/routes/(app)/send/[...text]/+page.server.js
index c64361ff..096c60e9 100644
--- a/src/routes/(app)/send/[...text]/+page.server.js
+++ b/src/routes/(app)/send/[...text]/+page.server.js
@@ -58,6 +58,7 @@ let parse = async (t, host) => {
// user
try {
user = await get(`/users/${t}`);
+ if (user.anon) user = null;
} catch (e) {}
if (user) throw redirect(307, `/send/user/${t}`);
diff --git a/src/routes/(app)/send/[uuid=uuid]/+page.server.js b/src/routes/(app)/send/invoice/[id]/+page.server.js
index a59853d3..6b7823ce 100644
--- a/src/routes/(app)/send/[uuid=uuid]/+page.server.js
+++ b/src/routes/(app)/send/invoice/[id]/+page.server.js
@@ -1,17 +1,17 @@
import { error, fail, redirect } from '@sveltejs/kit';
import { btc as asset, auth, get, post } from '$lib/utils';
-export async function load({ params, parent }) {
+export async function load({ params: { id }, parent }) {
let { user } = await parent();
- let { amount, address, tip, text, user: recipient } = await get(`/invoice/${params.uuid}`);
+ let { amount, address, tip, text, user: recipient } = await get(`/invoice/${id}`);
if (recipient.username === user.username) throw error(500, { message: 'Cannot send to self' });
if (tip) amount += tip;
return { amount, address, payreq: text, recipient };
}
export const actions = {
- default: async ({ cookies, params, request }) => {
+ default: async ({ cookies, request }) => {
try {
let body = Object.fromEntries(await request.formData());
let { confirmed } = body;
diff --git a/src/routes/(app)/send/[uuid=uuid]/+page.svelte b/src/routes/(app)/send/invoice/[id]/+page.svelte
index 27837bca..27837bca 100644
--- a/src/routes/(app)/send/[uuid=uuid]/+page.svelte
+++ b/src/routes/(app)/send/invoice/[id]/+page.svelte
diff --git a/src/routes/(static)/+layout.svelte b/src/routes/(static)/+layout.svelte
index a7a1ab22..dde9fd11 100644
--- a/src/routes/(static)/+layout.svelte
+++ b/src/routes/(static)/+layout.svelte
@@ -1,3 +1,9 @@
-<main class="container flex px-10 md:px-40 mx-auto">
+<script>
+ import { Footer, LandingHeader } from "$comp";
+</script>
+
+<LandingHeader />
+<main class="container flex px-10 md:px-40 mx-auto min-h-[600px]">
<slot />
</main>
+<Footer />
diff --git a/src/routes/(static)/bounties/+page.svelte b/src/routes/(static)/bounties/+page.svelte
new file mode 100644
index 00000000..45b983be
--- /dev/null
+++ b/src/routes/(static)/bounties/+page.svelte
@@ -0,0 +1 @@
+hi