From 27cbd543cece74228680d74f276eca89e13b557b Mon Sep 17 00:00:00 2001 From: secondl1ght <85003930+secondl1ght@users.noreply.github.com> Date: Sat, 30 Jul 2022 20:45:19 -0600 Subject: add user public page --- src/components/AppHeader.svelte | 84 ++++++++++++++++++--------------- src/lib/utils.js | 4 ++ src/routes/[username]/index.svelte | 96 ++++++++++++++++++++++++++++++++------ src/routes/__layout.svelte | 11 ++++- 4 files changed, 143 insertions(+), 52 deletions(-) (limited to 'src') diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte index 9f73adbf..d0123650 100644 --- a/src/components/AppHeader.svelte +++ b/src/components/AppHeader.svelte @@ -5,6 +5,8 @@ import { goto } from '$app/navigation'; import { Icon } from '$comp'; + export let avatarPosition = 'left-[calc(50vw-48px)]'; + const menuButtons = [ { title: 'Customers', icon: 'customers', goto: 'customers' }, { title: 'Dashboard', icon: 'dash', goto: 'dashboard' }, @@ -24,48 +26,54 @@ }; -
+
diff --git a/src/lib/utils.js b/src/lib/utils.js index 22c88522..7831c519 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -17,3 +17,7 @@ export const post = (url, body) => body: JSON.stringify(body), headers: { accept: 'application/json', 'content-type': 'application/json' } }).then((r) => r.json()); + +export const copy = (text) => { + navigator.clipboard.writeText(text); +}; diff --git a/src/routes/[username]/index.svelte b/src/routes/[username]/index.svelte index 90d0c04a..a53b94cc 100644 --- a/src/routes/[username]/index.svelte +++ b/src/routes/[username]/index.svelte @@ -1,24 +1,94 @@ -{#if $user?.username === username} - -
-
-
- Signed in as {username} + +{#if username} + + +
+
+
+

{username}

+ +

Address goes here

+ +
-
- - - +
+
+
+
+ +

Scan to pay with Bitcoin

+ +
+ {lightning} + +
diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte index 736f38e8..b2cb8aae 100644 --- a/src/routes/__layout.svelte +++ b/src/routes/__layout.svelte @@ -30,8 +30,17 @@ {#if ready} - + {:else} {/if} + + -- cgit v1.2.3