From 83c2102afe3de9b0699124f4d760bb1f6bc5c1f8 Mon Sep 17 00:00:00 2001 From: payacom <59262811+payacom@users.noreply.github.com> Date: Thu, 17 Sep 2026 16:22:56 +0330 Subject: [PATCH] fix(nav): settings tab now correctly returns to /settings from any sub-page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SettingsShell always passed the literal string "/settings" as currentPage to TabNavigation, regardless of the actual sub-route. TabNavigation's isExactRoot check (currentPage === tab.href) was therefore always true for the settings tab, so tapping it while on any settings sub-page (e.g. /settings/wallet) always hit the "already here" branch and called preventDefault() instead of navigating — the user had to tap a different tab first (which uses a different pathname) before tapping Settings again would actually work. Now passes the real pathname; tab highlighting is unaffected since TabNavigation already does its own startsWith() check for that. Co-Authored-By: Claude Sonnet 5 --- src/components/settings/SettingsShell.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/settings/SettingsShell.tsx b/src/components/settings/SettingsShell.tsx index cc19477..e553d47 100644 --- a/src/components/settings/SettingsShell.tsx +++ b/src/components/settings/SettingsShell.tsx @@ -30,13 +30,13 @@ export default function SettingsShell({ transition={{ duration: 0.35, ease: [0.25, 0.46, 0.45, 0.94] }} className="fixed bottom-0 left-0 right-0 z-50" > - + {/* pathname واقعی رو پاس می‌دیم، نه همیشه "/settings" ثابت — قبلاً برای هر + زیرصفحه‌ی تنظیمات (مثلاً /settings/wallet) هم "/settings" پاس داده می‌شد، + پس isExactRoot توی TabNavigation.tsx همیشه true می‌شد و کلیکِ روی آیکونِ + تنظیمات preventDefault می‌شد (به‌جای navigate واقعی)، چون فکر می‌کرد از + قبل دقیقاً روی روتِ /settings هستیم. isActive/هایلایتِ تب همچنان درست + کار می‌کنه چون TabNavigation خودش startsWith("/settings") رو چک می‌کنه */} + )}