From c3dea9f01d4d21b5cef7586f198e2ac4a9823839 Mon Sep 17 00:00:00 2001 From: Ben Weeks Date: Wed, 24 Dec 2025 11:10:39 +0000 Subject: [PATCH] feat: add merchant profile panel to Merchant tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Display merchant profile information with: - Banner image or grey placeholder - Profile avatar with shadow - Display name (or name fallback) - About description - NIP-05 verified identity indicator - Lightning address (LUD16) Extends MerchantProfile model with new fields: display_name, banner, nip05, lud16 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- models.py | 4 + static/components/key-pair.js | 17 +- static/components/merchant-tab.js | 3 +- .../nostrmarket/components/key-pair.html | 159 ++++++++---------- .../nostrmarket/components/merchant-tab.html | 68 +------- templates/nostrmarket/index.html | 1 + 6 files changed, 89 insertions(+), 163 deletions(-) diff --git a/models.py b/models.py index f1af073..73e6687 100644 --- a/models.py +++ b/models.py @@ -33,8 +33,12 @@ class Nostrable: class MerchantProfile(BaseModel): name: str | None = None + display_name: str | None = None about: str | None = None picture: str | None = None + banner: str | None = None + nip05: str | None = None + lud16: str | None = None class MerchantConfig(MerchantProfile): diff --git a/static/components/key-pair.js b/static/components/key-pair.js index 5bf9d23..d324bc0 100644 --- a/static/components/key-pair.js +++ b/static/components/key-pair.js @@ -2,21 +2,10 @@ window.app.component('key-pair', { name: 'key-pair', template: '#key-pair', delimiters: ['${', '}'], - props: ['public-key', 'private-key'], - data: function () { - return { - showPrivateKey: false - } - }, + props: ['public-key', 'private-key', 'merchant-config'], methods: { - copyText: function (text, message, position) { - var notify = this.$q.notify - Quasar.copyToClipboard(text).then(function () { - notify({ - message: message || 'Copied to clipboard!', - position: position || 'bottom' - }) - }) + handleImageError: function (event) { + event.target.style.display = 'none' } } }) diff --git a/static/components/merchant-tab.js b/static/components/merchant-tab.js index c82d853..3c48281 100644 --- a/static/components/merchant-tab.js +++ b/static/components/merchant-tab.js @@ -10,7 +10,8 @@ window.app.component('merchant-tab', { 'merchant-active', 'public-key', 'private-key', - 'is-admin' + 'is-admin', + 'merchant-config' ], computed: { marketClientUrl: function () { diff --git a/templates/nostrmarket/components/key-pair.html b/templates/nostrmarket/components/key-pair.html index 911e057..2becf66 100644 --- a/templates/nostrmarket/components/key-pair.html +++ b/templates/nostrmarket/components/key-pair.html @@ -1,93 +1,82 @@ -
- + + + + - -
-
Keys
- -
- - -
- -
- - -
Public Key
-
- - - -
-
- ... -
- + +
+ +
+ + - - -
+ + +
- -
- - -
- - Private Key (Keep Secret!) + +
+
+
+
+ +
+
(No name set)
+
+
+
+ +
+
+
+ +
- - - + +
-
- ... -
- - - +
+
-
-
+ + diff --git a/templates/nostrmarket/components/merchant-tab.html b/templates/nostrmarket/components/merchant-tab.html index 0684c62..63fe48f 100644 --- a/templates/nostrmarket/components/merchant-tab.html +++ b/templates/nostrmarket/components/merchant-tab.html @@ -1,69 +1,11 @@
-
-
- -
-
-
- - -
-
-
- - - Restart the connection to the nostrclient extension - - -
-
-
-
-
- Hide Keys -
-
-
-
- -
-
-
+
diff --git a/templates/nostrmarket/index.html b/templates/nostrmarket/index.html index 9f89808..fbb2def 100644 --- a/templates/nostrmarket/index.html +++ b/templates/nostrmarket/index.html @@ -152,6 +152,7 @@ :public-key="merchant.public_key" :private-key="merchant.private_key" :is-admin="g.user.admin" + :merchant-config="merchant.config" @toggle-show-keys="toggleShowKeys" @hide-keys="showKeys = false" @merchant-deleted="handleMerchantDeleted"