system-pri/frontend/src/App.tsx

79 lines
3.2 KiB
TypeScript
Raw Normal View History

2022-05-30 21:38:45 +02:00
import React from 'react'
import { QueryClient, QueryClientProvider } from 'react-query'
2022-06-13 19:48:52 +02:00
import { Navigate, Route, Routes } from 'react-router-dom'
2022-05-30 21:38:45 +02:00
import './App.css'
2022-10-27 23:36:49 +02:00
import 'react-big-calendar/lib/css/react-big-calendar.css'
2022-06-09 23:58:35 +02:00
import AddGroup from './views/coordinator/AddGroup'
2022-06-04 21:03:40 +02:00
import AddStudent from './views/coordinator/AddStudent'
import AddLeader from './views/coordinator/AddLeader'
2022-05-30 21:38:45 +02:00
import Coordinator from './views/coordinator/Coordinator'
import Groups from './views/coordinator/Groups'
import Leaders from './views/coordinator/Leaders'
import Students from './views/coordinator/Students'
2022-06-11 19:12:08 +02:00
import Login from './views/Login'
2022-06-13 19:48:52 +02:00
import Enrollment from './views/student/Enrollment'
import Student from './views/student/Student'
2022-10-27 23:36:49 +02:00
import Supervisor from './views/supervisor/Supervisor'
import Schedules from './views/coordinator/Schedules'
import Schedule from './views/coordinator/Schedule'
import SupervisorSchedules from './views/supervisor/SupervisorSchedules'
import StudentSchedules from './views/student/StudentSchedules'
import StudentSchedule from './views/student/StudentSchedule'
import SupervisorSchedule from './views/supervisor/SupervisorSchedule'
2022-11-17 22:21:59 +01:00
import Home from './views/coordinator/Home'
2022-11-24 20:31:47 +01:00
import SupervisorAvailabilities from './views/coordinator/SupervisorAvailabilities'
import AvailabilitySchedule from './views/coordinator/AvailabilitySchedule'
2022-05-22 21:28:25 +02:00
2022-05-30 21:38:45 +02:00
const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchOnWindowFocus: false,
},
},
})
2022-05-16 23:17:36 +02:00
function App() {
return (
2022-05-22 21:28:25 +02:00
<div>
<QueryClientProvider client={queryClient}>
<Routes>
2022-06-11 19:12:08 +02:00
<Route index element={<Login />} />
2022-05-22 21:28:25 +02:00
<Route path="coordinator" element={<Coordinator />}>
2022-11-17 22:21:59 +01:00
<Route index element={<Home />} />
2022-05-22 21:28:25 +02:00
<Route path="groups" element={<Groups />} />
<Route path="students" element={<Students />} />
<Route path="leaders" element={<Leaders />} />
2022-06-04 21:03:40 +02:00
<Route path="add-student" element={<AddStudent />} />
2022-06-09 23:58:35 +02:00
<Route path="add-group" element={<AddGroup />} />
<Route path="add-leader" element={<AddLeader />} />
2022-10-27 23:36:49 +02:00
<Route path="schedule" element={<Schedules />} />
<Route path="schedule/:id" element={<Schedule />} />
2022-11-24 20:31:47 +01:00
<Route
path="supervisors_availability"
element={<SupervisorAvailabilities />}
/>
<Route
path="supervisors_availability/:id"
element={<AvailabilitySchedule />}
/>
2022-05-22 21:28:25 +02:00
</Route>
2022-06-13 19:48:52 +02:00
<Route path="student" element={<Student />}>
<Route index element={<Navigate to="enrollment" />} />
<Route path="enrollment" element={<Enrollment />} />
<Route path="schedule" element={<StudentSchedules />} />
<Route path="schedule/:id" element={<StudentSchedule />} />
2022-06-13 19:48:52 +02:00
</Route>
2022-10-27 23:36:49 +02:00
<Route path="supervisor" element={<Supervisor />}>
<Route index element={<Navigate to="groups" />} />
<Route path="groups" element={<Groups />} />
<Route path="schedule" element={<SupervisorSchedules />} />
<Route path="schedule/:id" element={<SupervisorSchedule />} />
2022-10-27 23:36:49 +02:00
</Route>
2022-05-22 21:28:25 +02:00
</Routes>
</QueryClientProvider>
2022-05-16 23:17:36 +02:00
</div>
2022-05-30 21:38:45 +02:00
)
2022-05-16 23:17:36 +02:00
}
2022-05-30 21:38:45 +02:00
export default App