From 2195d1917851da2f20216a7b1151b6b9dadce52d Mon Sep 17 00:00:00 2001 From: Marcio Bevervanso Date: Fri, 20 Feb 2026 16:24:49 -0300 Subject: [PATCH] fix(routing): use resilient path matching for legal pages --- src/App.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 389e498..ab97a98 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -41,13 +41,14 @@ const AppContent: React.FC = () => { // Helper mapping from path to ViewState internally if needed const getCurrentView = (): ViewState => { - switch (currentPath) { - case '/faq': return 'faq'; - case '/privacidade': return 'privacy'; - case '/termos': return 'terms'; - case '/exclusao-de-dados': return 'data-deletion'; - default: return 'home'; - } + const normalizedPath = currentPath.replace(/\/$/, '') || '/'; + + if (normalizedPath.includes('/faq')) return 'faq'; + if (normalizedPath.includes('/privacidade')) return 'privacy'; + if (normalizedPath.includes('/termos')) return 'terms'; + if (normalizedPath.includes('/exclusao-de-dados')) return 'data-deletion'; + + return 'home'; }; const currentView = getCurrentView();