Fix catalog UI: navbar alignment, selection panel, map search, infinite scroll
All checks were successful
Build Docker Image / build (push) Successful in 3m37s
All checks were successful
Build Docker Image / build (push) Successful in 3m37s
- Fix team selector alignment in navbar (use items-center, fixed height) - Fix SelectionPanel header padding to account for parent p-4 - Add map search input (white glass, positioned next to panel) - Add infinite scroll to SelectionPanel with IntersectionObserver - Products load all at once (no server-side pagination yet) - Hubs and Suppliers support pagination with loadMore
This commit is contained in:
@@ -3,11 +3,15 @@ import { GetProductsDocument } from '~/composables/graphql/public/geo-generated'
|
||||
// Shared state
|
||||
const items = ref<any[]>([])
|
||||
const isLoading = ref(false)
|
||||
const isLoadingMore = ref(false)
|
||||
const isInitialized = ref(false)
|
||||
|
||||
export function useCatalogProducts() {
|
||||
const { execute } = useGraphQL()
|
||||
|
||||
// Products don't have server-side pagination yet, so we load all at once
|
||||
const canLoadMore = computed(() => false)
|
||||
|
||||
const fetchProducts = async () => {
|
||||
if (isLoading.value) return
|
||||
isLoading.value = true
|
||||
@@ -25,6 +29,10 @@ export function useCatalogProducts() {
|
||||
}
|
||||
}
|
||||
|
||||
const loadMore = async () => {
|
||||
// No-op: products don't support pagination yet
|
||||
}
|
||||
|
||||
const init = async () => {
|
||||
if (!isInitialized.value && items.value.length === 0) {
|
||||
await fetchProducts()
|
||||
@@ -34,8 +42,11 @@ export function useCatalogProducts() {
|
||||
return {
|
||||
items,
|
||||
isLoading,
|
||||
isLoadingMore,
|
||||
isInitialized,
|
||||
canLoadMore,
|
||||
fetchProducts,
|
||||
loadMore,
|
||||
init
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user