feat(ui): redesign GlobalSearchBar, split layouts, and remove hero section
All checks were successful
Build Docker Image / build (push) Successful in 5m25s

- Make GlobalSearchBar functional with searchStore integration
- Add destination search using hubs/nodes GraphQL query
- Navigate to /request page instead of /catalog/offers
- Remove hero section from index.vue (search is now in header)
- Add padding (px-3 lg:px-6) to topnav layout
- Implement split layout for catalog pages (offers, hubs, suppliers)
  - Left side: filters + scrollable card list (40%)
  - Right side: map (60%, hidden on mobile)
This commit is contained in:
Ruslan Bakiev
2026-01-08 08:13:22 +07:00
parent 1e179ab04c
commit 1a2693bcd6
6 changed files with 194 additions and 254 deletions

View File

@@ -1,57 +1,64 @@
<template>
<Stack gap="6">
<Section variant="plain" paddingY="md">
<div class="flex flex-col h-[calc(100vh-200px)]">
<!-- Header -->
<div class="py-4">
<PageHeader :title="t('catalogHubsSection.header.title')" />
</Section>
</div>
<Section v-if="isLoading" variant="plain" paddingY="md">
<!-- 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>
</Section>
</div>
<Section v-else variant="plain" paddingY="md">
<Stack gap="6">
<NuxtLink :to="localePath('/catalog/hubs/map')" class="block h-48 rounded-lg overflow-hidden cursor-pointer">
<ClientOnly>
<MapboxGlobe
map-id="hubs-map"
:locations="itemsWithCoords"
:height="192"
/>
</ClientOnly>
</NuxtLink>
<!-- Split Layout -->
<div v-else class="flex-1 flex gap-4 min-h-0">
<!-- Left side: Filters + Cards (scrollable) -->
<div class="w-full lg:w-2/5 overflow-y-auto pr-2">
<Stack gap="4">
<CatalogFilters :filters="filters" v-model="selectedFilter" />
<CatalogFilters :filters="filters" v-model="selectedFilter" />
<div v-for="country in itemsByCountry" :key="country.name" class="space-y-3">
<Text weight="semibold">{{ country.name }}</Text>
<Stack gap="3">
<HubCard
v-for="hub in country.hubs"
:key="hub.uuid"
:hub="hub"
/>
</Stack>
</div>
<div v-for="country in itemsByCountry" :key="country.name" class="space-y-3">
<Text weight="semibold">{{ country.name }}</Text>
<Grid :cols="1" :md="2" :lg="3" :gap="4">
<HubCard
v-for="hub in country.hubs"
:key="hub.uuid"
:hub="hub"
/>
</Grid>
</div>
<PaginationLoadMore
:shown="items.length"
:total="total"
:can-load-more="canLoadMore"
:loading="isLoadingMore"
@load-more="loadMore"
/>
<PaginationLoadMore
:shown="items.length"
:total="total"
:can-load-more="canLoadMore"
:loading="isLoadingMore"
@load-more="loadMore"
/>
<Stack v-if="items.length === 0" align="center" gap="2">
<Text tone="muted">{{ t('catalogHubsSection.empty.no_hubs') }}</Text>
<Stack v-if="items.length === 0" align="center" gap="2">
<Text tone="muted">{{ t('catalogHubsSection.empty.no_hubs') }}</Text>
</Stack>
</Stack>
</Stack>
</Section>
</Stack>
</div>
<!-- Right side: Map (sticky, hidden on mobile) -->
<div class="hidden lg:block lg:w-3/5 rounded-lg overflow-hidden">
<ClientOnly>
<MapboxGlobe
map-id="hubs-map"
:locations="itemsWithCoords"
class="h-full w-full"
/>
</ClientOnly>
</div>
</div>
</div>
</template>
<script setup lang="ts">
@@ -60,7 +67,6 @@ definePageMeta({
})
const { t } = useI18n()
const localePath = useLocalePath()
const {
items,