Integrated AuthGuard in Discover and Shuttles, updated Business types and translations
This commit is contained in:
@ -5,6 +5,8 @@ import { useCouponStore } from '@/stores/coupon'
|
||||
import type { Coupon } from '@/types'
|
||||
import FavoriteButton from '@/components/FavoriteButton.vue'
|
||||
import { getImageUrl as utilGetImageUrl } from '@/utils/imageUrl'
|
||||
import AuthGuard from '@/components/common/AuthGuard.vue'
|
||||
import { analyticsService } from '@/services/analyticsService'
|
||||
|
||||
const { t } = useI18n()
|
||||
const couponStore = useCouponStore()
|
||||
@ -42,7 +44,6 @@ function getImageUrl(path: string | null | undefined) {
|
||||
}
|
||||
|
||||
|
||||
import { analyticsService } from '@/services/analyticsService'
|
||||
|
||||
function openCoupon(coupon: Coupon) {
|
||||
selectedCoupon.value = coupon
|
||||
@ -125,36 +126,42 @@ function getCategoryIcon(category?: string | null) {
|
||||
<p>{{ t('coupons.noResults') }}</p>
|
||||
</div>
|
||||
|
||||
<div v-else class="coupons-grid-new">
|
||||
<div
|
||||
v-for="coupon in filteredCoupons"
|
||||
:key="coupon.id"
|
||||
v-memo="[coupon.id]"
|
||||
class="offer-card-new"
|
||||
@click="openCoupon(coupon)"
|
||||
>
|
||||
<div class="offer-image-wrapper">
|
||||
<img :src="getImageUrl(coupon.image_url)" :alt="coupon.title" loading="lazy" decoding="async" class="offer-img">
|
||||
<div class="status-badge" :class="{ 'tmr': coupon.title.toLowerCase().includes('mañana') || (coupon.description?.toLowerCase().includes('mañana') ?? false) }">
|
||||
<span class="material-icons">schedule</span>
|
||||
{{ coupon.title.toLowerCase().includes('mañana') ? t('coupons.tomorrow') : t('coupons.active') }}
|
||||
<AuthGuard
|
||||
v-else
|
||||
:title="t('coupons.auth.title') || '¡Cupones exclusivos!'"
|
||||
:message="t('coupons.auth.message') || 'Regístrate para ver todos los descuentos y promociones en restaurantes y comercios locales.'"
|
||||
>
|
||||
<div class="coupons-grid-new">
|
||||
<div
|
||||
v-for="coupon in filteredCoupons"
|
||||
:key="coupon.id"
|
||||
v-memo="[coupon.id]"
|
||||
class="offer-card-new"
|
||||
@click="openCoupon(coupon)"
|
||||
>
|
||||
<div class="offer-image-wrapper">
|
||||
<img :src="getImageUrl(coupon.image_url)" :alt="coupon.title" loading="lazy" decoding="async" class="offer-img">
|
||||
<div class="status-badge" :class="{ 'tmr': coupon.title.toLowerCase().includes('mañana') || (coupon.description?.toLowerCase().includes('mañana') ?? false) }">
|
||||
<span class="material-icons">schedule</span>
|
||||
{{ coupon.title.toLowerCase().includes('mañana') ? t('coupons.tomorrow') : t('coupons.active') }}
|
||||
</div>
|
||||
<div class="favorite-button-wrapper">
|
||||
<FavoriteButton
|
||||
item-type="coupon"
|
||||
:item-id="coupon.id"
|
||||
:item-name="coupon.title"
|
||||
:item-image="coupon.image_url || undefined"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="favorite-button-wrapper">
|
||||
<FavoriteButton
|
||||
item-type="coupon"
|
||||
:item-id="coupon.id"
|
||||
:item-name="coupon.title"
|
||||
:item-image="coupon.image_url || undefined"
|
||||
/>
|
||||
|
||||
<div class="offer-content">
|
||||
<h3 class="offer-title">{{ coupon.business?.name || t('coupons.restaurant') }}</h3>
|
||||
<p class="offer-benefit">{{ coupon.title }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="offer-content">
|
||||
<h3 class="offer-title">{{ coupon.business?.name || t('coupons.restaurant') }}</h3>
|
||||
<p class="offer-benefit">{{ coupon.title }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</AuthGuard>
|
||||
|
||||
<!-- Category Filter Sheet -->
|
||||
<div v-if="showFilterSheet" class="bottom-sheet-overlay" @click.self="showFilterSheet = false">
|
||||
|
||||
Reference in New Issue
Block a user