From 7cfb12011c8302757df870cc6d6de14e81760f2e Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Mon, 17 Jul 2023 15:51:10 +0300 Subject: [PATCH] chore: code clean-up --- static/js/market.js | 16 +-- templates/nostrmarket/market.html | 212 +----------------------------- 2 files changed, 9 insertions(+), 219 deletions(-) diff --git a/static/js/market.js b/static/js/market.js index ace2d73..55b9c54 100644 --- a/static/js/market.js +++ b/static/js/market.js @@ -95,7 +95,7 @@ const market = async () => { activeProduct: null, pool: null, config: null, - configDialog: { + configData: { show: false, data: { name: null, @@ -329,8 +329,8 @@ const market = async () => { editConfigDialog() { if (this.canEditConfig && this.config?.opts) { let { name, about, ui } = this.config.opts - this.configDialog.data = { name, about, ui } - this.configDialog.data.identifier = this.config?.d + this.configData.data = { name, about, ui } + this.configData.data.identifier = this.config?.d } this.openConfigDialog() }, @@ -343,15 +343,15 @@ const market = async () => { }) return } - this.configDialog.show = true + this.configData.show = true }, updateUiConfig(configData) { console.log('### updateUiConfig', configData) }, async sendConfig() { - let { name, about, ui } = this.configDialog.data + let { name, about, ui } = this.configData.data let merchants = Array.from(this.pubkeys) - let identifier = this.configDialog.data.identifier ?? crypto.randomUUID() + let identifier = this.configData.data.identifier ?? crypto.randomUUID() let event = { ...(await NostrTools.getBlankEvent()), kind: 30019, @@ -385,12 +385,12 @@ const market = async () => { identifier: identifier, relays: Array.from(this.relays) }) - this.config = this.configDialog.data + this.config = this.configData.data this.resetConfig() return }, resetConfig() { - this.configDialog = { + this.configData = { show: false, identifier: null, data: { diff --git a/templates/nostrmarket/market.html b/templates/nostrmarket/market.html index 4eb1325..869d7cd 100644 --- a/templates/nostrmarket/market.html +++ b/templates/nostrmarket/market.html @@ -1,160 +1,5 @@ {% extends "public.html" %} {% block page %} - - - -
@@ -264,7 +109,7 @@ + :config="configData" @ui-config-update="updateUiConfig"> @@ -301,61 +146,6 @@
- - - - -
Account Setup
- -
- -

Enter your Nostr private key or generate a new one.

-
- - - - - - - - - Close - -
-
- - - - -
Customize the Marketplace
-
- -

Create an Nostr event with Market info

- It will include all merchants on your merchants list and relays -
- - - - - -

Customize UI

- - - - - -
- Publish - Cancel -
-
-
-