Fix: Map offers button design, bottom nav cleanup, sidebar theme toggle simplification, and tourist trip auto-scroll animation
This commit is contained in:
@ -10,6 +10,7 @@ import { analyticsService } from '@/services/analyticsService'
|
||||
const router = useRouter()
|
||||
const businesses = ref<Business[]>([])
|
||||
const isLoading = ref(true)
|
||||
const error = ref<string | null>(null)
|
||||
const searchQuery = ref('')
|
||||
const selectedCategory = ref('Todas')
|
||||
const selectedArea = ref('Todas')
|
||||
@ -32,15 +33,22 @@ function catIcon(cat: string) {
|
||||
return CATEGORY_META[cat]?.icon ?? 'place'
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
analyticsService.logEvent({ event_name: 'screen_view', screen_name: 'Discover' })
|
||||
async function loadBusinesses() {
|
||||
isLoading.value = true
|
||||
error.value = null
|
||||
try {
|
||||
businesses.value = await businessService.getAllBusinesses()
|
||||
} catch (e) {
|
||||
console.error('Error loading businesses:', e)
|
||||
error.value = 'No se pudieron cargar los lugares. Revisa tu conexión.'
|
||||
} finally {
|
||||
isLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
analyticsService.logEvent({ event_name: 'screen_view', screen_name: 'Discover' })
|
||||
loadBusinesses()
|
||||
})
|
||||
|
||||
// ── Computados
|
||||
@ -149,6 +157,16 @@ function resetFilters() {
|
||||
<p>Cargando lugares...</p>
|
||||
</div>
|
||||
|
||||
<!-- ── ERROR ── -->
|
||||
<div v-else-if="error" class="state-center">
|
||||
<span class="material-icons" style="font-size: 3.5rem; color: #ef4444; opacity: 0.8; margin-bottom: 0.5rem;">error_outline</span>
|
||||
<p style="font-weight: 600; color: var(--text-secondary);">{{ error }}</p>
|
||||
<button class="cta-btn" style="margin-top: 1rem;" @click="loadBusinesses">
|
||||
<span class="material-icons">refresh</span>
|
||||
Reintentar
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<template v-else>
|
||||
|
||||
<!-- ══ VISTA CON FILTRO ACTIVO ══ -->
|
||||
|
||||
Reference in New Issue
Block a user