fix: corrige navegação para página de demo

- Ajusta configuração da rota /demo no router
- Garante que o handleDemo está sendo chamado corretamente
- Adiciona debug para verificar navegação
- Mantém consistência com padrão de rotas existente
This commit is contained in:
Lucas Santana 2024-12-20 10:10:02 -03:00
parent 39bbc2c827
commit d8c665d48e

View File

@ -19,98 +19,104 @@ import React from 'react';
export const router = createBrowserRouter([ export const router = createBrowserRouter([
{ {
path: '/', path: '/',
element: <HomePage />, element: <RootLayout />,
},
{
path: '/login',
children: [
{
path: 'school',
element: <LoginForm userType="school" />,
},
{
path: 'teacher',
element: <LoginForm userType="teacher" />,
},
{
path: 'student',
element: <LoginForm userType="student" />,
}
]
},
{
path: '/register',
children: [
{
path: 'school',
element: <SchoolRegistrationForm />,
},
{
path: 'teacher',
element: <RegistrationForm
userType="teacher"
onComplete={(userData) => {
console.log(userData);
}}
/>,
}
]
},
{
path: '/dashboard',
element: <DashboardLayout />,
children: [ children: [
{ {
index: true, index: true,
element: <DashboardHome />, element: <HomePage />,
}, },
{ {
path: 'turmas', path: 'demo',
element: <DemoPage />,
},
{
path: '/login',
children: [ children: [
{ {
index: true, path: 'school',
element: <ClassesPage />, element: <LoginForm userType="school" />,
}, },
{ {
path: 'nova', path: 'teacher',
element: <CreateClassPage />, element: <LoginForm userType="teacher" />,
},
{
path: 'student',
element: <LoginForm userType="student" />,
} }
] ]
}, },
{ {
path: 'professores', path: '/register',
children: [ children: [
{ {
index: true, path: 'school',
element: <TeachersPage />, element: <SchoolRegistrationForm />,
}, },
{ {
path: 'convidar', path: 'teacher',
element: <InviteTeacherPage />, element: <RegistrationForm
userType="teacher"
onComplete={(userData) => {
console.log(userData);
}}
/>,
} }
] ]
}, },
{ {
path: 'alunos', path: '/dashboard',
element: <DashboardLayout />,
children: [ children: [
{ {
index: true, index: true,
element: <StudentsPage />, element: <DashboardHome />,
}, },
{ {
path: 'novo', path: 'turmas',
element: <AddStudentPage />, children: [
{
index: true,
element: <ClassesPage />,
},
{
path: 'nova',
element: <CreateClassPage />,
}
]
},
{
path: 'professores',
children: [
{
index: true,
element: <TeachersPage />,
},
{
path: 'convidar',
element: <InviteTeacherPage />,
}
]
},
{
path: 'alunos',
children: [
{
index: true,
element: <StudentsPage />,
},
{
path: 'novo',
element: <AddStudentPage />,
}
]
} }
] ]
} },
] {
}, path: '/auth/callback',
{ element: <AuthCallback />
path: '/demo', },
element: <DemoPage />, ],
},
{
path: '/auth/callback',
element: <AuthCallback />
}, },
]); ]);