-
Add a tip?
-
-
- {tipAmountFormatted}{`(${tipAmountSats} SATS)`}
- {tipPercent}%
-
-
-
{
- customTipAmount = '';
- tipPercent = e.target.value;
- }}
- />
-
-
- {#each tipAmounts as amount}
-
goto('/receive')}>
+
+
+
+
+
+ {#if $invoiceAmount && $invoiceAmountFiat && $rate && text}
+
+
+
Add a tip?
+
+
+ {tipAmountFormatted}{`(${tipAmountSats} SATS)`}
- {/each}
+ {tipPercent}%
+
-
-
-
-
-
-
-
-
Scan to pay insert name here
-
-
- Invoice
- {invoiceAmountFiatFormatted}
- {`(${invoiceAmountFormatted} SATS)`}
-
-
-
- Tip
- {tipAmountFormatted}
- {`(${tipAmountSats} SATS)`}
-
+
+
+
Scan to pay insert name here
-
-
Total
-
{totalAmountFormatted}
- {`(${totalAmountSats} SATS)`}
+
+
+
+
+ Invoice
+ {invoiceAmountFiatFormatted}
+ {`(${invoiceAmountFormatted} SATS)`}
+
+
+
+ Tip
+ {tipAmountFormatted}
+ {`(${tipAmountSats} SATS)`}
+
+
+
+ Total
+ {totalAmountFormatted}
+ {`(${totalAmountSats} SATS)`}
+
-
- {:else}
-
-
-
- {/if}
+ {:else}
+
+
+
+ {/if}
+
-
+{/if}
diff --git a/src/routes/invoice/[id].js b/src/routes/invoice/[id].js
new file mode 100644
index 00000000..37ef098d
--- /dev/null
+++ b/src/routes/invoice/[id].js
@@ -0,0 +1,11 @@
+import { get } from '$lib/utils';
+
+const username = 'bob',
+ network = 'lightning';
+
+export async function GET({ params }) {
+ let { id } = params;
+ let { amount, text } = await get(`/invoice?uuid=${id}`);
+
+ return { body: { amount, text } };
+}
diff --git a/src/routes/invoice/[id].svelte b/src/routes/invoice/[id].svelte
new file mode 100644
index 00000000..d1dea907
--- /dev/null
+++ b/src/routes/invoice/[id].svelte
@@ -0,0 +1,322 @@
+
+
+{#if $user}
+
+
+
+
+
+ {#if $invoiceAmount && $invoiceAmountFiat && $rate && text}
+
+
+
Add a tip?
+
+
+ {tipAmountFormatted}{`(${tipAmountSats} SATS)`}
+ {tipPercent}%
+
+
+
{
+ customTipAmount = '';
+ tipPercent = e.target.value;
+ }}
+ />
+
+
+ {#each tipAmounts as amount}
+
+ {/each}
+
+
+ $
+ handleCustomTipAmount(e)}
+ class="bg-primary rounded-2xl py-3 px-10 font-semibold mt-2 mr-1 w-full md:w-auto"
+ placeholder="Other"
+ />
+
+
+
+
+
+
+
+
+
+
+
+
Scan to pay {$user.username}
+
+
+
+
+
+ Invoice
+ {invoiceAmountFiatFormatted}
+ {`(${invoiceAmountFormatted} SATS)`}
+
+
+
+ Tip
+ {tipAmountFormatted}
+ {`(${tipAmountSats} SATS)`}
+
+
+
+ Total
+ {totalAmountFormatted}
+ {`(${totalAmountSats} SATS)`}
+
+
+
+ {:else}
+
+
+
+ {/if}
+
+
+
+{/if}
+
+
diff --git a/src/routes/invoice/index.js b/src/routes/invoice/index.js
new file mode 100644
index 00000000..26bffd37
--- /dev/null
+++ b/src/routes/invoice/index.js
@@ -0,0 +1,11 @@
+import { post } from '$lib/utils';
+
+let network = 'lightning';
+
+export async function POST({ request }) {
+ let { amount, username } = await request.json();
+ let { text } = await post('/lightning/invoice', );
+ let { uuid: id } = await post('/invoice', { invoice: { text, network }, user: { username } });
+
+ return { body: { id } };
+}
diff --git a/src/routes/receive.svelte b/src/routes/receive.svelte
deleted file mode 100644
index 0329dea4..00000000
--- a/src/routes/receive.svelte
+++ /dev/null
@@ -1,178 +0,0 @@
-
-
-{#if $user}
-
-
-
- {#if $rate}
-
-
-
-
- {useFiat ? `$${amountFiat}` : amountSatsFormatted}{useFiat ? 'USD' : 'SATS'}
-
-
{useFiat ? `${amountSatsConverted} SATS` : `${amountFiatConverted} USD`}
-
-
-
-
- {#if message}
-
- {/if}
-
-
-
- {#each numPad as value}
- {#if value === '<'}
-
- {:else}
-
- {/if}
- {/each}
-
-
-
-
-
-
-
-
- {:else}
-
- {/if}
-
-{/if}
--
cgit v1.2.3
From 19ae0d9eb2f1a1c08b04f5c56e8ebd266ef32da8 Mon Sep 17 00:00:00 2001
From: secondl1ght <85003930+secondl1ght@users.noreply.github.com>
Date: Sat, 30 Jul 2022 13:02:42 -0600
Subject: format and remove console logs
---
src/components/AppHeader.svelte | 20 +++++++++---------
src/components/RegisterOrLogin.svelte | 2 +-
src/lib/socket.js | 4 ++--
src/lib/utils.js | 2 +-
src/routes/[username]/index.js | 2 +-
src/routes/[username]/index.svelte | 2 --
src/routes/[username]/receive.svelte | 3 +--
src/routes/__layout.svelte | 2 +-
src/routes/invoice/[id].js | 1 -
src/routes/invoice/index.js | 9 +++++---
src/routes/logout/done.svelte | 20 +++++++++---------
src/routes/logout/index.js | 40 +++++++++++++++++------------------
12 files changed, 53 insertions(+), 54 deletions(-)
(limited to 'src/components/AppHeader.svelte')
diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte
index 99eea6d5..1c6f639c 100644
--- a/src/components/AppHeader.svelte
+++ b/src/components/AppHeader.svelte
@@ -8,19 +8,19 @@
+
+
diff --git a/src/components/LandingHeader.svelte b/src/components/LandingHeader.svelte
index 4da9a17e..927c8749 100644
--- a/src/components/LandingHeader.svelte
+++ b/src/components/LandingHeader.svelte
@@ -2,6 +2,7 @@
import { goto } from '$app/navigation';
import { scroll } from '$lib/utils';
import { Icon } from '$comp';
+ import { user } from '$lib/store';
export let howItWorks;
export let faq;
@@ -17,15 +18,24 @@
-
-
+ {#if !$user}
+
+
+ {:else}
+
+ {/if}
diff --git a/src/lib/socket.js b/src/lib/socket.js
index 36d41ea8..c7c541e1 100644
--- a/src/lib/socket.js
+++ b/src/lib/socket.js
@@ -18,7 +18,7 @@ export const messages = (data) => ({
},
payment() {
- console.log(data);
+ console.log(data, 'payment');
},
connected: auth,
diff --git a/src/routes/[username]/customers.svelte b/src/routes/[username]/customers.svelte
new file mode 100644
index 00000000..1935b156
--- /dev/null
+++ b/src/routes/[username]/customers.svelte
@@ -0,0 +1,5 @@
+
+
+
diff --git a/src/routes/[username]/dashboard.svelte b/src/routes/[username]/dashboard.svelte
new file mode 100644
index 00000000..1935b156
--- /dev/null
+++ b/src/routes/[username]/dashboard.svelte
@@ -0,0 +1,5 @@
+
+
+
diff --git a/src/routes/[username]/settings.svelte b/src/routes/[username]/settings.svelte
new file mode 100644
index 00000000..1935b156
--- /dev/null
+++ b/src/routes/[username]/settings.svelte
@@ -0,0 +1,5 @@
+
+
+
diff --git a/src/routes/[username]/support.svelte b/src/routes/[username]/support.svelte
new file mode 100644
index 00000000..1935b156
--- /dev/null
+++ b/src/routes/[username]/support.svelte
@@ -0,0 +1,5 @@
+
+
+
diff --git a/src/routes/[username]/transactions.svelte b/src/routes/[username]/transactions.svelte
new file mode 100644
index 00000000..1935b156
--- /dev/null
+++ b/src/routes/[username]/transactions.svelte
@@ -0,0 +1,5 @@
+
+
+
diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte
index d26ccfed..736f38e8 100644
--- a/src/routes/__layout.svelte
+++ b/src/routes/__layout.svelte
@@ -18,7 +18,7 @@
if (protectedRoutes.find((p) => $page.url.pathname.match(p))) {
if (!$token) {
goto('/login');
- toast.push('Please login to continue.');
+ toast.push('Please sign in to continue.');
}
user.subscribe((u) => (ready = true));
} else {
diff --git a/static/icons/customers.svg b/static/icons/customers.svg
new file mode 100644
index 00000000..0b6081ba
--- /dev/null
+++ b/static/icons/customers.svg
@@ -0,0 +1,3 @@
+
diff --git a/static/icons/dash.svg b/static/icons/dash.svg
new file mode 100644
index 00000000..acb39ab9
--- /dev/null
+++ b/static/icons/dash.svg
@@ -0,0 +1,3 @@
+
diff --git a/static/icons/logout.svg b/static/icons/logout.svg
index 495d6574..a614cfc0 100644
--- a/static/icons/logout.svg
+++ b/static/icons/logout.svg
@@ -1,3 +1,3 @@
-