fix(routing): use resilient path matching for legal pages

This commit is contained in:
Marcio Bevervanso 2026-02-20 16:24:49 -03:00
parent cd5e373c2a
commit 2195d19178

View file

@ -41,13 +41,14 @@ const AppContent: React.FC = () => {
// Helper mapping from path to ViewState internally if needed // Helper mapping from path to ViewState internally if needed
const getCurrentView = (): ViewState => { const getCurrentView = (): ViewState => {
switch (currentPath) { const normalizedPath = currentPath.replace(/\/$/, '') || '/';
case '/faq': return 'faq';
case '/privacidade': return 'privacy'; if (normalizedPath.includes('/faq')) return 'faq';
case '/termos': return 'terms'; if (normalizedPath.includes('/privacidade')) return 'privacy';
case '/exclusao-de-dados': return 'data-deletion'; if (normalizedPath.includes('/termos')) return 'terms';
default: return 'home'; if (normalizedPath.includes('/exclusao-de-dados')) return 'data-deletion';
}
return 'home';
}; };
const currentView = getCurrentView(); const currentView = getCurrentView();