From 35e2a6d632754908b618e27ef3fe6a74a56cfd0a Mon Sep 17 00:00:00 2001 From: Hanzo_dev <2002samudiojohan@gmail.com> Date: Wed, 4 Mar 2026 16:34:47 -0500 Subject: [PATCH] fix(favorites): adjust favorite button visibility and functionality - removed favorite button from Discover cards - added call button for taxis in Favorites view - added favorite button in Shuttle details - added Shuttles category in Favorites view --- frontend/src/components/FavoriteButton.vue | 2 +- frontend/src/stores/favorites.ts | 9 ++- frontend/src/types/index.ts | 4 +- frontend/src/views/DiscoverView.vue | 23 ------ frontend/src/views/FavoritesView.vue | 79 ++++++++++++++++++- .../src/views/transporte/ShuttleDetalle.vue | 8 ++ 6 files changed, 94 insertions(+), 31 deletions(-) diff --git a/frontend/src/components/FavoriteButton.vue b/frontend/src/components/FavoriteButton.vue index 55ddbb0..cf67b41 100644 --- a/frontend/src/components/FavoriteButton.vue +++ b/frontend/src/components/FavoriteButton.vue @@ -17,7 +17,7 @@ import { useFavoritesStore } from '@/stores/favorites' import { useAuthStore } from '@/stores/auth' const props = defineProps<{ - itemType: 'coupon' | 'business' | 'taxi' | 'route' | 'stop' + itemType: 'coupon' | 'business' | 'taxi' | 'route' | 'stop' | 'shuttle' itemId: string itemName?: string itemImage?: string diff --git a/frontend/src/stores/favorites.ts b/frontend/src/stores/favorites.ts index a163a1c..2530c8a 100644 --- a/frontend/src/stores/favorites.ts +++ b/frontend/src/stores/favorites.ts @@ -5,7 +5,7 @@ import { supabase } from '@/supabase' export interface Favorite { id: string user_id: string - item_type: 'coupon' | 'business' | 'taxi' | 'route' | 'stop' + item_type: 'coupon' | 'business' | 'taxi' | 'route' | 'stop' | 'shuttle' item_id: string item_name?: string item_image?: string @@ -21,6 +21,7 @@ export const useFavoritesStore = defineStore('favorites', () => { const taxis = computed(() => favorites.value.filter(f => f.item_type === 'taxi')) const routes = computed(() => favorites.value.filter(f => f.item_type === 'route')) const stops = computed(() => favorites.value.filter(f => f.item_type === 'stop')) + const shuttles = computed(() => favorites.value.filter(f => f.item_type === 'shuttle')) async function loadFavorites() { isLoading.value = true @@ -50,7 +51,7 @@ export const useFavoritesStore = defineStore('favorites', () => { } async function addFavorite( - itemType: 'coupon' | 'business' | 'taxi' | 'route' | 'stop', + itemType: 'coupon' | 'business' | 'taxi' | 'route' | 'stop' | 'shuttle', itemId: string, itemName?: string, itemImage?: string @@ -97,7 +98,7 @@ export const useFavoritesStore = defineStore('favorites', () => { } async function toggleFavorite( - itemType: 'coupon' | 'business' | 'taxi' | 'route' | 'stop', + itemType: 'coupon' | 'business' | 'taxi' | 'route' | 'stop' | 'shuttle', itemId: string, itemName?: string, itemImage?: string @@ -121,7 +122,7 @@ export const useFavoritesStore = defineStore('favorites', () => { } return { - favorites, isLoading, coupons, businesses, taxis, routes, stops, + favorites, isLoading, coupons, businesses, taxis, routes, stops, shuttles, loadFavorites, addFavorite, removeFavorite, toggleFavorite, isFavorite } }) diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts index 1d3fe86..b3a817d 100644 --- a/frontend/src/types/index.ts +++ b/frontend/src/types/index.ts @@ -140,8 +140,10 @@ export interface Taxi { export interface Favorite { id: string user_id: string - item_type: 'route' | 'stop' | 'taxi' + item_type: 'coupon' | 'business' | 'taxi' | 'route' | 'stop' | 'shuttle' item_id: string + item_name?: string + item_image?: string created_at?: string } diff --git a/frontend/src/views/DiscoverView.vue b/frontend/src/views/DiscoverView.vue index 359e1ea..32e6ae2 100644 --- a/frontend/src/views/DiscoverView.vue +++ b/frontend/src/views/DiscoverView.vue @@ -4,7 +4,6 @@ import { businessService } from '@/services/businessService' import type { Business } from '@/types' import { useRouter } from 'vue-router' import { useI18n } from 'vue-i18n' -import FavoriteButton from '@/components/FavoriteButton.vue' import { analyticsService } from '@/services/analyticsService' import { getImageUrl } from '@/utils/imageUrl' import AuthGuard from '@/components/common/AuthGuard.vue' @@ -242,9 +241,6 @@ function resetFilters() { class="biz-img" @error="(e) => (e.target as HTMLImageElement).src = getImageUrl(null, 'business')" /> -
- -
{{ catIcon(biz.category || '') }} {{ catName(biz.category || '') }} @@ -320,9 +316,6 @@ function resetFilters() { @error="(e) => (e.target as HTMLImageElement).src = getImageUrl(null, 'business')" /> - + + phone_in_talk + @@ -188,6 +210,33 @@ const hasVisibleItems = computed(() => + +
+ +
+
+
+ +
+
+

{{ item.item_name }}

+

Ver detalles

+
+ +
+
+
+