diff --git a/src/components/navigation/BottomNavBar.tsx b/src/components/navigation/BottomNavBar.tsx index e07a5e1..e4fa8c5 100644 --- a/src/components/navigation/BottomNavBar.tsx +++ b/src/components/navigation/BottomNavBar.tsx @@ -14,6 +14,7 @@ import { useCart } from '@/app/[name]/(Dialogs)/cart/hook/useCart'; import { Building } from 'iconsax-react'; import clsx from 'clsx'; import { useGetProfile } from '@/app/[name]/(Profile)/profile/hooks/userProfileData'; +import { toast } from '../Toast'; type BottomNavBarProps = { onPagerClick?: () => void; @@ -42,10 +43,13 @@ function BottomNavBar({ onPagerClick }: BottomNavBarProps) { }, 0); }, [items]); - const handleFavoritesClick = () => { + const handleFavoritesClick = (e: React.MouseEvent) => { + e.preventDefault(); if (isSuccess) { - router.push('/favorites'); + router.push(`/${name}/favorite`); } else { + e.stopPropagation(); + toast('ابتدا لاگین کنید', 'error'); router.push(`/${name}/auth`); } } @@ -122,7 +126,7 @@ function BottomNavBar({ onPagerClick }: BottomNavBarProps) { {t('about')} - } value={t('Favorites')} /> + } value={t('Favorites')} />