diff --git a/src/App.jsx b/src/App.jsx
index ec2cb28..1562b23 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -1,6 +1,5 @@
import { useState } from 'react'
import { Outlet } from 'react-router-dom';
-import { Container } from 'react-bootstrap';
import { CurrentUserContext } from './contexts/CurrentUserContext';
import Header from './components/header/header';
import Footer from './components/footer/footer';
diff --git a/src/components/header/header.jsx b/src/components/header/header.jsx
index 291fb9b..65f9a31 100644
--- a/src/components/header/header.jsx
+++ b/src/components/header/header.jsx
@@ -11,7 +11,10 @@ const Header = ({ routes }) => {
const indexPageLink = routes.filter((route) => route.index === false).shift();
const currentPage = routes.filter((route) => route.path === location.pathname)[0];
if (currentUser) {
- routes = routes.filter((route) => route.onlyNoAuthorized != true);
+ routes = routes.filter((route) => !route.onlyNoAuthorized);
+ }
+ else {
+ routes = routes.filter((route) => !route.onlyAuthorized);
}
return (
diff --git a/src/main.jsx b/src/main.jsx
index 71091f6..6f12f91 100644
--- a/src/main.jsx
+++ b/src/main.jsx
@@ -9,6 +9,7 @@ import ErrorPage from './pages/ErrorPage/ErrorPage.jsx'
import MainPage from './pages/MainPage/MainPage.jsx'
import AuthPage from './pages/AuthPage/AuthPage.jsx'
import RegisterPage from './pages/RegisterPage/RegisterPage.jsx'
+import StatementsPage from './pages/StatementsPage/StatementsPage.jsx'
const routes = [
{
@@ -17,6 +18,13 @@ const routes = [
element: ,
title: 'Главная'
},
+ {
+ path: '/statements',
+ element: ,
+ title: 'Ведомости',
+ onlyAuthorized: true,
+ onlyTeachers: true
+ },
{
path: '/auth',
element: ,
diff --git a/src/pages/AuthPage/AuthPage.jsx b/src/pages/AuthPage/AuthPage.jsx
index 4925097..b183794 100644
--- a/src/pages/AuthPage/AuthPage.jsx
+++ b/src/pages/AuthPage/AuthPage.jsx
@@ -11,9 +11,12 @@ const AuthPage = () => {
const navigate = useNavigate();
- if (currentUser) {
- navigate('/');
- }
+ useEffect(() => {
+ if (currentUser) {
+ navigate('/');
+ }
+ });
+
const [inputFields, setInputFields] = useState({
username: "",
diff --git a/src/pages/MainPage/MainPage.jsx b/src/pages/MainPage/MainPage.jsx
index 29dc781..55fdcea 100644
--- a/src/pages/MainPage/MainPage.jsx
+++ b/src/pages/MainPage/MainPage.jsx
@@ -2,7 +2,7 @@
const MainPage = () => {
return (
<>
-
Hello world!
+ Mainpage
>
);
};
diff --git a/src/pages/StatementsPage/StatementsPage.jsx b/src/pages/StatementsPage/StatementsPage.jsx
new file mode 100644
index 0000000..31f7b36
--- /dev/null
+++ b/src/pages/StatementsPage/StatementsPage.jsx
@@ -0,0 +1,9 @@
+const StatementsPage = () => {
+ return (
+ <>
+ StatementsPage
+ >
+ );
+};
+
+export default StatementsPage
diff --git a/src/services/CotrolTypesApiService.js b/src/services/CotrolTypesApiService.js
new file mode 100644
index 0000000..654003a
--- /dev/null
+++ b/src/services/CotrolTypesApiService.js
@@ -0,0 +1,5 @@
+import ApiService from "../api/ApiService.js";
+
+const ControlTypesApiService = new ApiService("controltypes");
+
+export default ControlTypesApiService;
diff --git a/src/services/MarksApiService.js b/src/services/MarksApiService.js
new file mode 100644
index 0000000..dd14872
--- /dev/null
+++ b/src/services/MarksApiService.js
@@ -0,0 +1,5 @@
+import ApiService from "../api/ApiService.js";
+
+const MarksApiService = new ApiService("marks");
+
+export default MarksApiService;
diff --git a/src/services/StatementsApiService.js b/src/services/StatementsApiService.js
new file mode 100644
index 0000000..7d66a87
--- /dev/null
+++ b/src/services/StatementsApiService.js
@@ -0,0 +1,5 @@
+import ApiService from "../api/ApiService.js";
+
+const StatementsApiService = new ApiService("statements");
+
+export default StatementsApiService;
diff --git a/src/services/SubjectsApiService.js b/src/services/SubjectsApiService.js
new file mode 100644
index 0000000..074ed09
--- /dev/null
+++ b/src/services/SubjectsApiService.js
@@ -0,0 +1,5 @@
+import ApiService from "../api/ApiService.js";
+
+const SubjectsApiService = new ApiService("subjects");
+
+export default SubjectsApiService;
diff --git a/src/services/UserMarksApiService.js b/src/services/UserMarksApiService.js
new file mode 100644
index 0000000..ea81cb9
--- /dev/null
+++ b/src/services/UserMarksApiService.js
@@ -0,0 +1,5 @@
+import ApiService from "../api/ApiService.js";
+
+const UserMarksApiService = new ApiService("usermarks");
+
+export default UserMarksApiService;