fix: breadcrumbs

This commit is contained in:
Vlad Stan 2023-07-05 15:54:13 +03:00
parent 6c02e58f84
commit ff9891302a
4 changed files with 67 additions and 55 deletions

View file

@ -24,11 +24,7 @@
<q-banner v-if="styles?.ui?.banner" class="row q-pa-none q-mb-md">
<q-img :src="styles.ui.banner" style="width: 100%; height: 250px" cover></q-img>
</q-banner>
<q-toolbar>
<q-breadcrumbs>
<q-breadcrumbs-el :label="styles.name ?? 'Market'" icon="home"></q-breadcrumbs-el>
</q-breadcrumbs>
</q-toolbar>
<div class="row q-col-gutter-md">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3" v-for="(item, idx) in products" :key="idx">
<product-card :product="item" @change-page="changePageM"></product-card>

View file

@ -1,10 +1,6 @@
<div>
<q-toolbar>
<q-breadcrumbs class="cursor">
<q-breadcrumbs-el :label="styles.name ?? 'Market'" icon="home" @click="$emit('change-page', 'market')"
style="cursor: pointer"></q-breadcrumbs-el>
<q-breadcrumbs-el :label="stall?.name || 'Stall'" icon="widgets"></q-breadcrumbs-el>
</q-breadcrumbs>
<q-toolbar-title></q-toolbar-title>
<chat-dialog v-if="this.customerPrivkey || this.customerUseExtension" :account="account ? account : dropIn"
:merchant="stall.pubkey" :relays="relays" :pool="pool" />

View file

@ -302,7 +302,8 @@ const market = async () => {
return
},
resetConfig() {
this.configDialog = {show: false,
this.configDialog = {
show: false,
identifier: null,
data: {
name: null,
@ -312,7 +313,8 @@ const market = async () => {
banner: null,
theme: null
}
}}
}
}
},
async updateData(events) {
if (events.length < 1) {
@ -423,6 +425,7 @@ const market = async () => {
)
},
navigateTo(page, opts = { stall: null, product: null, pubkey: null }) {
console.log("### navigateTo", page, opts)
let { stall, product, pubkey } = opts
let url = new URL(window.location)
@ -437,8 +440,9 @@ const market = async () => {
if (stall) {
this.activeStall = stall
url.searchParams.set('stall_id', stall)
if (product) {
this.activeProduct = product
if (product) {
url.searchParams.set('product_id', product)
}
}

View file

@ -184,6 +184,20 @@
</q-toolbar>
</div>
<div class="q-mt-xl">
<q-breadcrumbs class="cursor">
<q-breadcrumbs-el :label="'Market'" icon="home" @click="navigateTo('market')"
class="cursor-pointer"></q-breadcrumbs-el>
<q-breadcrumbs-el v-if="activeStall" :label="stallName" @click="navigateTo('stall', {stall: activeStall})"
icon="widgets" class="cursor-pointer"></q-breadcrumbs-el>
<q-breadcrumbs-el v-if="activeProduct" :label="productName"
@click="navigateTo('product', {product: activeStall})" class="cursor-pointer"
icon="widgets"></q-breadcrumbs-el>
</q-breadcrumbs>
</div>
<q-separator class="q-mt-md q-mb-md"></q-separator>
<market-config v-if="showMarketConfig"></market-config>
<customer-stall v-else-if="!isLoading && activeStall" :stall="stalls.find(stall => stall.id == activeStall)"
:products="filterProducts" :stall-products="products.filter(p => p.stall_id == activeStall)"
@ -191,7 +205,9 @@
@login-dialog="openAccountDialog" @change-page="navigateTo"></customer-stall>
<customer-market v-else :search-nostr="searchNostr" :relays="relays" :products="filterProducts"
:styles="config?.opts ?? {}" @change-page="navigateTo" @update-data="updateData"></customer-market>
</q-page-container>
<!-- ACCOUNT DIALOG -->
<q-dialog v-model="accountDialog.show" persistent>
<q-card style="min-width: 350px">