This commit is contained in:
payacom
2026-09-13 21:32:32 +03:30
parent 901ce94443
commit 9d48c0534e
21 changed files with 2326 additions and 336 deletions

View File

@@ -56,6 +56,20 @@ export default function TabNavigation({ currentPage }: TabNavigationProps) {
<Link
key={tab.href}
href={tab.href}
onClick={(e) => {
// وقتی تبی که از قبل توش هستیم دوباره زده می‌شه، Next.js چون مسیر عوض
// نمی‌شه هیچ اسکرول/رفرشی انجام نمی‌ده — طبق درخواست کاربر، مثل اینستاگرام
// باید صفحه بره بالا و (برای تبِ خانه) جدیدترین پست‌ها هم لود بشن
if (isActive) {
e.preventDefault();
window.dispatchEvent(
new CustomEvent("app:tab-reselect", {
detail: { href: tab.href },
})
);
window.scrollTo({ top: 0, behavior: "smooth" });
}
}}
className="gentle-transition flex flex-col items-center gap-0.5 px-2 py-1 active:scale-95"
>
<BoldIcon