From ad0ac073ab28f62bb731fc1ff1b23c88b440008d Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Fri, 14 Jul 2023 14:28:26 +0300 Subject: [PATCH] feat: add basic stall list --- .../customer-stall-list.html | 57 +++++++++++++++++++ .../customer-stall-list.js | 20 +++++++ static/js/market.js | 3 +- templates/nostrmarket/market.html | 20 +++++-- 4 files changed, 94 insertions(+), 6 deletions(-) create mode 100644 static/components/customer-stall-list/customer-stall-list.html create mode 100644 static/components/customer-stall-list/customer-stall-list.js diff --git a/static/components/customer-stall-list/customer-stall-list.html b/static/components/customer-stall-list/customer-stall-list.html new file mode 100644 index 0000000..7cdf61b --- /dev/null +++ b/static/components/customer-stall-list/customer-stall-list.html @@ -0,0 +1,57 @@ +
+
+ + + + +
+
{{ stall.name }}
+
+ +
+ + +
+ + + currency sat + + + currency fiat + + product count +
+
+ + + +
+
+   +
+ +
+

{{ stall.description }}

+
+ + +
+ + + + +
+ + Visit Stall + +
+
+
+
+
\ No newline at end of file diff --git a/static/components/customer-stall-list/customer-stall-list.js b/static/components/customer-stall-list/customer-stall-list.js new file mode 100644 index 0000000..cf6eeec --- /dev/null +++ b/static/components/customer-stall-list/customer-stall-list.js @@ -0,0 +1,20 @@ +async function customerStallList(path) { + const template = await loadTemplateAsync(path) + + Vue.component('customer-stall-list', { + name: 'customer-stall-list', + template, + + props: ['stalls'], + data: function () { + return {} + }, + computed: {}, + methods: { + + }, + created() { + console.log('### stalls', this.stalls) + } + }) +} diff --git a/static/js/market.js b/static/js/market.js index d04d2fa..e4ac3f7 100644 --- a/static/js/market.js +++ b/static/js/market.js @@ -29,6 +29,7 @@ const market = async () => { productCard('static/components/product-card/product-card.html'), customerMarket('static/components/customer-market/customer-market.html'), customerStall('static/components/customer-stall/customer-stall.html'), + customerStallList('static/components/customer-stall-list/customer-stall-list.html'), productDetail('static/components/product-detail/product-detail.html'), shoppingCart('static/components/shopping-cart/shopping-cart.html'), shoppingCartList('static/components/shopping-cart-list/shopping-cart-list.html'), @@ -75,6 +76,7 @@ const market = async () => { searchNostr: false, filterCategories: [], + groupByStall: false, drawer: true, pubkeys: new Set(), @@ -233,7 +235,6 @@ const market = async () => { if (product_id) { this.activeProduct = product_id } - this.activePage = 'stall' this.activeStall = stall_id } if (merchant_pubkey && !this.pubkeys.has(merchant_pubkey)) { diff --git a/templates/nostrmarket/market.html b/templates/nostrmarket/market.html index 77f0b70..06c1863 100644 --- a/templates/nostrmarket/market.html +++ b/templates/nostrmarket/market.html @@ -235,8 +235,11 @@
- + + + + @@ -285,9 +288,14 @@ :relays="relays" :account="account" :pool="pool" :styles="config?.opts ?? {}" @login-dialog="openAccountDialog" @change-page="navigateTo" @add-to-cart="addProductToCart"> - +
+ + + +
+
@@ -381,6 +389,8 @@ +