feat: refactor discover page and detail view for activities
This commit is contained in:
@ -16,6 +16,7 @@ import { useCouponStore } from './stores/coupon'
|
||||
import { supabase } from '@/supabase'
|
||||
import { useGoogleMaps } from '@/composables/useGoogleMaps'
|
||||
// useFavoritesStore ya importado arriba (línea 8)
|
||||
import { useRegisterSW } from 'virtual:pwa-register/vue'
|
||||
|
||||
// Initialize theme store
|
||||
const route = useRoute()
|
||||
@ -28,6 +29,11 @@ const { loadMaps } = useGoogleMaps()
|
||||
// Iniciar descarga asíncrona masiva de Google Maps al bootear VUE (Ahorra ~3 seg de espera en MapView)
|
||||
loadMaps()
|
||||
|
||||
const { needRefresh, updateServiceWorker } = useRegisterSW()
|
||||
const reloadPWA = () => {
|
||||
updateServiceWorker(true)
|
||||
}
|
||||
|
||||
const isLandingPage = computed(() => route.name === 'landing')
|
||||
const isSplashScreen = computed(() => route.name === 'splash')
|
||||
const isAuthScreen = computed(() => {
|
||||
@ -184,6 +190,11 @@ onUnmounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="needRefresh" class="pwa-update-toast">
|
||||
<p>¡Nueva versión disponible!</p>
|
||||
<button @click="reloadPWA">Actualizar ahora</button>
|
||||
</div>
|
||||
|
||||
<MainLayout v-if="!isSplashScreen && !isAuthScreen && !isLandingPage">
|
||||
<RouterView />
|
||||
</MainLayout>
|
||||
@ -269,6 +280,49 @@ body {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* PWA Update Toast */
|
||||
.pwa-update-toast {
|
||||
position: fixed;
|
||||
bottom: 2rem;
|
||||
right: 2rem;
|
||||
background: var(--active-color);
|
||||
color: #000;
|
||||
padding: 1rem 1.5rem;
|
||||
border-radius: 1rem;
|
||||
z-index: 9999;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
box-shadow: 0 10px 25px rgba(254, 231, 21, 0.4);
|
||||
font-weight: 600;
|
||||
animation: slideInUp 0.3s ease-out forwards;
|
||||
}
|
||||
|
||||
.pwa-update-toast p {
|
||||
margin: 0;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.pwa-update-toast button {
|
||||
background: #000;
|
||||
color: #fff;
|
||||
border: none;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 0.5rem;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
|
||||
.pwa-update-toast button:hover {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
@keyframes slideInUp {
|
||||
from { opacity: 0; transform: translateY(20px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
/* Global Utilities */
|
||||
.glass-effect {
|
||||
background: var(--glass-bg);
|
||||
|
||||
Reference in New Issue
Block a user