From 578613c869a0172f1b69e5f4beb3b4253ad5d311 Mon Sep 17 00:00:00 2001 From: protom Date: Sat, 22 Aug 2026 16:56:49 +0200 Subject: [PATCH] refactor: split wallet onboarding panels --- src/components/welcome/WelcomeBackupPanel.vue | 109 ++++ src/components/welcome/WelcomeCreatePanel.vue | 121 ++++ src/components/welcome/WelcomeNostrPanel.vue | 163 +++++ src/components/welcome/WelcomeSeedPanel.vue | 96 +++ src/composables/welcomePassword.ts | 4 + src/pages/WelcomePage.vue | 562 +----------------- 6 files changed, 509 insertions(+), 546 deletions(-) create mode 100644 src/components/welcome/WelcomeBackupPanel.vue create mode 100644 src/components/welcome/WelcomeCreatePanel.vue create mode 100644 src/components/welcome/WelcomeNostrPanel.vue create mode 100644 src/components/welcome/WelcomeSeedPanel.vue create mode 100644 src/composables/welcomePassword.ts diff --git a/src/components/welcome/WelcomeBackupPanel.vue b/src/components/welcome/WelcomeBackupPanel.vue new file mode 100644 index 0000000..c4b044c --- /dev/null +++ b/src/components/welcome/WelcomeBackupPanel.vue @@ -0,0 +1,109 @@ + + + diff --git a/src/components/welcome/WelcomeCreatePanel.vue b/src/components/welcome/WelcomeCreatePanel.vue new file mode 100644 index 0000000..6a9303e --- /dev/null +++ b/src/components/welcome/WelcomeCreatePanel.vue @@ -0,0 +1,121 @@ + + + + + diff --git a/src/components/welcome/WelcomeNostrPanel.vue b/src/components/welcome/WelcomeNostrPanel.vue new file mode 100644 index 0000000..a0ee4a4 --- /dev/null +++ b/src/components/welcome/WelcomeNostrPanel.vue @@ -0,0 +1,163 @@ + + + diff --git a/src/components/welcome/WelcomeSeedPanel.vue b/src/components/welcome/WelcomeSeedPanel.vue new file mode 100644 index 0000000..2605f06 --- /dev/null +++ b/src/components/welcome/WelcomeSeedPanel.vue @@ -0,0 +1,96 @@ + + + diff --git a/src/composables/welcomePassword.ts b/src/composables/welcomePassword.ts new file mode 100644 index 0000000..5d0cd05 --- /dev/null +++ b/src/composables/welcomePassword.ts @@ -0,0 +1,4 @@ +export const MIN_PASSWORD_LENGTH = 8; + +export const passwordValid = (password: string, confirmation: string): boolean => + password === '' || (password.length >= MIN_PASSWORD_LENGTH && password === confirmation); diff --git a/src/pages/WelcomePage.vue b/src/pages/WelcomePage.vue index e071e2e..cbb99d2 100644 --- a/src/pages/WelcomePage.vue +++ b/src/pages/WelcomePage.vue @@ -4,20 +4,15 @@
A wallet for lnurlcash bearer notes.
- - - A wallet already exists on this device. Setting up a new one replaces its key — - notes belonging to the current wallet become unreadable until its own seed is - restored again. + + A wallet already exists on this device. Setting up a new one replaces its key — notes + belonging to the current wallet become unreadable until its own seed is restored again. - - - -
- - - -
- - -
- -
- Password (optional) — encrypts your wallet on this device and enables - locking. Minimum {{ MIN_PASSWORD_LENGTH }} characters. Leave empty to store - unencrypted. -
- - -
- At least {{ MIN_PASSWORD_LENGTH }} characters. -
-
- Passwords do not match. -
-
{{ restoreError }}
- -
- - -
-
- If this wallet used nostr backup before, your notes, mints and settings are - waiting on your relays - encrypted so only your recovery phrase can read - them. -
- -
Relays to look on
- - -
{{ nostrError }}
- - - - -
- - -
-
- Sets this device up from a downloaded backup file — no recovery phrase - needed, as long as you still know the password the backup was encrypted - with. Notes from the file are merged into storage either way. -
- - - - This device already has a wallet, so the backup's own key was - not installed. Its notes were merged and will appear if the - existing wallet is the one this backup belongs to. - - - - - -
+ + + + + +
+