From c5ef18aec5de023732eb6b86f768f206462fea93 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 4 Sep 2024 18:59:30 -0700 Subject: wip --- .../(app)/[username]/(profile)/+layout.svelte | 66 ++--- src/routes/(app)/[username]/(profile)/+page.svelte | 282 +++------------------ .../(app)/[username]/account/setup/+page.svelte | 64 +++++ .../[username]/account/setup/step2/+page.svelte | 46 ++++ 4 files changed, 167 insertions(+), 291 deletions(-) create mode 100644 src/routes/(app)/[username]/account/setup/+page.svelte create mode 100644 src/routes/(app)/[username]/account/setup/step2/+page.svelte (limited to 'src/routes/(app)') diff --git a/src/routes/(app)/[username]/(profile)/+layout.svelte b/src/routes/(app)/[username]/(profile)/+layout.svelte index c4750581..2caf9b30 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.svelte +++ b/src/routes/(app)/[username]/(profile)/+layout.svelte @@ -84,11 +84,10 @@
-
-
{display || username}
-
+ {#if subject.address}
{$t("user.followers")}
- -
{#if showDetails} -
+
-
{$t("user.profilePage")}
+
{$t("user.lightningAddress")}
-
- {profile} +
+ {lnaddr}
- - +
-
{$t("user.lightningAddress")}
+
{$t("user.url")}
-
- {lnaddr} +
+ {profile}
- - +
-
{$t("user.nostrPubkey")}
+
{$t("user.nostrPubkey")}
-
+
{npub}
@@ -188,9 +170,9 @@
{#if user.id === subject.id}
-
{$t("user.nwc")}
+
{$t("user.nwc")}
-
+
{nwc}
diff --git a/src/routes/(app)/[username]/(profile)/+page.svelte b/src/routes/(app)/[username]/(profile)/+page.svelte index 32e6807a..afb4e58c 100644 --- a/src/routes/(app)/[username]/(profile)/+page.svelte +++ b/src/routes/(app)/[username]/(profile)/+page.svelte @@ -1,283 +1,67 @@ - + user.savings = 0; -{#if deleting} - + let accounts = [ + { balance: user.balance, setup: true, type: "Cash" }, + { balance: user.savings, setup: false, type: "Savings" }, + ]; + + +{#if !user.balance} +
+

+ {$t("user.welcome")} +

+
{/if}
{#if user?.id === subject.id} -
- -
- - {#if !user.balance} -
-

- {$t("user.welcome")} -

-
- {/if} - -
- - - - - - - - - {#if $installPrompt} - - {/if} -
- {/if} + {#each accounts as account} + + {/each} - {#if items.length} -

Select items

- {/if} -
- {#each items as i (i.id)} + {#if $installPrompt} - - - - - - -
- {/if} -
-
-
-
-
{i.name}
-
-
- {f(i.price, currency)} -
-
- {sat(btc(i.price, rate))} -
-
-
-
- {#if i.quantity} - - {/if} -
- {#if i.quantity}{i.quantity}{:else}—{/if} -
- {#if i.quantity} - - {/if} -
+
+ +
+ {$t("user.install")}
- {/each} -
+ {/if} + {/if} + + +
+ import { copy } from "$lib/utils"; + import { t } from "$lib/translations"; + import Icon from "$comp/Icon.svelte"; + import { mnemonic } from "$lib/store"; + import { generateMnemonic } from "@scure/bip39"; + import { wordlist } from "@scure/bip39/wordlists/english"; + + export let data; + let { user } = data; + + let reveal; + + let toggleSeed = async () => { + try { + $mnemonic = await generateMnemonic(wordlist); + reveal = !reveal; + } catch (e) { + console.log(e); + } + }; + + +
+

Account setup

+

Step 1

+ +
+

+ The keys to your savings account are derived from a seed phrase. When + you're ready, write it down and keep it safe. +

+ +

+ Whoever knows these words can withdraw funds from the account. We can't + help you recover them if you lose them. +

+ + {#if reveal} +
+ {$mnemonic} +
+ + + {:else} +
+ +
+ {/if} +
+
diff --git a/src/routes/(app)/[username]/account/setup/step2/+page.svelte b/src/routes/(app)/[username]/account/setup/step2/+page.svelte new file mode 100644 index 00000000..3b403295 --- /dev/null +++ b/src/routes/(app)/[username]/account/setup/step2/+page.svelte @@ -0,0 +1,46 @@ + + +
+
+

Account setup

+

Step 2

+
+ +
+

+ Add an additional password to your seed phrase. It should be different + than your login password. We can't reset it if you lose it. +

+ + + + +
+
-- cgit v1.2.3