Unify layouts and create CatalogPage component
All checks were successful
Build Docker Image / build (push) Successful in 3m45s
All checks were successful
Build Docker Image / build (push) Successful in 3m45s
- MainNavigation: center tabs on page (absolute positioning) - SubNavigation: align left instead of center - Create CatalogPage universal component for list+map pages - Migrate catalog pages (offers, suppliers, hubs) to CatalogPage - Remove PageHeader from clientarea pages (redundant with navigation) - Add topnav layout to supplier detail page 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -107,6 +107,10 @@ import {
|
||||
GetOffersDocument,
|
||||
} from '~/composables/graphql/public/exchange-generated'
|
||||
|
||||
definePageMeta({
|
||||
layout: 'topnav'
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
const localePath = useLocalePath()
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -1,59 +1,34 @@
|
||||
<template>
|
||||
<div class="flex flex-col flex-1 min-h-0">
|
||||
<!-- Header -->
|
||||
<div class="py-4">
|
||||
<PageHeader :title="t('catalogSuppliersSection.header.title')" />
|
||||
</div>
|
||||
<CatalogPage
|
||||
:items="items"
|
||||
:loading="isLoading"
|
||||
map-id="suppliers-map"
|
||||
point-color="#3b82f6"
|
||||
:selected-id="selectedSupplierId"
|
||||
@select="onSelectSupplier"
|
||||
>
|
||||
<template #filters>
|
||||
<CatalogFilters :filters="filters" v-model="selectedFilter" />
|
||||
</template>
|
||||
|
||||
<!-- Loading state -->
|
||||
<div v-if="isLoading" class="flex-1 flex items-center justify-center">
|
||||
<Card padding="lg">
|
||||
<Stack align="center" justify="center" gap="3">
|
||||
<Spinner />
|
||||
<Text tone="muted">{{ t('catalogLanding.states.loading') }}</Text>
|
||||
</Stack>
|
||||
</Card>
|
||||
</div>
|
||||
<template #card="{ item }">
|
||||
<SupplierCard :supplier="item" />
|
||||
</template>
|
||||
|
||||
<!-- ListMapLayout -->
|
||||
<ListMapLayout
|
||||
v-else
|
||||
ref="listMapRef"
|
||||
:items="items"
|
||||
:selected-item-id="selectedSupplierId"
|
||||
map-id="suppliers-map"
|
||||
point-color="#3b82f6"
|
||||
@select-item="onSelectSupplier"
|
||||
>
|
||||
<template #list>
|
||||
<Stack gap="4">
|
||||
<CatalogFilters :filters="filters" v-model="selectedFilter" />
|
||||
<template #pagination>
|
||||
<PaginationLoadMore
|
||||
:shown="items.length"
|
||||
:total="total"
|
||||
:can-load-more="canLoadMore"
|
||||
:loading="isLoadingMore"
|
||||
@load-more="loadMore"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<Stack gap="3">
|
||||
<SupplierCard
|
||||
v-for="supplier in items"
|
||||
:key="supplier.uuid || supplier.teamUuid"
|
||||
:supplier="supplier"
|
||||
:class="{ 'ring-2 ring-primary': (supplier.uuid || supplier.teamUuid) === selectedSupplierId }"
|
||||
@click="onSelectSupplier(supplier.uuid || supplier.teamUuid)"
|
||||
/>
|
||||
</Stack>
|
||||
|
||||
<PaginationLoadMore
|
||||
:shown="items.length"
|
||||
:total="total"
|
||||
:can-load-more="canLoadMore"
|
||||
:loading="isLoadingMore"
|
||||
@load-more="loadMore"
|
||||
/>
|
||||
|
||||
<Stack v-if="total === 0" align="center" gap="2">
|
||||
<Text tone="muted">{{ t('catalogSuppliersSection.empty.no_suppliers') }}</Text>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</template>
|
||||
</ListMapLayout>
|
||||
</div>
|
||||
<template #empty>
|
||||
<Text tone="muted">{{ t('catalogSuppliersSection.empty.no_suppliers') }}</Text>
|
||||
</template>
|
||||
</CatalogPage>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -77,10 +52,9 @@ const {
|
||||
|
||||
// Selected supplier for map highlighting
|
||||
const selectedSupplierId = ref<string>()
|
||||
const listMapRef = ref<{ flyToItem: (uuid: string) => void } | null>(null)
|
||||
|
||||
const onSelectSupplier = (uuid: string) => {
|
||||
selectedSupplierId.value = uuid
|
||||
const onSelectSupplier = (supplier: any) => {
|
||||
selectedSupplierId.value = supplier.uuid || supplier.teamUuid
|
||||
}
|
||||
|
||||
await init()
|
||||
|
||||
Reference in New Issue
Block a user