summaryrefslogtreecommitdiff
path: root/src/app/StudentRoutes.js
blob: 1dc6b4ae4c71ec92706889374b4cc489acf2ea50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { Navigate, Route, Routes } from 'react-router-dom';

import Home from '../screens/student/Home';
import Classroom from '../screens/student/Classroom';

import Information from '../screens/Information';
import Calendar from '../screens/Calendar';
import Assignment from '../screens/Assignment';
import Profile from '../screens/Profile';

function StudentRoutes() {
  return (
    <Routes>
      <Route path="/home" element={<Home />} />
      <Route path="/info" element={<Information />} />
      <Route path="/calendar" element={<Calendar />} />
      <Route path="/profile" element={<Profile />} />
      <Route path="/class">
        <Route path=":id" element={<Classroom />} />
      </Route>
      <Route path="/assignment">
        <Route path=":id" element={<Assignment />} />
      </Route>
      <Route path="/login" element={<Navigate to="/home" />} />
      <Route path="/register" element={<Navigate to="/home" />} />
      <Route path="/" element={<Navigate to="/home" />} />
    </Routes>
  );
}

export default StudentRoutes;