Fix: Finalize AuthGuard translations, registration link, and restricted offers on map

This commit is contained in:
2026-03-03 12:02:26 -05:00
parent b098c23291
commit a9adc4c4a0
5 changed files with 72 additions and 35 deletions

View File

@ -22,7 +22,7 @@ const router = useRouter()
const { t } = useI18n()
function goToRegister() {
router.push('/register')
router.push({ path: '/login', query: { mode: 'register' } })
}
function goToLogin() {

View File

@ -11,39 +11,44 @@
</button>
</div>
<!-- Card area with nav arrows -->
<div class="sheet-card-area">
<button class="sheet-nav" @click="$emit('prev')" :disabled="coupons.length < 2">
<span class="material-icons">chevron_left</span>
</button>
<!-- Card area with nav arrows wrapped in AuthGuard -->
<AuthGuard
:title="t('coupons.auth.title') || 'Ofertas Exclusivas'"
:message="t('coupons.auth.message') || 'Regístrate para ver todos los detalles de esta promoción y canjear tu código.'"
>
<div class="sheet-card-area">
<button class="sheet-nav" @click="$emit('prev')" :disabled="coupons.length < 2">
<span class="material-icons">chevron_left</span>
</button>
<Transition name="carousel-slide" mode="out-in">
<div
v-if="currentPromo"
:key="currentPromo.id"
class="sheet-card"
:style="{ backgroundImage: `url(${getImageUrl(currentPromo.image_url, 'coupon')})` }"
@mouseenter="$emit('pause')"
@touchstart="$emit('pause')"
@mouseleave="$emit('resume')"
>
<div class="sheet-card-overlay">
<div class="sheet-info">
<span class="sheet-biz-name">{{ currentPromo.business?.name || 'Local' }}</span>
<h3 class="sheet-promo-title">{{ currentPromo.title }}</h3>
<div class="sheet-actions">
<button class="sheet-cta" @click="$emit('promo-click', currentPromo)">{{ t('coupons.viewDetails') }}</button>
<span v-if="currentPromo.discount_percentage" class="sheet-discount-tag">-{{ currentPromo.discount_percentage }}%</span>
<Transition name="carousel-slide" mode="out-in">
<div
v-if="currentPromo"
:key="currentPromo.id"
class="sheet-card"
:style="{ backgroundImage: `url(${getImageUrl(currentPromo.image_url, 'coupon')})` }"
@mouseenter="$emit('pause')"
@touchstart="$emit('pause')"
@mouseleave="$emit('resume')"
>
<div class="sheet-card-overlay">
<div class="sheet-info">
<span class="sheet-biz-name">{{ currentPromo.business?.name || 'Local' }}</span>
<h3 class="sheet-promo-title">{{ currentPromo.title }}</h3>
<div class="sheet-actions">
<button class="sheet-cta" @click="$emit('promo-click', currentPromo)">{{ t('coupons.viewDetails') }}</button>
<span v-if="currentPromo.discount_percentage" class="sheet-discount-tag">-{{ currentPromo.discount_percentage }}%</span>
</div>
</div>
</div>
</div>
</div>
</Transition>
</Transition>
<button class="sheet-nav" @click="$emit('next')" :disabled="coupons.length < 2">
<span class="material-icons">chevron_right</span>
</button>
</div>
<button class="sheet-nav" @click="$emit('next')" :disabled="coupons.length < 2">
<span class="material-icons">chevron_right</span>
</button>
</div>
</AuthGuard>
<!-- Dots -->
<div class="sheet-dots" v-if="coupons.length > 1">
@ -63,6 +68,7 @@
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
import { getImageUrl } from '@/utils/imageUrl'
import AuthGuard from '@/components/common/AuthGuard.vue'
const props = defineProps<{
isOpen: boolean

View File

@ -148,7 +148,11 @@
"active": "Active",
"offersCount": "{count} offer | {count} offers",
"viewDetails": "View details",
"restaurant": "Restaurant"
"restaurant": "Restaurant",
"auth": {
"title": "Exclusive Offers",
"message": "To view the details of this promotion, get your discount code and save on your purchases, register or log in now."
}
},
"taxi": {
"title": "Transport Hub",
@ -196,7 +200,11 @@
"contactOperator": "Contact the operator directly to confirm availability.",
"bookWhatsapp": "Book via WhatsApp",
"callOperator": "Call Operator",
"errorLoading": "Could not load trip information"
"errorLoading": "Could not load trip information",
"auth": {
"title": "Explore Chiriquí without limits",
"message": "Register to book your trips, see detailed schedules and access exclusive group rates."
}
},
"busStop": {
"loadingDetails": "Loading bus stop details...",
@ -237,6 +245,10 @@
"commerce": "Commerce",
"tourism": "Tourism",
"drinks": "Drinks"
},
"auth": {
"title": "Exclusive places!",
"message": "To discover Chiriquí register or log in. Find the best hidden gems and direct offers."
}
},
"business": {
@ -314,7 +326,8 @@
"passMin8": "Minimum 8 characters",
"smartLocation": "Allow to detect my location automatically (Smart Location)",
"emailRegistered": "Email is already registered.",
"invalidCreds": "Incorrect email or password."
"invalidCreds": "Incorrect email or password.",
"loginLink": "Already have an account, log in"
},
"routesView": {
"title": "Transport",

View File

@ -150,7 +150,11 @@
"active": "Activo",
"offersCount": "{count} oferta | {count} ofertas",
"viewDetails": "Ver detalles",
"restaurant": "Restaurante"
"restaurant": "Restaurante",
"auth": {
"title": "Ofertas Exclusivas",
"message": "Para ver los detalles de esta promoción, obtener tu código de descuento y ahorrar en tus compras, regístrate o accede ahora."
}
},
"taxi": {
"title": "Centro de Transporte",
@ -198,7 +202,11 @@
"contactOperator": "Contacta directamente al operador para confirmar disponibilidad.",
"bookWhatsapp": "Reservar por WhatsApp",
"callOperator": "Llamar al Operador",
"errorLoading": "No se pudo cargar la información del viaje"
"errorLoading": "No se pudo cargar la información del viaje",
"auth": {
"title": "Explora Chiriquí sin límites",
"message": "Regístrate para reservar tus viajes, ver horarios detallados y acceder a tarifas grupales exclusivas."
}
},
"busStop": {
"loadingDetails": "Cargando detalles de la parada...",
@ -239,6 +247,10 @@
"commerce": "Comercio",
"tourism": "Turismo",
"drinks": "Bebidas"
},
"auth": {
"title": "¡Locales exclusivos!",
"message": "Para descubrir Chiriquí regístrate o accede. Encuentra los mejores rincones y ofertas directas."
}
},
"business": {
@ -318,7 +330,8 @@
"passMin8": "Mínimo 8 caracteres",
"smartLocation": "Permitir detectar mi ubicación automáticamente (Smart Location)",
"emailRegistered": "El correo ya está registrado.",
"invalidCreds": "Correo o contraseña incorrectos."
"invalidCreds": "Correo o contraseña incorrectos.",
"loginLink": "Ya tengo cuenta, iniciar sesión"
},
"routesView": {
"title": "Transporte",

View File

@ -12,6 +12,11 @@ const mounted = ref(false)
onMounted(() => {
mounted.value = true
// Check if we should start in register mode
const mode = router.currentRoute.value.query.mode
if (mode === 'register') {
isLogin.value = false
}
})
const toggleAuth = () => {