diff --git a/ReactLibrary/data.json b/ReactLibrary/data.json
index c1dbe76..880438e 100644
--- a/ReactLibrary/data.json
+++ b/ReactLibrary/data.json
@@ -13,6 +13,24 @@
"name": "Лирическое стихотворение"
}
],
+ "authors": [
+ {
+ "id": 1,
+ "name": "Пушкин А. С."
+ },
+ {
+ "id": 2,
+ "name": "Державин Г. Р."
+ },
+ {
+ "id": 3,
+ "name": "Квинт Гораций Флакк"
+ },
+ {
+ "id": 4,
+ "name": "Карамзин Н. М."
+ }
+ ],
"books": [
{
"categoriesId": "3",
@@ -46,23 +64,5 @@
"image": "",
"id": 4
}
- ],
- "authors": [
- {
- "id": 1,
- "name": "Пушкин А. С."
- },
- {
- "id": 2,
- "name": "Державин Г. Р."
- },
- {
- "id": 3,
- "name": "Квинт Гораций Флакк"
- },
- {
- "id": 4,
- "name": "Карамзин Н. М."
- }
]
}
\ No newline at end of file
diff --git a/ReactLibrary/src/App.jsx b/ReactLibrary/src/App.jsx
index 63089b5..450cf9c 100644
--- a/ReactLibrary/src/App.jsx
+++ b/ReactLibrary/src/App.jsx
@@ -12,7 +12,7 @@ const App = ({ routes }) => {
-
+
>
);
};
diff --git a/ReactLibrary/src/index.css b/ReactLibrary/src/index.css
index d92fce2..8ec63f0 100644
--- a/ReactLibrary/src/index.css
+++ b/ReactLibrary/src/index.css
@@ -5,7 +5,7 @@ body{
font-size: 1.5em;
}
-.library-button{
+.lib-btn{
background-color: #e8b8e8;
color: #000000;
font-size: 1em;
@@ -13,12 +13,16 @@ body{
border: #e8b8e8;
}
-.library-button:hover{
+.lib-btn:hover{
background-color: #bf80e6;
color: #000000;
font-weight: bold;
}
+.lib-table{
+ color: #000000;
+}
+
h1 {
font-size: 1.5em;
}
\ No newline at end of file
diff --git a/ReactLibrary/src/main.jsx b/ReactLibrary/src/main.jsx
index 973d971..b4e60ba 100644
--- a/ReactLibrary/src/main.jsx
+++ b/ReactLibrary/src/main.jsx
@@ -6,13 +6,75 @@ import App from './App.jsx';
import './index.css';
import ErrorPage from './pages/ErrorPage.jsx';
import MainPage from './pages/MainPage.jsx';
+import UserPage from './pages/UserPage.jsx';
+import AdminPage from './pages/AdminPage.jsx';
+import BooksTable from './pages/BooksTable.jsx';
+import CategoriesTable from './pages/CategoriesTable.jsx';
+import AuthorsTable from './pages/AuthorsTable.jsx';
+import UserHistory from './pages/UserHistory.jsx';
+import UserFavorities from './pages/UserFavorities.jsx';
+import RegPage from './pages/RegPage.jsx';
+import LoginPage from './pages/LoginPage.jsx';
+import BookEdit from './pages/BookEdit.jsx';
+import CategoryEdit from './pages/CategoryEdit.jsx';
+import AuthorEdit from './pages/AuthorEdit.jsx';
const routes = [
{
index: true,
path: '/',
- element: ,
- title: 'Главная страница',
+ element: ,
+ title: 'Главная',
+ },
+ {
+ path: '/login-page',
+ element: ,
+ title: 'Войти',
+ },
+ {
+ path: '/user-page',
+ element: ,
+ title: 'Личный кабинет',
+ },
+ {
+ path: '/admin-page',
+ element: ,
+ },
+ {
+ path: '/books-table',
+ element: ,
+ },
+ {
+ path: '/categories-table',
+ element: ,
+ },
+ {
+ path: '/authors-table',
+ element: ,
+ },
+ {
+ path: '/user-history',
+ element: ,
+ },
+ {
+ path: '/user-favorities',
+ element: ,
+ },
+ {
+ path: '/reg-page',
+ element: ,
+ },
+ {
+ path: '/book-edit',
+ element: ,
+ },
+ {
+ path: '/category-edit',
+ element: ,
+ },
+ {
+ path: '/author-edit',
+ element: ,
},
];
diff --git a/ReactLibrary/src/pages/AdminPage.jsx b/ReactLibrary/src/pages/AdminPage.jsx
new file mode 100644
index 0000000..8cb37dc
--- /dev/null
+++ b/ReactLibrary/src/pages/AdminPage.jsx
@@ -0,0 +1,23 @@
+import { Button } from 'react-bootstrap';
+import { Link } from 'react-router-dom';
+
+const AdminPage = () => {
+ return (
+ <>
+
+ Страница администратора.
+
+
+ Здесь вы можете просмотреть существующие книги,
+ категории и авторов, а также добавить новых.
+
+
+
+
+
+
+ >
+ );
+};
+
+export default AdminPage;
diff --git a/ReactLibrary/src/pages/AuthorEdit.jsx b/ReactLibrary/src/pages/AuthorEdit.jsx
new file mode 100644
index 0000000..e6db72d
--- /dev/null
+++ b/ReactLibrary/src/pages/AuthorEdit.jsx
@@ -0,0 +1,59 @@
+import { useState } from 'react';
+import { Button, Form } from 'react-bootstrap';
+import { useNavigate } from 'react-router-dom';
+
+const AuthorEdit = () => {
+ const [validated, setValidated] = useState(false);
+ const navigate = useNavigate();
+ const handleSubmit = (event) => {
+ const form = event.currentTarget;
+ if (form.checkValidity() === false) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ setValidated(true);
+ };
+ return (
+ <>
+
+ Добавление/редактирование автора.
+
+
+
+
+
+ Автор
+
+
+
+
+ Название
+
+
+
+ Страна
+
+
+
+ Год рождения
+
+
+
+ Год смерти
+
+
+
+ Изображение
+
+
+
+
+
+
+
+ >
+ );
+};
+
+export default AuthorEdit;
diff --git a/ReactLibrary/src/pages/AuthorsTable.jsx b/ReactLibrary/src/pages/AuthorsTable.jsx
new file mode 100644
index 0000000..3d31a87
--- /dev/null
+++ b/ReactLibrary/src/pages/AuthorsTable.jsx
@@ -0,0 +1,27 @@
+import { Button, Table } from 'react-bootstrap';
+import { Link } from 'react-router-dom';
+
+const AuthorsTable = () => {
+ return (
+ <>
+
+ Таблица авторов.
+
+
+
+
+ № |
+ Имя |
+ Страна |
+ Год рождения |
+ Год смерти |
+ |
+ |
+
+
+
+ >
+ );
+};
+
+export default AuthorsTable;
diff --git a/ReactLibrary/src/pages/BookEdit.jsx b/ReactLibrary/src/pages/BookEdit.jsx
new file mode 100644
index 0000000..69b3da8
--- /dev/null
+++ b/ReactLibrary/src/pages/BookEdit.jsx
@@ -0,0 +1,56 @@
+import { useState } from 'react';
+import { Button, Form } from 'react-bootstrap';
+import { useNavigate } from 'react-router-dom';
+
+const BookEdit = () => {
+ const [validated, setValidated] = useState(false);
+ const navigate = useNavigate();
+ const handleSubmit = (event) => {
+ const form = event.currentTarget;
+ if (form.checkValidity() === false) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ setValidated(true);
+ };
+ return (
+ <>
+
+ Добавление/редактирование книги.
+
+
+
+
+
+ Автор
+
+
+
+
+ Название
+
+
+
+ Категория
+
+
+
+
+ Год издания
+
+
+
+ Изображение
+
+
+
+
+
+
+
+ >
+ );
+};
+
+export default BookEdit;
diff --git a/ReactLibrary/src/pages/BooksTable.jsx b/ReactLibrary/src/pages/BooksTable.jsx
new file mode 100644
index 0000000..e1802b6
--- /dev/null
+++ b/ReactLibrary/src/pages/BooksTable.jsx
@@ -0,0 +1,28 @@
+import { Button, Table } from 'react-bootstrap';
+import { Link } from 'react-router-dom';
+
+const BooksTable = () => {
+ return (
+ <>
+
+ Таблица книг.
+
+
+
+
+ № |
+ Автор |
+ Название |
+ Категория |
+ Год издания |
+ |
+ |
+ |
+
+
+
+ >
+ );
+};
+
+export default BooksTable;
diff --git a/ReactLibrary/src/pages/CategoriesTable.jsx b/ReactLibrary/src/pages/CategoriesTable.jsx
new file mode 100644
index 0000000..31aff62
--- /dev/null
+++ b/ReactLibrary/src/pages/CategoriesTable.jsx
@@ -0,0 +1,25 @@
+import { Button, Table } from 'react-bootstrap';
+import { Link } from 'react-router-dom';
+
+const CategoriesTable = () => {
+ return (
+ <>
+
+ Таблица категорий.
+
+
+
+
+ № |
+ Категория |
+ Описание |
+ |
+ |
+
+
+
+ >
+ );
+};
+
+export default CategoriesTable;
diff --git a/ReactLibrary/src/pages/CategoryEdit.jsx b/ReactLibrary/src/pages/CategoryEdit.jsx
new file mode 100644
index 0000000..7e0c5b5
--- /dev/null
+++ b/ReactLibrary/src/pages/CategoryEdit.jsx
@@ -0,0 +1,39 @@
+import { useState } from 'react';
+import { Button, Form } from 'react-bootstrap';
+import { useNavigate } from 'react-router-dom';
+
+const CategoryEdit = () => {
+ const [validated, setValidated] = useState(false);
+ const navigate = useNavigate();
+ const handleSubmit = (event) => {
+ const form = event.currentTarget;
+ if (form.checkValidity() === false) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ setValidated(true);
+ };
+ return (
+ <>
+
+ Добавление/редактирование категории.
+
+
+ Название
+
+
+
+ Описание
+
+
+
+
+
+
+
+ >
+ );
+};
+
+export default CategoryEdit;
diff --git a/ReactLibrary/src/pages/ErrorPage.jsx b/ReactLibrary/src/pages/ErrorPage.jsx
index 4876a80..d8c7086 100644
--- a/ReactLibrary/src/pages/ErrorPage.jsx
+++ b/ReactLibrary/src/pages/ErrorPage.jsx
@@ -3,14 +3,13 @@ import { useNavigate } from 'react-router-dom';
const ErrorPage = () => {
const navigate = useNavigate();
-
return (
Страница не найдена
-
+
);
diff --git a/ReactLibrary/src/pages/LoginPage.jsx b/ReactLibrary/src/pages/LoginPage.jsx
new file mode 100644
index 0000000..446b747
--- /dev/null
+++ b/ReactLibrary/src/pages/LoginPage.jsx
@@ -0,0 +1,45 @@
+import { useState } from 'react';
+import { Button, Form } from 'react-bootstrap';
+import { Link } from 'react-router-dom';
+
+const LoginPage = () => {
+ const [validated, setValidated] = useState(false);
+ const handleSubmit = (event) => {
+ const form = event.currentTarget;
+ if (form.checkValidity() === false) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ setValidated(true);
+ };
+
+ return (
+ <>
+
+ Вход в аккаунт.
+
+
+
+ E-mail
+
+ Почта заполнена
+ Почта не заполнена
+
+
+ Пароль
+
+ Пароль заполнен
+ Пароль не заполнен
+
+
+
+
+
+
+
+ >
+ );
+};
+
+export default LoginPage;
diff --git a/ReactLibrary/src/pages/MainPage.jsx b/ReactLibrary/src/pages/MainPage.jsx
index 7033ed3..bdddfe1 100644
--- a/ReactLibrary/src/pages/MainPage.jsx
+++ b/ReactLibrary/src/pages/MainPage.jsx
@@ -5,7 +5,7 @@ const MainPage = () => {
return (
<>
- Пример web-страницы.
+ Добро пожаловать!
Здесь вы обязательно найдете нужные вам книги.
@@ -15,8 +15,8 @@ const MainPage = () => {
Там же вы можете посмотреть вашу Историю чтения.
-
-
+
+
>
);
diff --git a/ReactLibrary/src/pages/RegPage.jsx b/ReactLibrary/src/pages/RegPage.jsx
new file mode 100644
index 0000000..3a70722
--- /dev/null
+++ b/ReactLibrary/src/pages/RegPage.jsx
@@ -0,0 +1,55 @@
+import { useState } from 'react';
+import { Button, Form } from 'react-bootstrap';
+
+const RegPage = () => {
+ const [validated, setValidated] = useState(false);
+ const handleSubmit = (event) => {
+ const form = event.currentTarget;
+ if (form.checkValidity() === false) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ setValidated(true);
+ };
+
+ return (
+ <>
+
+ Создание аккаунта.
+
+
+
+ Никнейм
+
+ Никнейм заполнен
+ Никнейм не заполнен
+
+
+ E-mail
+
+ Почта заполнена
+ Почта не заполнена
+
+
+ Пароль
+
+ Пароль заполнен
+ Пароль не заполнен
+
+
+ Повторите пароль
+
+ Пароль повторен
+ Пароль не повторен
+
+
+
+
+
+
+ >
+ );
+};
+
+export default RegPage;
diff --git a/ReactLibrary/src/pages/UserFavorities.jsx b/ReactLibrary/src/pages/UserFavorities.jsx
new file mode 100644
index 0000000..badf34a
--- /dev/null
+++ b/ReactLibrary/src/pages/UserFavorities.jsx
@@ -0,0 +1,28 @@
+import { Button, Table } from 'react-bootstrap';
+import { useNavigate } from 'react-router-dom';
+
+const UserFavorities = () => {
+ const navigate = useNavigate();
+ return (
+ <>
+
+ Избранное.
+
+
+
+
+ № |
+ Автор |
+ Название |
+ Категория |
+ Год издания |
+ |
+ |
+
+
+
+ >
+ );
+};
+
+export default UserFavorities;
diff --git a/ReactLibrary/src/pages/UserHistory.jsx b/ReactLibrary/src/pages/UserHistory.jsx
new file mode 100644
index 0000000..fcf6476
--- /dev/null
+++ b/ReactLibrary/src/pages/UserHistory.jsx
@@ -0,0 +1,29 @@
+import { Button, Table } from 'react-bootstrap';
+import { useNavigate } from 'react-router-dom';
+
+const UserHistory = () => {
+ const navigate = useNavigate();
+ return (
+ <>
+
+ История.
+
+
+
+
+ № |
+ Автор |
+ Название |
+ Категория |
+ Год издания |
+ Время чтения |
+ |
+ |
+
+
+
+ >
+ );
+};
+
+export default UserHistory;
diff --git a/ReactLibrary/src/pages/UserPage.jsx b/ReactLibrary/src/pages/UserPage.jsx
new file mode 100644
index 0000000..f693518
--- /dev/null
+++ b/ReactLibrary/src/pages/UserPage.jsx
@@ -0,0 +1,22 @@
+import { Button } from 'react-bootstrap';
+import { Link } from 'react-router-dom';
+
+const UserPage = () => {
+ return (
+ <>
+
+ Ваш личный кабинет.
+
+
+ Здесь вы можете посмотреть вашу Историю чтения и Избранные книги.
+
+
+
+
+
+
+ >
+ );
+};
+
+export default UserPage;