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
|
// 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();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue