system-pri/frontend/src/App.tsx

96 lines
4.0 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 CoordinatorGroups from './views/coordinator/CoordinatorGroups'
import SupervisorGroups from './views/supervisor/SupervisorGroups'
2022-05-30 21:38:45 +02:00
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'
import GradeCard from './views/GradeCard'
import Group from './views/coordinator/Group'
2022-12-30 21:39:58 +01:00
import dayjs from 'dayjs'
2023-01-02 23:50:56 +01:00
import WorkloadStatistics from './views/coordinator/WorkloadStatistics'
2022-12-30 21:39:58 +01:00
require('dayjs/locale/pl')
dayjs.locale('pl')
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 />} />
<Route path="groups" element={<CoordinatorGroups />} />
<Route path="groups/:id" element={<Group />} />
2022-05-22 21:28:25 +02:00
<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="groups/:id/grade-card" element={<GradeCard />} />
2022-11-24 20:31:47 +01:00
<Route
path="supervisors_availability/:id"
element={<AvailabilitySchedule />}
2023-01-02 23:50:56 +01:00
/>
<Route
path="schedule/:id/workload"
element={<WorkloadStatistics />}
2022-11-24 20:31:47 +01:00
/>
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={<SupervisorGroups />} />
2022-12-16 03:28:27 +01:00
<Route path="groups/:id" element={<Group />} />
<Route path="groups/:id/grade-card" element={<GradeCard />} />
<Route path="schedule" element={<SupervisorSchedules />} />
<Route path="schedule/:id" element={<SupervisorSchedule />} />
2022-12-16 03:28:27 +01:00
<Route path="add-group" element={<AddGroup />} />
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