From 0226fc3f79f4548d8f431a9efb79888895823e2d Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Mon, 17 Jul 2023 15:13:08 +0300 Subject: [PATCH] feat: prepare for naddr fix --- .../market-config/market-config.html | 22 ++++++------ .../components/market-config/market-config.js | 34 ++++++++++++++----- static/js/market.js | 3 ++ templates/nostrmarket/market.html | 4 +-- 4 files changed, 43 insertions(+), 20 deletions(-) diff --git a/static/components/market-config/market-config.html b/static/components/market-config/market-config.html index 79ad58e..adcd923 100644 --- a/static/components/market-config/market-config.html +++ b/static/components/market-config/market-config.html @@ -15,7 +15,7 @@
- +
@@ -85,20 +85,22 @@
Information
- + + -
UI Configurations
- + + - - - + +
@@ -111,8 +113,8 @@
- - + +
diff --git a/static/components/market-config/market-config.js b/static/components/market-config/market-config.js index 6255fed..9c6c269 100644 --- a/static/components/market-config/market-config.js +++ b/static/components/market-config/market-config.js @@ -2,7 +2,7 @@ async function marketConfig(path) { const template = await loadTemplateAsync(path) Vue.component('market-config', { name: 'market-config', - props: ['merchants', 'relays'], + props: ['merchants', 'relays', 'config'], template, data: function () { @@ -12,13 +12,27 @@ async function marketConfig(path) { profiles: new Map(), merchantPubkey: null, relayUrl: null, - info: { + configData: { + identifier: null, name: null, - description: null, - theme: null, - logo: null, - banner: null - } + about: null, + ui: { + picture: null, + banner: null, + theme: null + } + }, + themeOptions: [ + 'classic', + 'bitcoin', + 'flamingo', + 'cyber', + 'freedom', + 'mint', + 'autumn', + 'monochrome', + 'salvador' + ] } }, methods: { @@ -67,9 +81,13 @@ async function marketConfig(path) { removeRelay: async function (relay) { this.$emit('remove-relay', relay) }, + updateUiConfig: function () { + console.log('### this.info', this.configData) + this.$emit('ui-config-update', this.configData) + } }, created: async function () { - + this.configData = { ...this.configData, ...this.config } } }) } diff --git a/static/js/market.js b/static/js/market.js index 3efd8e0..ace2d73 100644 --- a/static/js/market.js +++ b/static/js/market.js @@ -345,6 +345,9 @@ const market = async () => { } this.configDialog.show = true }, + updateUiConfig(configData) { + console.log('### updateUiConfig', configData) + }, async sendConfig() { let { name, about, ui } = this.configDialog.data let merchants = Array.from(this.pubkeys) diff --git a/templates/nostrmarket/market.html b/templates/nostrmarket/market.html index 8c7c17d..4f603a2 100644 --- a/templates/nostrmarket/market.html +++ b/templates/nostrmarket/market.html @@ -265,8 +265,8 @@ + @remove-merchant="removeMerchant" :relays="relays" @add-relay="addRelay" @remove-relay="removeRelay" + :config="configDialog" @ui-config-update="updateUiConfig">