fix: replace onClick router.push navigation with standard next/link components for SEO accessibility

This commit is contained in:
parsa aghaei 2026-07-15 12:43:20 +03:30
parent 4dfe36b882
commit 565ef70840
3 changed files with 31 additions and 27 deletions

View File

@ -87,7 +87,7 @@ function ProductCard({ product, onClick }: { product: Product; key?: string | nu
</div>
{/* Content Area */}
<div className="p-8 flex flex-col flex-1" onClick={() => router.push(`/shop/${product.slug || product.id}`)}>
<Link href={`/shop/${product.slug || product.id}`} className="p-8 flex flex-col flex-1 block text-right">
<div className="mb-3">
<h3 dir="ltr" className="text-base md:text-lg font-black text-medical-gray-900 group-hover:text-canina-blue transition-colors leading-normal text-left line-clamp-2 min-h-[3.5rem] w-full">
{product.name}
@ -108,18 +108,12 @@ function ProductCard({ product, onClick }: { product: Product; key?: string | nu
<div className="flex items-center justify-between">
<div className="text-lg font-black text-medical-gray-900 font-vazir whitespace-nowrap">{product.price}</div>
<button
onClick={(e) => {
e.stopPropagation();
router.push(`/shop/${product.slug || product.id}`);
}}
className="text-xs font-black text-canina-blue uppercase tracking-widest border-b-2 border-canina-blue pb-1 hover:text-medical-gray-900 hover:border-medical-gray-900 transition-all whitespace-nowrap"
>
<span className="text-xs font-black text-canina-blue uppercase tracking-widest border-b-2 border-canina-blue pb-1 hover:text-medical-gray-900 hover:border-medical-gray-900 transition-all whitespace-nowrap">
{getText('product_view_details', "مشاهده جزئیات")}
</button>
</span>
</div>
</div>
</div>
</Link>
</motion.div>
);
}

View File

@ -2,6 +2,7 @@
import React from "react";
import { Phone, Mail, MapPin, Instagram, ShieldCheck, Globe } from "lucide-react";
import { useSettingsStore } from "../lib/store/settingsStore";
import Link from "next/link";
export default function Footer({ onNavigate, onShopNavigate, onB2BOpen }: {
onNavigate: (v: any) => void,
@ -16,13 +17,13 @@ export default function Footer({ onNavigate, onShopNavigate, onB2BOpen }: {
{/* Brand Presence */}
<div className="space-y-8">
<div className="flex items-center gap-3 cursor-pointer group" onClick={() => onNavigate("home")}>
<Link href="/" className="flex items-center gap-3 cursor-pointer group">
<div className="w-12 h-12 bg-canina-blue rounded-2xl flex items-center justify-center text-white font-bold text-2xl group-hover:bg-medical-gray-900 transition-all shadow-xl shadow-canina-blue/20 italic">C</div>
<div className="flex flex-col">
<span className="text-white font-extrabold text-2xl tracking-tighter leading-none italic font-sans">Canina <span className="text-sm not-italic font-medium border-l-2 border-white/20 pl-2 ml-2 font-shabnam">{getText('brand_name_fa', "ایران")}</span></span>
<span className="text-[10px] text-slate-400 font-bold uppercase tracking-widest leading-none mt-1.5 font-shabnam">{getText('brand_subtitle', "نماینده رسمی Canina Pharma GmbH آلمان")}</span>
</div>
</div>
</Link>
<p className="text-sm text-slate-300 leading-relaxed font-medium">
{getText('footer_brand_desc', "تدارک هوشمندانه سلامت برای همراهان وفادار شما. واردکننده انحصاری مکمل‌های درمانی با گرید دارویی اختصاصی از آلمان با سابقه ۴۰ سال نوآوری.")}
</p>
@ -39,21 +40,29 @@ export default function Footer({ onNavigate, onShopNavigate, onB2BOpen }: {
<div className="space-y-8">
<h4 className="text-xl font-bold text-white border-b-2 border-canina-blue pb-2 max-w-max font-lalezar">{getText('footer_links_title', "دسترسی سریع")}</h4>
<ul className="space-y-4 text-sm font-bold text-slate-300">
<li onClick={() => onShopNavigate()} className="hover:text-white hover:translate-x-[-4px] transition-all cursor-pointer flex items-center gap-2 group">
<div className="w-1.5 h-1.5 rounded-full bg-canina-blue group-hover:w-4 transition-all" />
{getText('footer_link_products', "محصولات تخصصی ۲۰۲۴")}
<li>
<Link href="/shop" className="hover:text-white hover:translate-x-[-4px] transition-all cursor-pointer flex items-center gap-2 group">
<div className="w-1.5 h-1.5 rounded-full bg-canina-blue group-hover:w-4 transition-all" />
{getText('footer_link_products', "محصولات تخصصی ۲۰۲۴")}
</Link>
</li>
<li onClick={() => onNavigate("blog")} className="hover:text-white hover:translate-x-[-4px] transition-all cursor-pointer flex items-center gap-2 group">
<div className="w-1.5 h-1.5 rounded-full bg-canina-blue group-hover:w-4 transition-all" />
{getText('footer_link_blog', "مجله سلامت پت (وبلاگ)")}
<li>
<Link href="/blog" className="hover:text-white hover:translate-x-[-4px] transition-all cursor-pointer flex items-center gap-2 group">
<div className="w-1.5 h-1.5 rounded-full bg-canina-blue group-hover:w-4 transition-all" />
{getText('footer_link_blog', "مجله سلامت پت (وبلاگ)")}
</Link>
</li>
<li onClick={() => onNavigate("profile")} className="hover:text-white hover:translate-x-[-4px] transition-all cursor-pointer flex items-center gap-2 group">
<div className="w-1.5 h-1.5 rounded-full bg-canina-blue group-hover:w-4 transition-all" />
{getText('footer_link_profiles', "شناسنامه پتها")}
<li>
<Link href="/profile" className="hover:text-white hover:translate-x-[-4px] transition-all cursor-pointer flex items-center gap-2 group">
<div className="w-1.5 h-1.5 rounded-full bg-canina-blue group-hover:w-4 transition-all" />
{getText('footer_link_profiles', "شناسنامه پت‌ها")}
</Link>
</li>
<li onClick={() => onNavigate("wiki")} className="hover:text-white hover:translate-x-[-4px] transition-all cursor-pointer flex items-center gap-2 group">
<div className="w-1.5 h-1.5 rounded-full bg-canina-blue group-hover:w-4 transition-all" />
{getText('footer_link_wiki', "دانشنامه ترکیبات")}
<li>
<Link href="/wiki" className="hover:text-white hover:translate-x-[-4px] transition-all cursor-pointer flex items-center gap-2 group">
<div className="w-1.5 h-1.5 rounded-full bg-canina-blue group-hover:w-4 transition-all" />
{getText('footer_link_wiki', "دانشنامه ترکیبات")}
</Link>
</li>
<li onClick={onB2BOpen} className="hover:text-canina-blue hover:translate-x-[-4px] transition-all cursor-pointer flex items-center gap-2 group text-blue-200">
<div className="w-1.5 h-1.5 rounded-full bg-canina-blue group-hover:w-4 transition-all" />

View File

@ -2,6 +2,7 @@
import React, { useState } from "react";
import { Play, PlayCircle, Star, ShieldCheck, X } from "lucide-react";
import { motion, AnimatePresence } from "motion/react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useSettingsStore } from "../lib/store/settingsStore";
@ -57,13 +58,13 @@ export default function VetGallery({ testimonials = [] }: { testimonials?: any[]
{getText('videos_desc', "تیم علمی و فرموله‌کنندگان کمپانی کانینا در آلمان مستقیماً با شما صحبت می‌کنند؛ آشنایی با نحوه مصرف، مزایای بالینی و دانش پزشکی پشت هر محصول.")}
</p>
</div>
<button
onClick={() => router.push('/videos')}
<Link
href="/videos"
className="inline-flex items-center gap-2 text-canina-blue font-bold text-sm hover:translate-x-1 transition-transform rtl:hover:-translate-x-1"
>
{getText('videos_view_all', "مشاهده همه ویدئوها")}
<Play className="w-4 h-4" />
</button>
</Link>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">