feat: finalize academy redesign and production readiness
Align admin, community, search, library, learning and course management with the mockup. Add saved courses, download history, public community feed, instructor directory, backend search, course views, admin content tools and community moderation. Harden API and Nginx for production.
This commit is contained in:
19
lib/navigation.ts
Normal file
19
lib/navigation.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/** Which top-level destination a pathname belongs to (highlights the sidebar and tab bar). */
|
||||
export type NavKey =
|
||||
| 'search' | 'explore' | 'trails' | 'learning' | 'community' | 'professors'
|
||||
| 'library' | 'downloads' | 'manage' | 'admin' | 'you' | 'none';
|
||||
|
||||
export const navKeyFor = (pathname: string): NavKey => {
|
||||
if (pathname === '/' || pathname.startsWith('/cursos')) return 'explore';
|
||||
if (pathname.startsWith('/buscar')) return 'search';
|
||||
if (pathname.startsWith('/trilhas')) return 'trails';
|
||||
if (pathname.startsWith('/meu-aprendizado')) return 'learning';
|
||||
if (pathname.startsWith('/comunidade')) return 'community';
|
||||
if (pathname.startsWith('/professores') || pathname.startsWith('/instrutores') || pathname.startsWith('/perfis')) return 'professors';
|
||||
if (pathname.startsWith('/materiais')) return 'library';
|
||||
if (pathname.startsWith('/downloads')) return 'downloads';
|
||||
if (pathname.startsWith('/gerenciar')) return 'manage';
|
||||
if (pathname.startsWith('/admin')) return 'admin';
|
||||
if (pathname.startsWith('/voce') || pathname.startsWith('/perfil')) return 'you';
|
||||
return 'none';
|
||||
};
|
||||
Reference in New Issue
Block a user