fix(routing): use resilient path matching for legal pages
This commit is contained in:
parent
cd5e373c2a
commit
2195d19178
1 changed files with 8 additions and 7 deletions
15
src/App.tsx
15
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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue