Удалил старые файлы

This commit is contained in:
ujijrujijr 2024-01-14 21:09:41 +04:00
parent 9a76c62fa6
commit f76ae5ea82
67 changed files with 0 additions and 8918 deletions

View File

@ -1,28 +0,0 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'airbnb-base',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: { ecmaVersion: 12, sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'indent': 'off',
'no-console': 'off',
'arrow-body-style': 'off',
'implicit-arrow-linebreak': 'off',
'linebreak-style': 'off',
'no-trailing-spaces' : 'off',
'max-len' : 'off',
'no-multiple-empty-lines' : 'off',
},
}

45
Lab5 old/.gitignore vendored
View File

@ -1,45 +0,0 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# Compiled output
/dist
/tmp
/out-tsc
/bazel-out
# Node
/node_modules
npm-debug.log
yarn-error.log
# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings
# System files
.DS_Store
Thumbs.db
# Ignore dist
dist/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

View File

@ -1,80 +0,0 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Steam</title>
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.js"></script>
<link rel="stylesheet" href="./node_modules/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<nav class="navbar navbar-expand-md navbar-dark">
<div class="container-fluid">
<a class="nav-link active" href="./index.html"> Главная </a>
<!--КНОПКА С ТРЕМЯ ПОЛОСКАМИ ПРИ УМЕНЬШЕНИИ-->
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
<div class="navbar-nav">
<a class="nav-link active" href="./basket.html">Корзина</a>
<a class="nav-link active" href="./library.html">Библиотека</a>
<a class="nav-link active" href="./entry.html">Вход</a>
</div>
</div>
</div>
</nav>
</header>
<main class="container-fluid p-2">
<div class="text-center">
<img id="image-preview" src="placeholder.jpg" alt="placeholder">
</div>
<form id="games-form" class="admin_panel mt-4 needs-validation" novalidate>
<div class="input-group mb-4">
<span class="input-group-text span_admin_panel" id="basic-addon1">Жанр:</span>
<select id="genre" class="form-select" name="selected" required>
</select>
</div>
<div class="input-group mb-4">
<span class="input-group-text span_admin_panel" id="basic-addon1">Название:</span>
<input id="name" type="text" class="form-control" placeholder="Название" required>
</div>
<div class="input-group mb-4">
<span class="input-group-text span_admin_panel" id="basic-addon1">Цена:</span>
<input id = "price" type="number" class="form-control" placeholder="Цена" required>
</div>
<div class="input-group mb-4">
<span class="input-group-text span_admin_panel" id="basic-addon1">Фото:</span>
<input id="image" name="image" type="file" class="form-control" placeholder="Фото" accept="image/*">
</div>
<div class = "d-flex justify-content-center">
<button class = "btn_admin_panel" type="submit"> Подтвердить </button> <!-- onclick="window.location.href = './index.html';" -->
</div>
</form>
</main>
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
</footer>
<script type="module">
import validation from "./js/validation";
import { linesPageForm } from "./js/lines"
document.addEventListener('DOMContentLoaded', () => {
validation();
linesPageForm();
});
</script>
</body>
</html>

View File

@ -1,96 +0,0 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Steam</title>
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.js"></script>
<link rel="stylesheet" href="./node_modules/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<nav class="navbar navbar-expand-md navbar-dark">
<div class="container-fluid">
<a class="nav-link" href="./index.html"> Главная </a>
<!--КНОПКА С ТРЕМЯ ПОЛОСКАМИ ПРИ УМЕНЬШЕНИИ-->
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
<div class="navbar-nav">
<a class="nav-link active" href="./basket.html">Корзина</a>
<a class="nav-link active" href="./library.html">Библиотека</a>
<a class="nav-link active" href="./entry.html">Вход</a>
</div>
</div>
</div>
</nav>
</header>
<main class="container-fluid p-2">
<table class="table table-bordered align-middle">
<tbody>
<tr>
<td class = "p-0 cell1_basket">
<img src="Dark Nights preview.jpg" alt="Dark Nights with Poe & Munro" class="img-fluid">
</td>
<td class = "p-0 cell2_basket">
<p class = "basket_name_of_game">Dark Nights with Poe and Munro</p>
</td>
<td class = "p-0 text-center align-middle cell3_basket">
<p class = "price_of_game_main_page"> 299 руб.</p>
</td>
<td class = "p-0 text-center align-middle">
<button class = "basket_delete_button"> X </button>
</td>
</tr>
<tr>
<td class = "p-0 cell1_basket">
<img src="Ten Dates preview.jpg" alt="Ten Dates" class="img-fluid">
</td>
<td class = "p-0 text-center align-middle cell2_basket">
<p class = "basket_name_of_game">Ten Dates</p>
</td>
<td class = "p-0 text-center align-middle cell3_basket">
<p class = "price_of_game_main_page"> 509 руб.</p>
</td>
<td class = "p-0 text-center align-middle">
<button class = "basket_delete_button"> X </button>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="2" class = "align-left">
<p class = "basket_price_of_games"> Итого: 808 руб.</p>
</td>
<td colspan="2" class = "text-end">
<button class = "basket_buy_button">КУПИТЬ</button>
</td>
</tr>
</tfoot>
</table>
</main>
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
Сайт Чернышева Георгия, ПИбд-22
</footer>
</body>
</html>

View File

@ -1,78 +0,0 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Steam</title>
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.js"></script>
<link rel="stylesheet" href="./node_modules/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<nav class="navbar navbar-expand-md navbar-dark">
<div class="container-fluid">
<a class="nav-link active" href="./index.html"> Главная </a>
<!--КНОПКА С ТРЕМЯ ПОЛОСКАМИ ПРИ УМЕНЬШЕНИИ-->
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
<div class="navbar-nav">
<a class="nav-link active" href="./basket.html">Корзина</a>
<a class="nav-link active" href="./library.html">Библиотека</a>
<a class="nav-link active" href="./entry.html">Вход</a>
</div>
</div>
</div>
</nav>
</header>
<main class="container-fluid">
<div class="row align-items-center justify-content-center mb-2 mt-20vh">
<div class="col-auto justify-content-left">
<label for="inputMail" class="account_text" id = "label_nickname">ВВЕДИТЕ ПОЧТУ:</label>
</div>
<div class="col-auto">
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp">
</div>
</div>
<div class="row align-items-center justify-content-center mb-2">
<div class="col-auto justify-content-left">
<label for="inputMail" class="account_text" id = "label_nickname">ВВЕДИТЕ НИК:</label>
</div>
<div class="col-auto">
<input type="text" class="form-control" aria-label="Username" id = "inputMail">
</div>
</div>
<div class="row align-items-center justify-content-center mb-2">
<div class="col-auto">
<label for="inputPassword6" class="account_text">ВВЕДИТЕ ПАРОЛЬ:</label>
</div>
<div class="col-auto">
<input type="password" id="inputPassword6" class="form-control" aria-describedby="passwordHelpInline">
</div>
</div>
<div class="row align-items-center justify-content-center">
<div class="col-auto mt-3">
<button class = "account_btn"> СОЗДАТЬ </button>
</div>
</div>
</main>
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
<a class = "account_text" href = "entry.html">ВОЙТИ В АККАУНТ</a>
</footer>
</body>
</html>

View File

@ -1,67 +0,0 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Steam</title>
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.js"></script>
<link rel="stylesheet" href="./node_modules/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<nav class="navbar navbar-expand-md navbar-dark">
<div class="container-fluid">
<a class="nav-link active" href="./index.html"> Главная </a>
<!--КНОПКА С ТРЕМЯ ПОЛОСКАМИ ПРИ УМЕНЬШЕНИИ-->
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
<div class="navbar-nav">
<a class="nav-link active" href="./basket.html">Корзина</a>
<a class="nav-link active" href="./library.html">Библиотека</a>
<a class="nav-link active" href="./entry.html">Вход</a>
</div>
</div>
</div>
</nav>
</header>
<main class="container-fluid p-2">
<!-- ВЕРХНИЙ DIV -->
<div class = "row info_about_game_pic_and_name">
<div class = "col-sm-5">
<img src="Dark Nights preview.jpg" alt="Dark Nights with Poe & Munro" class="img-fluid">
</div>
<div class = "col-sm-7 text-center align-items-center">
<p class = "info_about_game_name">Dark Nights with Poe and Munro</p>
</div>
</div>
<div class = "row">
<div class = "col-sm 12">
<p class = "info_about_game_text">Проведите местных радиоведущих По и Манро через шесть похожих на короткометражки эпизодов сверъестественной странности и обжигающего сюжета. От создателей The Infectious Madness of Doctor Dekker и The Shapeshifting Detective.</p>
</div>
<div class = "info_about_game_div_button text-center align-items-center">
<button class = "info_about_game_add_to_basket_button"> Добавить в корзину </button>
</div>
</div>
</main>
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
Сайт Чернышева Георгия, ПИбд-22
</footer>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -1,68 +0,0 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Steam</title>
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.js"></script>
<link rel="stylesheet" href="./node_modules/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<nav class="navbar navbar-expand-md navbar-dark">
<div class="container-fluid">
<a class="nav-link active" href="./index.html"> Главная </a>
<!--КНОПКА С ТРЕМЯ ПОЛОСКАМИ ПРИ УМЕНЬШЕНИИ-->
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
<div class="navbar-nav">
<a class="nav-link active" href="./basket.html">Корзина</a>
<a class="nav-link active" href="./library.html">Библиотека</a>
<a class="nav-link active" href="./entry.html">Вход</a>
</div>
</div>
</div>
</nav>
</header>
<main class = "container-fluid">
<div class="row align-items-center justify-content-center mb-2 mt-25vh">
<div class="col-auto">
<label for="inputMail" class="account_text" id = "label_nickname">ВВЕДИТЕ НИК:</label>
</div>
<div class="col-auto">
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp">
</div>
</div>
<div class="row align-items-center justify-content-center mb-2">
<div class="col-auto">
<label for="inputMail" class="account_text" id = "label_nickname">ВВЕДИТЕ ПАРОЛЬ:</label>
</div>
<div class="col-auto">
<input type="text" class="form-control" aria-label="Username" id = "inputMail">
</div>
</div>
<div class="row align-items-center justify-content-center">
<div class="col-auto mt-3">
<button class = "account_btn"> ВОЙТИ </button>
</div>
</div>
</main>
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
<a class = "account_text" href = "create_account.html">СОЗДАТЬ АККАУНТ</a>
</footer>
</body>
</html>

View File

@ -1,12 +0,0 @@
<html lang="ru">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Steam</title>
</head>
<body>
<div id="root" class = "d-flex flex-column"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>

View File

@ -1,15 +0,0 @@
{
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Node",
"target": "ES2020",
"jsx": "react",
"strictNullChecks": true,
"strictFunctionTypes": true,
"sourceMap": true
},
"exclude": [
"node_modules",
"**/node_modules/*"
]
}

View File

@ -1,120 +0,0 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Steam</title>
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.js"></script>
<link rel="stylesheet" href="./node_modules/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<nav class="navbar navbar-expand-md navbar-dark">
<div class="container-fluid">
<a class="nav-link active" href="./index.html"> Главная </a>
<!--КНОПКА С ТРЕМЯ ПОЛОСКАМИ ПРИ УМЕНЬШЕНИИ-->
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
<div class="navbar-nav">
<a class="nav-link active" href="./basket.html">Корзина</a>
<a class="nav-link active" href="./library.html">Библиотека</a>
<a class="nav-link active" href="./entry.html">Вход</a>
</div>
</div>
</div>
</nav>
</header>
<main class="container-fluid p-2">
<table class="table table-borderless table_of_library">
<tbody>
<tr>
<td class = "align-middle p-0 cell1_library">
<img src="Dark Nights preview.jpg" alt="Dark Nights with Poe & Munro" class="img-fluid">
</td>
<td class = "align-middle p-0 cell2_library">
<a class = "nav-link library_name_of_game" href="./dark_nights_page.html">Dark Nights with Poe and Munro</a>
</td>
<td class = "align-middle text-center p-0">
<select>
<option disabled selected>ИГРА</option>
<option>Играть</option>
<option>Установить</option>
<option>Удалить</option>
</select>
</td>
</tr>
<tr>
<td class = "align-middle p-0 cell1_library" >
<img src="Song of Farca preview.jpg" alt="Song of Farca" class="img-fluid">
</td>
<td class = "align-middle p-0 cell2_library" >
<a class = "nav-link library_name_of_game" href="./dark_nights_page.html">Song of Farca</a>
</td>
<td class = "align-middle text-center p-0">
<select>
<option disabled selected>ИГРА</option>
<option>Играть</option>
<option>Установить</option>
<option>Удалить</option>
</select>
</td>
</tr>
<tr>
<td class = "align-middle p-0 cell1_library">
<img src="Papers, Please preview.jpg" alt="Papers, Please" class="img-fluid">
</td>
<td class = "align-middle p-0 cell2_library">
<a class = "nav-link library_name_of_game" href="./dark_nights_page.html"> Papers, Please </a>
</td>
<td class = "align-middle text-center p-0">
<select>
<option disabled selected>ИГРА</option>
<option>Играть</option>
<option>Установить</option>
<option>Удалить</option>
</select>
</td>
</tr>
<tr>
<td class = "align-middle p-0 cell1_library">
<img src="Ten Dates preview.jpg" alt="Ten Dates" class="img-fluid">
</td>
<td class = "align-middle p-0 cell2_library">
<a class = "nav-link library_name_of_game" href="./dark_nights_page.html">Ten Dates</a>
</td>
<td class = "align-middle text-center p-0">
<select>
<option disabled selected>ИГРА</option>
<option>Играть</option>
<option>Установить</option>
<option>Удалить</option>
</select>
</td>
</tr>
</tbody>
</table>
</main>
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
Сайт Чернышева Георгия, ПИбд-22
</footer>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -1,39 +0,0 @@
{
"name": "lab5",
"private": true,
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "npm-run-all --parallel rest vite",
"rest": "json-server data.json",
"vite": "vite",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"prod": "npm-run-all lint 'vite build' --parallel rest 'vite preview'"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.18.0",
"react-hot-toast": "^2.4.1",
"axios": "^1.6.1",
"bootstrap": "5.2.1",
"react-bootstrap": "^2.9.1",
"react-bootstrap-icons": "^1.10.3",
"@fortawesome/fontawesome-free": "6.2.0",
"prop-types": "^15.8.1"
},
"devDependencies": {
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@vitejs/plugin-react": "^4.0.3",
"eslint": "8.50.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"json-server": "^0.17.4",
"npm-run-all": "^4.1.5",
"vite": "^4.4.5"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

View File

View File

@ -1,25 +0,0 @@
import PropTypes from 'prop-types';
import { Container } from 'react-bootstrap';
import { Outlet } from 'react-router-dom';
import './App.css';
import Footer from './components/footer/Footer.jsx';
import Navigation from './components/navigation/Navigation.jsx';
// Компонент основной части сайта (панель навигации, контейнер для main, футер)
function App({ routes }) {
return (
<>
<Navigation routes={routes}></Navigation>
<Container className='p-2' as="main" fluid>
<Outlet />
</Container>
<Footer/>
</>
);
}
App.propTypes = {
routes: PropTypes.array,
};
export default App;

View File

@ -1,40 +0,0 @@
import axios from 'axios';
import toast from 'react-hot-toast';
export class HttpError extends Error {
constructor(message = '') {
super(message);
this.name = 'HttpError';
Object.setPrototypeOf(this, new.target.prototype);
toast.error(message, { id: 'HttpError' });
}
}
function responseHandler(response) {
if (response.status === 200 || response.status === 201) {
const data = response?.data;
if (!data) {
throw new HttpError('API Error. No data!');
}
return data;
}
throw new HttpError(`API Error! Invalid status code ${response.status}!`);
}
function responseErrorHandler(error) {
if (error === null) {
throw new Error('Unrecoverable error!! Error is null!');
}
toast.error(error.message, { id: 'AxiosError' });
return Promise.reject(error.message);
}
export const ApiClient = axios.create({
baseURL: 'http://localhost:8081/',
timeout: '3000',
headers: {
Accept: 'application/json',
},
});
ApiClient.interceptors.response.use(responseHandler, responseErrorHandler);

View File

@ -1,29 +0,0 @@
import { ApiClient } from './ApiClient';
class ApiService {
constructor(url) {
this.url = url;
}
async getAll(expand) {
return ApiClient.get(`${this.url}${expand || ''}`);
}
async get(id, expand) {
return ApiClient.get(`${this.url}/${id}${expand || ''}`);
}
async create(body) {
return ApiClient.post(this.url, body);
}
async update(id, body) {
return ApiClient.put(`${this.url}/${id}`, body);
}
async delete(id) {
return ApiClient.delete(`${this.url}/${id}`);
}
}
export default ApiService;

View File

@ -1,13 +0,0 @@
footer {
position: fixed;
left: 0;
bottom: 0;
background-color: #385a80;
height: 70px !important;
max-height: 100px;
width: 100%;
font-family: sans-serif;
color:white;
font-size: calc(2vw + 8px) !important;
font-weight: 600;
}

View File

@ -1,12 +0,0 @@
import './Footer.css';
// Компонент - подвал
function Footer() {
return (
<footer className="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
Сайт Чернышева Георгия, ПИбд-22{}
</footer>
);
}
export default Footer;

View File

@ -1,23 +0,0 @@
import PropTypes from 'prop-types';
import { Form } from 'react-bootstrap';
const Input = ({
name, label, value, onChange, className, ...rest
}) => {
return (
<Form.Group className={`mb-2 ${className || ''}`} controlId={name}>
<Form.Label>{label}</Form.Label>
<Form.Control name={name || ''} value={value || ''} onChange={onChange} {...rest} />
</Form.Group>
);
};
Input.propTypes = {
name: PropTypes.string,
label: PropTypes.string,
value: PropTypes.string,
onChange: PropTypes.func,
className: PropTypes.string,
};
export default Input;

View File

@ -1,29 +0,0 @@
import PropTypes from 'prop-types';
import { Form } from 'react-bootstrap';
const Select = ({
values, name, label, value, onChange, className, ...rest
}) => {
return (
<Form.Group className={`mb-2 ${className || ''}`} controlId={name}>
<Form.Label className='form-label'>{label}</Form.Label>
<Form.Select name={name || ''} value={value || ''} onChange={onChange} {...rest}>
<option value=''>Выберите значение</option>
{
values.map((type) => <option key={type.id} value={type.id}>{type.name}</option>)
}
</Form.Select>
</Form.Group>
);
};
Select.propTypes = {
values: PropTypes.array,
name: PropTypes.string,
label: PropTypes.string,
value: PropTypes.string,
onChange: PropTypes.func,
className: PropTypes.string,
};
export default Select;

View File

@ -1,48 +0,0 @@
import PropTypes from 'prop-types';
import { Button, Form } from 'react-bootstrap';
import { useNavigate } from 'react-router-dom';
import useLinesItemForm from '../hooks/LinesItemFormHook';
import LinesItemForm from './LinesItemForm.jsx';
const LinesForm = ({ id }) => {
const navigate = useNavigate();
const {
item,
validated,
handleSubmit,
handleChange,
} = useLinesItemForm(id);
const onBack = () => {
navigate(-1);
};
const onSubmit = async (event) => {
if (await handleSubmit(event)) {
onBack();
}
};
return (
<>
<Form className='m-0 p-2' noValidate validated={validated} onSubmit={onSubmit}>
<LinesItemForm item={item} handleChange={handleChange} />
<Form.Group className='row justify-content-center m-0 mt-3'>
<Button className='col-5 col-lg-2 m-0 me-2' variant='secondary' onClick={() => onBack()}>
Назад
</Button>
<Button className='col-5 col-lg-2 m-0 ms-2' type='submit' variant='primary'>
Сохранить
</Button>
</Form.Group>
</Form>
</>
);
};
LinesForm.propTypes = {
id: PropTypes.string,
};
export default LinesForm;

View File

@ -1,4 +0,0 @@
#image-preview {
width: 350px;
height: 200px;
}

View File

@ -1,35 +0,0 @@
import PropTypes from 'prop-types';
import imgPlaceholder from '../../../../placeholder.jpg';
import Input from '../../input/Input.jsx';
import Select from '../../input/Select.jsx';
import useTypes from '../../types/hooks/TypesHook';
import './LinesItemForm.css';
// МБ ТУТ ВМЕСТО item что-то другое
const LinesItemForm = ({ item, handleChange }) => {
const { types } = useTypes();
// ТУТ МЕНЯТЬ
return (
<>
<div className='text-center'>
<img id='image-preview' className='rounded' alt='placeholder'
src={item.image || imgPlaceholder} />
</div>
<Select values={types} name='typeId' label='Товары' value={item.typeId} onChange={handleChange}
required />
<Input name='price' label='Цена' value={item.price} onChange={handleChange}
type='number' min='1000.0' step='0.50' required />
<Input name='count' label='Количество' value={item.count} onChange={handleChange}
type='number' min='1' step='1' required />
<Input name='image' label='Изображение' onChange={handleChange}
type='file' accept='image/*' />
</>
);
};
LinesItemForm.propTypes = {
item: PropTypes.object,
handleChange: PropTypes.func,
};
export default LinesItemForm;

View File

@ -1,28 +0,0 @@
import { useSearchParams } from 'react-router-dom';
import useTypes from '../../types/hooks/TypesHook';
const useTypeFilter = () => {
const filterName = 'type';
const [searchParams, setSearchParams] = useSearchParams();
const { types } = useTypes();
const handleFilterChange = (event) => {
const type = event.target.value;
if (type) {
searchParams.set(filterName, event.target.value);
} else {
searchParams.delete(filterName);
}
setSearchParams(searchParams);
};
return {
types,
currentFilter: searchParams.get(filterName) || '',
handleFilterChange,
};
};
export default useTypeFilter;

View File

@ -1,29 +0,0 @@
import { useEffect, useState } from 'react';
import LinesApiService from '../service/LinesApiService';
const useLines = (typeFilter) => {
const [linesRefresh, setLinesRefresh] = useState(false);
const [lines, setLines] = useState([]);
const handleLinesChange = () => setLinesRefresh(!linesRefresh);
const getLines = async () => {
let expand = '?_expand=type';
if (typeFilter) {
expand = `${expand}&typeId=${typeFilter}`;
}
const data = await LinesApiService.getAll(expand);
setLines(data ?? []);
};
useEffect(() => {
getLines();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [linesRefresh, typeFilter]);
return {
lines,
handleLinesChange,
};
};
export default useLines;

View File

@ -1,81 +0,0 @@
import { useState } from 'react';
import toast from 'react-hot-toast';
import getBase64FromFile from '../../utils/Base64';
import LinesApiService from '../service/LinesApiService';
import useLinesItem from './LinesItemHook';
const useLinesItemForm = (id, linesChangeHandle) => {
const { item, setItem } = useLinesItem(id);
const [validated, setValidated] = useState(false);
const resetValidity = () => {
setValidated(false);
};
const getLineObject = (formData) => {
const typeId = parseInt(formData.typeId, 10);
const price = parseFloat(formData.price).toFixed(2);
const count = parseInt(formData.count, 10);
const sum = parseFloat(price * count).toFixed(2);
const image = formData.image.startsWith('data:image') ? formData.image : '';
return {
typeId: typeId.toString(),
price: price.toString(),
count: count.toString(),
sum: sum.toString(),
image,
};
};
const handleImageChange = async (event) => {
const { files } = event.target;
const file = await getBase64FromFile(files.item(0));
setItem({
...item,
image: file,
});
};
const handleChange = (event) => {
if (event.target.type === 'file') {
handleImageChange(event);
return;
}
const inputName = event.target.name;
const inputValue = event.target.type === 'checkbox' ? event.target.checked : event.target.value;
setItem({
...item,
[inputName]: inputValue,
});
};
const handleSubmit = async (event) => {
const form = event.currentTarget;
event.preventDefault();
event.stopPropagation();
const body = getLineObject(item);
if (form.checkValidity()) {
if (id === undefined) {
await LinesApiService.create(body);
} else {
await LinesApiService.update(id, body);
}
if (linesChangeHandle) linesChangeHandle();
toast.success('Элемент успешно сохранен', { id: 'LinesTable' });
return true;
}
setValidated(true);
return false;
};
return {
item,
validated,
handleSubmit,
handleChange,
resetValidity,
};
};
export default useLinesItemForm;

View File

@ -1,34 +0,0 @@
import { useEffect, useState } from 'react';
import LinesApiService from '../service/LinesApiService';
const useLinesItem = (id) => {
const emptyItem = {
id: '',
typeId: '',
price: '0',
count: '0',
image: '',
};
const [item, setItem] = useState({ ...emptyItem });
const getItem = async (itemId = undefined) => {
if (itemId && itemId > 0) {
const data = await LinesApiService.get(itemId);
setItem(data);
} else {
setItem({ ...emptyItem });
}
};
useEffect(() => {
getItem(id);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [id]);
return {
item,
setItem,
};
};
export default useLinesItem;

View File

@ -1,5 +0,0 @@
import ApiService from '../../api/ApiService';
const LinesApiService = new ApiService('lines');
export default LinesApiService;

View File

@ -1,77 +0,0 @@
import { Button, ButtonGroup } from 'react-bootstrap';
import { Link, useNavigate } from 'react-router-dom';
import Select from '../../input/Select.jsx';
import ModalConfirm from '../../modal/ModalConfirm.jsx';
import ModalForm from '../../modal/ModalForm.jsx';
import LinesItemForm from '../form/LinesItemForm.jsx';
import useLinesDeleteModal from '../hooks/LinesDeleteModalHook';
import useTypeFilter from '../hooks/LinesFilterHook';
import useLinesFormModal from '../hooks/LinesFormModalHook';
import useLines from '../hooks/LinesHook';
import LinesTable from './LinesTable.jsx';
import LinesTableRow from './LinesTableRow.jsx';
const Lines = () => {
const { types, currentFilter, handleFilterChange } = useTypeFilter();
const { lines, handleLinesChange } = useLines(currentFilter);
const {
isDeleteModalShow,
showDeleteModal,
handleDeleteConfirm,
handleDeleteCancel,
} = useLinesDeleteModal(handleLinesChange);
const {
isFormModalShow,
isFormValidated,
showFormModal,
currentItem,
handleItemChange,
handleFormSubmit,
handleFormClose,
} = useLinesFormModal(handleLinesChange);
const navigate = useNavigate();
const showEditPage = (id) => {
navigate(`/page-edit/${id}`);
};
return (
<>
<ButtonGroup>
<Button variant='info' onClick={() => showFormModal()}>
Добавить товар (диалог)
</Button>
<Button as={Link} to='/page-edit' variant='success'>
Добавить товар (страница)
</Button>
</ButtonGroup>
<Select className='mt-2' values={types} label='Фильтр по товарам'
value={currentFilter} onChange={handleFilterChange} />
<LinesTable>
{
lines.map((line, index) =>
<LinesTableRow key={line.id}
index={index} line={line}
onDelete={() => showDeleteModal(line.id)}
onEdit={() => showFormModal(line.id)}
onEditInPage={() => showEditPage(line.id)}
/>)
}
</LinesTable>
<ModalConfirm show={isDeleteModalShow}
onConfirm={handleDeleteConfirm} onClose={handleDeleteCancel}
title='Удаление' message='Удалить элемент?' />
<ModalForm show={isFormModalShow} validated={isFormValidated}
onSubmit={handleFormSubmit} onClose={handleFormClose}
title='Редактирование'>
<LinesItemForm item={currentItem} handleChange={handleItemChange} />
</ModalForm>
</>
);
};
export default Lines;

View File

@ -1,30 +0,0 @@
import PropTypes from 'prop-types';
import { Table } from 'react-bootstrap';
const LinesTable = ({ children }) => {
return (
<Table className='mt-2' striped responsive>
<thead>
<tr>
<th scope='col'></th>
<th scope='col' className='w-25'>Товар</th>
<th scope='col' className='w-25'>Цена</th>
<th scope='col' className='w-25'>Колич.</th>
<th scope='col' className='w-25'>Сумма</th>
<th scope='col'></th>
<th scope='col'></th>
<th scope='col'></th>
</tr>
</thead>
<tbody>
{children}
</tbody >
</Table >
);
};
LinesTable.propTypes = {
children: PropTypes.node,
};
export default LinesTable;

View File

@ -1,34 +0,0 @@
import PropTypes from 'prop-types';
import { PencilFill, PencilSquare, Trash3 } from 'react-bootstrap-icons';
const LinesTableRow = ({
index, line, onDelete, onEdit, onEditInPage,
}) => {
const handleAnchorClick = (event, action) => {
event.preventDefault();
action();
};
return (
<tr>
<th scope="row">{index + 1}</th>
<td>{line.type.name}</td>
<td>{parseFloat(line.price).toFixed(2)}</td>
<td>{line.count}</td>
<td>{parseFloat(line.sum).toFixed(2)}</td>
<td><a href="#" onClick={(event) => handleAnchorClick(event, onEdit)}><PencilFill /></a></td>
<td><a href="#" onClick={(event) => handleAnchorClick(event, onEditInPage)}><PencilSquare /></a></td>
<td><a href="#" onClick={(event) => handleAnchorClick(event, onDelete)}><Trash3 /></a></td>
</tr>
);
};
LinesTableRow.propTypes = {
index: PropTypes.number,
line: PropTypes.object,
onDelete: PropTypes.func,
onEdit: PropTypes.func,
onEditInPage: PropTypes.func,
};
export default LinesTableRow;

View File

@ -1,30 +0,0 @@
/* .my-navbar {
background-color: #3c3c3c !important;
}
.my-navbar .link a:hover {
text-decoration: underline !important;
}
.my-navbar .logo {
width: 26px;
height: 26px;
} */
/* НАДО БУДЕТ ПОМЕНЯТЬ НА НАЗВАНИЕ КЛАССА, НАВЕРНОЕ */
.my-navbar {
font-family: sans-serif;
background-color:#385a80 !important;
min-height: 100px;
}
.my-navbar-main-link {
font-weight: 600;
font-size: calc(18px + 2vw) !important;
}
.my-navbar-links {
font-family: sans-serif;
color: white;
font-size: calc(12px + 2vw);
font-weight: 600;
}

View File

@ -1,30 +0,0 @@
import PropTypes from 'prop-types';
import { Container, Nav, Navbar } from 'react-bootstrap';
import { Link } from 'react-router-dom';
import './Navigation.css';
function Navigation() {
return (
<header>
<Navbar bg="dark" expand="md" variant="dark" className = "my-navbar">
<Container fluid>
<Navbar.Brand as = {Link} to ="/" className = "active my-navbar-main-link" >Главная</Navbar.Brand>
<Navbar.Toggle aria-controls="basic-navbar-nav" />
<Navbar.Collapse id="basic-navbar-nav">
<Nav className="ms-auto">
<Nav.Link as = {Link} to = "/basket" className = "my-navbar-links">Корзина</Nav.Link>
<Nav.Link as = {Link} to = "/library" className = "my-navbar-links">Библиотека</Nav.Link>
<Nav.Link as = {Link} to = "/entry" className = "my-navbar-links">Вход</Nav.Link>
</Nav>
</Navbar.Collapse>
</Container>
</Navbar>
</header>
);
}
Navigation.propTypes = {
routes: PropTypes.array,
};
export default Navigation;

View File

@ -1,21 +0,0 @@
import { useEffect, useState } from 'react';
import TypesApiService from '../service/TypesApiService';
const useTypes = () => {
const [types, setTypes] = useState([]);
const getTypes = async () => {
const data = await TypesApiService.getAll();
setTypes(data ?? []);
};
useEffect(() => {
getTypes();
}, []);
return {
types,
};
};
export default useTypes;

View File

@ -1,5 +0,0 @@
import ApiService from '../../api/ApiService';
const TypesApiService = new ApiService('types');
export default TypesApiService;

View File

@ -1,15 +0,0 @@
const getBase64FromFile = async (file) => {
const reader = new FileReader();
return new Promise((resolve, reject) => {
reader.onloadend = () => {
const fileContent = reader.result;
resolve(fileContent);
};
reader.onerror = () => {
reject(new Error('Oops, something went wrong with the file reader.'));
};
reader.readAsDataURL(file);
});
};
export default getBase64FromFile;

View File

@ -1,4 +0,0 @@
body {
background-color: #2e4150;
margin-bottom: 70px;
}

View File

@ -1,66 +0,0 @@
import 'bootstrap/dist/css/bootstrap.min.css';
import React from 'react';
import ReactDOM from 'react-dom/client';
import { RouterProvider, createBrowserRouter } from 'react-router-dom';
import App from './App.jsx';
import './index.css';
import ErrorPage from './pages/ErrorPage.jsx';
import MainPage from './pages/MainPage.jsx';
import BasketPage from './pages/BasketPage.jsx';
import LibraryPage from './pages/LibraryPage.jsx';
import EntryPage from './pages/EntryPage.jsx';
import AdminPage from './pages/AdminPage.jsx';
import InfoGamePage from './pages/InfoGamePage.jsx';
import RegistryPage from './pages/RegistryPage.jsx';
// МАРШРУТИЗАЦИЯ
const routes = [
{
index: true,
path: '/',
element: <MainPage />,
title: 'Главная страница',
},
{
path: '/basket',
element: <BasketPage />,
title: 'Корзина',
},
{
path: '/library',
element: <LibraryPage />,
title: 'Библиотека',
},
{
path: '/entry',
element: <EntryPage />,
title: 'Вход',
},
{
path: '/registry',
element: <RegistryPage />,
},
{
path: '/admin',
element: <AdminPage />,
},
{
path: '/info',
element: <InfoGamePage />,
},
];
const router = createBrowserRouter([
{
path: '/',
element: <App routes={routes} />,
children: routes,
errorElement: <ErrorPage />,
},
]);
ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<RouterProvider router={router} />
</React.StrictMode>,
);

View File

@ -1,45 +0,0 @@
@media (min-width: 600px) {
.admin_panel {
margin-left: 20%;
margin-right: 20%;
}
}
@media (max-width: 600px) {
.admin_panel {
margin-left: 5%;
margin-right: 5%;
}
}
.span_admin_panel {
background-color: #385a80 !important;
color: white !important;
font-weight: bold;
}
@media (min-width: 600px) {
.span_admin_panel {
font-size: 1.5vw;
}
}
@media (max-width: 600px) {
.span_admin_panel {
font-size: 3vw;
}
}
.btn_admin_panel {
border: none;
background-color: #385a80 !important;
color: white;
font-size: calc(1.5vh + 1.5vw) !important;
border-radius: 3px;
font-weight: 700;
}
#image-preview {
width: 350px;
height: 200px;
}

View File

@ -1,59 +0,0 @@
import { useState } from 'react';
import { Button, Form } from 'react-bootstrap';
import './AdminPage.css';
function AdminPage() {
const [validated, setValidated] = useState(false);
const handleSubmit = (event) => {
const form = event.currentTarget;
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
setValidated(true);
};
return (
<>
<div className = "text-center">
<img id="image-preview" src="placeholder.jpg" alt="placeholder"/>
</div>
<Form id="games-form" className = "admin_panel mt-4 needs-validation" noValidate validated={validated} onSubmit={handleSubmit}>
<Form.Group className = "input-group mb-4">
<span className ="input-group-text span_admin_panel" id="basic-addon1">Жанр:</span>
<select id="genre" className ="form-select" name="selected" required>
<option disabled> Выберите жанр </option>
<option>FMV</option>
<option>Экшен</option>
<option>Квест</option>
<option>Стратегия</option>
<option>RPG</option>
</select>
</Form.Group>
<Form.Group className = "input-group mb-4">
<span className = "input-group-text span_admin_panel" id="basic-addon1">Название:</span>
<Form.Control id="name" type="text" className = "form-control" placeholder="Название" required/>
</Form.Group>
<Form.Group className = "input-group mb-4">
<span className = "input-group-text span_admin_panel" id="basic-addon1">Цена:</span>
<Form.Control id = "price" type="number" className = "form-control" placeholder="Цена" required/>
</Form.Group>
<Form.Group className = "input-group mb-4">
<span className = "input-group-text span_admin_panel" id="basic-addon1">Фото:</span>
<Form.Control id="image" name="image" type="file" className = "form-control" placeholder="Фото" accept="image/*"/>
</Form.Group>
<Form.Group className = "input-group mb-4">
<span className = "input-group-text span_admin_panel">Описание</span>
<textarea className ="form-control" aria-label="With textarea"></textarea>
</Form.Group>
<Form.Group className = "d-flex justify-content-center">
<Button className = "btn_admin_panel" type="submit"> Подтвердить </Button>
</Form.Group>
</Form>
</>
);
}
export default AdminPage;

View File

@ -1,42 +0,0 @@
.basket_name_of_game {
color: white;
font-family: sans-serif;
font-size: 3vw;
font-size: auto;
margin: 0;
}
.basket_price_of_games{
color: white;
font-size: 3vw;
margin-bottom: auto;
font-weight: 600;
}
.basket_delete_button {
font-family: sans-serif;
border: none !important;
background: none !important;
color: white !important;
font-size: 3vw !important;
}
.basket_buy_button {
background-color: #385a80;
color: white;
font-family: sans-serif;
font-size: 3vw;
border: none;
border-radius: 3px;
}
.cell1_basket {
width: 20% !important;
}
.cell2_basket {
width: 50% !important;
vertical-align: middle;
text-align: center;
}
.cell3_basket {
width: 20% !important;
}
tfoot {
border-color: #2e4150;
}

View File

@ -1,55 +0,0 @@
import './BasketPage.css';
function BasketPage() {
return (
<>
<table className = "table table-bordered align-middle">
<tbody>
<tr>
<td className = "p-0 cell1_basket">
<img src="Dark Nights preview.jpg" alt="Dark Nights with Poe & Munro" className = "img-fluid"/>
</td>
<td className = "p-0 cell2_basket">
<p className = "basket_name_of_game">Dark Nights with Poe and Munro</p>
</td>
<td className = "p-0 text-center align-middle cell3_basket">
<p className = "price_of_game_main_page"> 299 руб.</p>
</td>
<td className = "p-0 text-center align-middle">
<button className = "basket_delete_button"> X </button>
</td>
</tr>
<tr>
<td className = "p-0 cell1_basket">
<img src="Ten Dates preview.jpg" alt="Ten Dates" className = "img-fluid"/>
</td>
<td className = "p-0 text-center align-middle cell2_basket">
<p className = "basket_name_of_game">Ten Dates</p>
</td>
<td className = "p-0 text-center align-middle cell3_basket">
<p className = "price_of_game_main_page"> 509 руб.</p>
</td>
<td className = "p-0 text-center align-middle">
<button className = "basket_delete_button"> X </button>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colSpan="2" className = "align-left">
<p className = "basket_price_of_games"> Итого: 808 руб.</p>
</td>
<td colSpan="2" className = "text-end">
<button className = "basket_buy_button">КУПИТЬ</button>
</td>
</tr>
</tfoot>
</table>
</>
);
}
export default BasketPage;

View File

@ -1,55 +0,0 @@
.account_text {
font-family: sans-serif;
color: white;
font-size: calc(2.5vw + 1.5vh);
font-weight: 600;
text-decoration: none;
}
.account_btn {
background-color:#385a80;
color: white;
font-family: sans-serif;
font-size: calc(2.5vw + 1.5vh);
border: none;
border-radius: 3px;
font-weight: 500;
}
.account_form {
position: fixed;
/* top: 30%;
left: 30%; */
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.account_input {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
}
.account_col {
height: 100%;
}
.account_ref {
color: white;
font-size: calc(1.5vw + 1.5vh);
text-decoration: none;
position: fixed;
bottom: 75px;
left: 50%;
transform: translateX(-50%);
font-weight: 600;
}
.account_ref_div {
/* position: fixed; */
text-align: center;
/* bottom: 70px; */
}

View File

@ -1,105 +0,0 @@
import { Form, Row, Col } from 'react-bootstrap';
import { Link } from 'react-router-dom';
import './EntryPage.css';
function EntryPage() {
return (
<>
<Form className = "account_form">
<Row className='align-items-center justify-content-center'>
<Col xs = "auto" className='account_col'>
<label className = 'account_text'>Введите ник:</label>
</Col>
<Col xs = "auto" className='account_col'>
<Form.Control type="text"/>
</Col>
</Row>
<Row className='align-items-center justify-content-center'>
<Col xs = "auto" className='account_col'>
<Form.Label className = 'account_text'>Введите пароль:</Form.Label>
</Col>
<Col xs = "auto" className='account_col'>
<Form.Control
type="password"
/>
</Col>
</Row>
<Row className='justify-content-center'>
<Col xs="auto">
<button type="submit" className = 'account_btn'>Войти</button>
</Col>
</Row>
</Form>
<div className = 'account_ref_div'>
<Link className = "account_ref" to = "/registry">СОЗДАТЬ АККАУНТ</Link>
</div>
</>
);
}
export default EntryPage;
// class EntryPage extends React.Component {
// constructor(props) {
// super(props);
// this.state = {
// username: '',
// password: ''
// };
// }
// validateForm() {
// return this.state.username.length > 0 && this.state.password.length > 0;
// }
// handleChange = (event) => {
// this.setState({
// [event.target.id]: event.target.value
// });
// }
// handleSubmit = (event) => {
// event.preventDefault();
// }
// render() {
// return (
// <div className="Login">
// <Form onSubmit={this.handleSubmit}>
// <Form.Group controlId="username">
// <Form.Label>Логин</Form.Label>
// <Form.Control
// autoFocus
// type="text"
// value={this.state.username}
// onChange={this.handleChange}
// />
// </Form.Group>
// <Form.Group controlId="password">
// <Form.Label>Пароль</Form.Label>
// <Form.Control
// value={this.state.password}
// onChange={this.handleChange}
// type="password"
// />
// </Form.Group>
// <Button
// block
// disabled={!this.validateForm()}
// type="submit"
// >
// Войти
// </Button>
// </Form>
// </div>
// );
// }
// }

View File

@ -1,19 +0,0 @@
import { Alert, Button, Container } from 'react-bootstrap';
import { useNavigate } from 'react-router-dom';
const ErrorPage = () => {
const navigate = useNavigate();
return (
<Container fluid className="p-2 row justify-content-center">
<Container className='col-md-6'>
<Alert variant="danger">
Страница не найдена
</Alert>
<Button className="w-25 mt-2" variant="primary" onClick={() => navigate(-1)}>Назад</Button>
</Container>
</Container>
);
};
export default ErrorPage;

View File

@ -1,32 +0,0 @@
.info_about_game_pic_and_name {
display: flex;
align-items: center;
height: 40% !important;
}
.info_about_game_name {
color: white;
font-weight: 700;
align-items: center !important;
font-size: calc(3vw + 2vh) !important;
}
.info_about_game_text {
color: white;
align-items: center !important;
font-size: calc(2vw + 2vh) !important;
}
.info_about_game_add_to_basket_button {
background-color: #385a80;
color: white;
font-family: sans-serif;
font-size: calc(2.5vw + 1.5vh);
border: none;
border-radius: 3px;
}
.info_about_game_div_button {
border: 1px white;
align-items: center !important;
}

View File

@ -1,28 +0,0 @@
import './InfoGamePage.css';
function InfoGamePage() {
return (
<>
<div className = "row info_about_game_pic_and_name">
<div className = "col-sm-5">
<img src="Dark Nights preview.jpg" alt="Dark Nights with Poe & Munro" className="img-fluid"/>
</div>
<div className = "col-sm-7 text-center align-items-center">
<p className = "info_about_game_name">Dark Nights with Poe and Munro</p>
</div>
</div>
<div className = "row">
<div className = "col-sm 12">
<p className = "info_about_game_text">Проведите местных радиоведущих По и Манро через шесть похожих на короткометражки эпизодов сверъестественной странности и обжигающего сюжета. От создателей The Infectious Madness of Doctor Dekker и The Shapeshifting Detective.</p>
</div>
<div className = "info_about_game_div_button text-center align-items-center">
<button className = "info_about_game_add_to_basket_button"> Добавить в корзину </button>
</div>
</div>
</>
);
}
export default InfoGamePage;

View File

@ -1,33 +0,0 @@
.library_name_of_game {
color: white;
font-size: calc(3vw + 0.5vh);
font-weight: 600;
margin-left: 0.5vw;
}
.table_of_library {
border-collapse: separate;
border-spacing: 0 0.5vw;
}
.cell1_library {
width: 20%;
}
.cell2_library {
width: 60%;
}
select {
background-color: #385a80;
color: white;
font-weight: bold;
font-size: 2.5vw;
border: none;
border-radius: 2px;
text-align: center;
}
select option {
background-color: #385a80;
color: white;
font-weight: bold;
font-size: auto;
border-radius: 2px;
width: 100%;
}

View File

@ -1,82 +0,0 @@
import './LibraryPage.css';
function LibraryPage() {
return (
<table className="table table-borderless table_of_library">
<tbody>
<tr>
<td className = "align-middle p-0 cell1_library">
<img src="Dark Nights preview.jpg" alt="Dark Nights with Poe & Munro" className="img-fluid"/>
</td>
<td className = "align-middle p-0 cell2_library">
<a className = "nav-link library_name_of_game" href="./dark_nights_page.html">Dark Nights with Poe and Munro</a>
</td>
<td className = "align-middle text-center p-0">
<select defaultValue="ИГРА">
<option disabled >ИГРА</option>
<option>Играть</option>
<option>Установить</option>
<option>Удалить</option>
</select>
</td>
</tr>
<tr>
<td className = "align-middle p-0 cell1_library" >
<img src="Song of Farca preview.jpg" alt="Song of Farca" className="img-fluid"/>
</td>
<td className = "align-middle p-0 cell2_library" >
<a className = "nav-link library_name_of_game" href="./dark_nights_page.html">Song of Farca</a>
</td>
<td className = "align-middle text-center p-0">
<select defaultValue="ИГРА">
<option disabled >ИГРА</option>
<option>Играть</option>
<option>Установить</option>
<option>Удалить</option>
</select>
</td>
</tr>
<tr>
<td className = "align-middle p-0 cell1_library">
<img src="Papers, Please preview.jpg" alt="Papers, Please" className="img-fluid"/>
</td>
<td className = "align-middle p-0 cell2_library">
<a className = "nav-link library_name_of_game" href="./dark_nights_page.html"> Papers, Please </a>
</td>
<td className = "align-middle text-center p-0">
<select defaultValue="ИГРА">
<option disabled >ИГРА</option>
<option>Играть</option>
<option>Установить</option>
<option>Удалить</option>
</select>
</td>
</tr>
<tr>
<td className = "align-middle p-0 cell1_library">
<img src="Ten Dates preview.jpg" alt="Ten Dates" className="img-fluid"/>
</td>
<td className = "align-middle p-0 cell2_library">
<a className = "nav-link library_name_of_game" href="./dark_nights_page.html">Ten Dates</a>
</td>
<td className = "align-middle text-center p-0">
<select defaultValue="ИГРА">
<option disabled >ИГРА</option>
<option>Играть</option>
<option>Установить</option>
<option>Удалить</option>
</select>
</td>
</tr>
</tbody>
</table>
);
}
export default LibraryPage;

View File

@ -1,78 +0,0 @@
.button_search {
background-color: #385a80 !important;
color: white !important;
font-weight: bold;
border: none;
}
.button_add_game {
background-color: #385a80 !important;
color: white !important;
font-weight: bold !important;
border: none !important;
border-radius: 3px;
}
.table_of_main_page {
border-collapse: separate;
}
@media (max-width: 420px) {
.table_of_main_page {
border-spacing: 0 0;
}
}
@media (min-width: 420px) {
.table_of_main_page {
border-spacing: 0 0.5vw;
}
}
.cell1_main_page {
width: 20% !important;
}
.cell2_main_page {
width: 55% !important;
}
.name_of_game_main_page {
color: white;
font-size: 3vw !important;
margin-left: 1vw !important;
}
.price_of_game_main_page {
color: white;
font-size: 2.7vw !important;
margin-left: 1vw !important;
font-weight: 600 !important;
margin-bottom: 0;
margin-top: -3px;
}
.genre_of_game_main_page {
color: white;
font-size: 1.5vw !important;
margin-left: 0 !important;
font-style: italic;
}
.btn_for_game_main_page {
border: none;
/* size: 0.5rem; */
background-color: #385a80 !important;
color: white;
font-size: calc(1vh + 0.5vw) !important;
margin-right: 0.3rem;
border-radius: 3px;
}
@media (min-width: 600px) {
.btn_for_game_main_page {
margin-bottom: 10%;
}
}
@media (max-width: 600px) {
.btn_for_game_main_page {
margin-bottom: 0;
}
}

View File

@ -1,96 +0,0 @@
import { FormControl, InputGroup, Button } from 'react-bootstrap';
import { Link } from 'react-router-dom';
import './MainPage.css';
function MainPage() {
return (
<>
<InputGroup>
<FormControl placeholder = "Название игры" aria-label = "Recipient's username" aria-describedby = "button_search"/>
<Button variant = "primary" id = "button_search" className = "button_search"> Поиск </Button>
</InputGroup>
<div className="d-flex flex-row-reverse">
<div className = "pt-2">
<Button className="pt-2 button_add_game" as={Link} to = "/admin"> + </Button>
</div>
</div>
<table id="games-table" className="table table-borderless table_of_main_page">
<tbody>
<tr>
<td className = "align-middle p-0 cell1_main_page">
<img src = "Dark Nights preview.jpg" alt = "Dark Nights with Poe & Munro" className = "img-fluid w-100 h-100"/>
</td>
<td className = "align-middle p-0 cell2_main_page">
<Link className = "nav-link active name_of_game_main_page" to = "./info">Dark Nights with Poe and Munro</Link>
<p className = "price_of_game_main_page"> 299 руб.</p>
</td>
<td className = "align-middle p-0">
<p className = "genre_of_game_main_page"> FMV </p>
</td>
<td className = "text-center align-middle p-0">
<Button className = "btn_for_game_main_page" as={Link} to = "/admin"> изменить </Button>
<Button className = "btn_for_game_main_page" as={Link} to = "/admin"> удалить </Button>
</td>
</tr>
<tr>
<td className = "align-middle p-0 cell1_main_page" >
<img src = "Late Shift preview.jpg" alt = "Late Shift" className = "img-fluid w-100 h-100"/>
</td>
<td className = "align-middle p-0 cell2_main_page" >
<Link className = "nav-link active name_of_game_main_page" to = "./info">Late Shift</Link>
<p className = "price_of_game_main_page"> 399 руб.</p>
</td>
<td className = "align-middle p-0">
<p className = "genre_of_game_main_page"> Экшен </p>
</td>
<td className = "text-center align-middle p-0">
<Button className = "btn_for_game_main_page" as={Link} to = "/admin"> изменить </Button>
<Button className = "btn_for_game_main_page" as={Link} to = "/admin"> удалить </Button>
</td>
</tr>
<tr>
<td className = "align-middle p-0 cell1_main_page">
<img src = "Ten Dates preview.jpg" alt="Ten Dates" className = "img-fluid w-100 h-100"/>
</td>
<td className = "align-middle p-0 cell2_main_page">
<Link className = "nav-link active name_of_game_main_page" to = "./info">Ten Dates</Link>
<p className = "price_of_game_main_page"> 590 руб.</p>
</td>
<td className = "align-middle p-0">
<p className = "genre_of_game_main_page"> FMV </p>
</td>
<td className = "text-center align-middle p-0">
<Button className = "btn_for_game_main_page" as={Link} to = "/admin"> изменить </Button>
<Button className = "btn_for_game_main_page" as={Link} to = "/admin"> удалить </Button>
</td>
</tr>
<tr>
<td className = "align-middle p-0 cell1_main_page">
<img src = "Ten Dates preview.jpg" alt="Ten Dates" className="img-fluid w-100 h-100"/>
</td>
<td className = "align-middle p-0 cell2_main_page">
<Link className = "nav-link active name_of_game_main_page" to = "./info">Ten Dates</Link>
<p className = "price_of_game_main_page"> 590 руб.</p>
</td>
<td className = "align-middle p-0">
<p className = "genre_of_game_main_page"> FMV </p>
</td>
<td className = "text-center align-middle p-0">
<Button className = "btn_for_game_main_page" as={Link} to = "/admin"> изменить </Button>
<Button className = "btn_for_game_main_page" as={Link} to = "/admin"> удалить </Button>
</td>
</tr>
</tbody>
</table>
</>
);
}
export default MainPage;

View File

@ -1,57 +0,0 @@
import { Form, Row, Col } from 'react-bootstrap';
import { Link } from 'react-router-dom';
import './EntryPage.css';
function RegistryPage() {
return (
<>
<Form className = "account_form">
<Row className='align-items-center justify-content-center'>
<Col xs = "auto" className='account_col'>
<label className = 'account_text'>Введите почту:</label>
</Col>
<Col xs = "auto" className='account_col'>
<Form.Control type="text"/>
</Col>
</Row>
<Row className='align-items-center justify-content-center'>
<Col xs = "auto" className='account_col'>
<Form.Label className = 'account_text'>Введите ник:</Form.Label>
</Col>
<Col xs = "auto" className='account_col'>
<Form.Control
type="password"
/>
</Col>
</Row>
<Row className='align-items-center justify-content-center'>
<Col xs = "auto" className='account_col'>
<Form.Label className = 'account_text'>Введите пароль:</Form.Label>
</Col>
<Col xs = "auto" className='account_col'>
<Form.Control
type="password"
/>
</Col>
</Row>
<Row className='justify-content-center'>
<Col xs="auto">
<button type="submit" className = 'account_btn'>Создать</button>
</Col>
</Row>
</Form>
<div className='account_ref_div'>
<Link className = "account_ref" to = "/entry">ВОЙТИ В АККАУНТ</Link>
</div>
</>
);
}
export default RegistryPage;

View File

@ -1,323 +0,0 @@
html {
position: relative;
min-height: 100%;
}
body {
background-color: #2e4150;
margin-bottom: 70px; /*Равно высоте подвала*/
}
main {
height: 100% !important;
}
select {
background-color: #385a80;
color: white;
font-weight: bold;
font-size: 2.5vw;
border: none;
border-radius: 2px;
text-align: center;
}
select option {
background-color: #385a80;
color: white;
font-weight: bold;
font-size: auto;
border-radius: 2px;
width: 100%;
}
nav {
font-family: sans-serif;
background-color:#385a80 !important;
min-height: 100px;
}
footer {
position: fixed;
left: 0;
bottom: 0;
background-color: #385a80;
height: 70px;
max-height: 100px;
width: 100%;
font-family: sans-serif;
color:white;
font-size: calc(2vw + 8px) !important;
font-weight: 600;
}
.navbar > div > a {
font-size: calc(18px + 2vw) !important;
}
.navbar-nav > a {
font-family: sans-serif;
color: white;
font-size: calc(12px + 2vw);
font-weight: 600;
}
.container-fluid > a {
font-family: sans-serif;
color: white;
font-size: 32px;
font-weight: 600;
}
/* ГЛАВНАЯ СТРАНИЦА */
.btn_for_game_main_page {
border: none;
/* size: 0.5rem; */
background-color: #385a80 !important;
color: white;
font-size: calc(1vh + 0.5vw) !important;
margin-right: 0.3rem;
border-radius: 3px;
}
@media (min-width: 600px) {
.btn_for_game_main_page {
margin-bottom: 10%;
}
}
@media (max-width: 600px) {
.btn_for_game_main_page {
margin-bottom: 0;
}
}
.name_of_game_main_page {
color: white;
font-size: 3vw !important;
margin-left: 1vw !important;
}
.price_of_game_main_page {
color: white;
font-size: 2.7vw !important;
margin-left: 1vw !important;
font-weight: 600 !important;
margin-bottom: 0;
margin-top: -3px;
}
/* .img-fluid {
max-height: 100%;
} */
.genre_of_game_main_page {
color: white;
font-size: 1.5vw !important;
margin-left: 0 !important;
font-style: italic;
}
.table_of_main_page {
border-collapse: separate;
}
@media (max-width: 420px) {
.table_of_main_page {
border-spacing: 0 0;
}
}
@media (min-width: 420px) {
.table_of_main_page {
border-spacing: 0 0.5vw;
}
}
.cell1_main_page {
width: 20% !important;
}
.cell2_main_page {
width: 55% !important;
}
main > .container-fluid {
display: flex;
flex-direction: column;
}
.btn_searching {
background-color: #385a80 !important;
color: white !important;
font-weight: bold;
}
.searching_input {
size: 2vw !important;
}
.btn_adding_game {
background-color: #385a80 !important;
color: white !important;
font-weight: bold !important;
border: none !important;
border-radius: 3px;
}
/* СТРАНИЦА С ОПИСАНИЕМ ИГРЫ */
.info_about_game_pic_and_name {
display: flex;
align-items: center;
height: 40% !important;
}
.info_about_game_name {
color: white;
font-weight: 700;
align-items: center !important;
font-size: calc(3vw + 2vh) !important;
}
.info_about_game_text {
color: white;
align-items: center !important;
font-size: calc(2vw + 2vh) !important;
}
.info_about_game_add_to_basket_button {
background-color: #385a80;
color: white;
font-family: sans-serif;
font-size: calc(2.5vw + 1.5vh);
border: none;
border-radius: 3px;
}
.info_about_game_div_button {
border: 1px white;
align-items: center !important;
}
/* СТРАНИЦЫ АККАУНТА */
.account_text {
font-family: sans-serif;
color: white;
font-size: calc(2.5vw + 1.5vh);
font-weight: 600;
text-decoration: none;
}
.account_btn {
background-color:#385a80;
color: white;
font-family: sans-serif;
font-size: calc(2.5vw + 1.5vh);
border: none;
border-radius: 3px;
font-weight: 500;
}
.mt-25vh {
margin-top: 25vh;
}
.mt-20vh {
margin-top: 20vh;
}
/* БИБЛИОТЕКА */
.library_name_of_game {
color: white;
font-size: calc(3vw + 0.5vh);
font-weight: 600;
margin-left: 0.5vw;
}
.table_of_library {
border-collapse: separate;
border-spacing: 0 0.5vw;
}
.cell1_library {
width: 20%;
}
.cell2_library {
width: 60%;
}
/* КОРЗИНА */
.basket_name_of_game {
color: white;
font-family: sans-serif;
font-size: 3vw;
font-size: auto;
margin: 0;
}
.basket_price_of_games{
color: white;
font-size: 3vw;
margin-bottom: auto;
font-weight: 600;
}
.basket_delete_button {
font-family: sans-serif;
border: none !important;
background: none !important;
color: white !important;
font-size: 3vw !important;
}
.basket_buy_button {
background-color: #385a80;
color: white;
font-family: sans-serif;
font-size: 3vw;
border: none;
border-radius: 3px;
}
.cell1_basket {
width: 20% !important;
}
.cell2_basket {
width: 50% !important;
vertical-align: middle;
text-align: center;
}
.cell3_basket {
width: 20% !important;
}
tfoot {
border-color: #2e4150;
}
/* СТРАНИЦА АДМИНА */
@media (min-width: 600px) {
.admin_panel {
margin-left: 20%;
margin-right: 20%;
}
}
@media (max-width: 600px) {
.admin_panel {
margin-left: 5%;
margin-right: 5%;
}
}
.span_admin_panel {
background-color: #385a80 !important;
color: white !important;
font-weight: bold;
}
@media (min-width: 600px) {
.span_admin_panel {
font-size: 1.5vw;
}
}
@media (max-width: 600px) {
.span_admin_panel {
font-size: 3vw;
}
}
.btn_admin_panel {
border: none;
background-color: #385a80 !important;
color: white;
font-size: calc(1.5vh + 1.5vw) !important;
border-radius: 3px;
font-weight: 700;
}
#image-preview {
width: 350px;
height: 200px;
}

View File

@ -1,13 +0,0 @@
/* eslint-disable import/no-extraneous-dependencies */
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
build: {
sourcemap: true,
chunkSizeWarningLimit: 1024,
emptyOutDir: true,
},
});

View File

@ -1,128 +0,0 @@
body{
background-color: #2e4150;
}
.card-title{
color: black;
text-decoration: none;
}
.textlinkBut{
color: white;
text-decoration: none;
}
.textlinkButMy{
color: white;
text-decoration: none;
}
.card{
width: 18rem;
/* margin:0 !important; */
padding:0 !important;
}
.btn1{
background-color: #0d6efd;
}
.btn11{
background-color: #0d6efd;
width: 30px;
}
.btn2{
color: red;
width: 30rem;
}
@media (max-width: 325px) {
.card{
width: 100%;
}
}
.button_search {
background-color: #385a80 !important;
color: white !important;
font-weight: bold;
border: none;
}
.button_add_game {
background-color: #385a80 !important;
color: white !important;
font-weight: bold !important;
border: none !important;
border-radius: 3px;
}
.table_of_main_page {
border-collapse: separate;
}
@media (max-width: 420px) {
.table_of_main_page {
border-spacing: 0 0;
}
}
@media (min-width: 420px) {
.table_of_main_page {
border-spacing: 0 0.5vw;
}
}
.cell1_main_page {
width: 20% !important;
}
.cell2_main_page {
width: 50% !important;
}
.cell3_main_page{
width: 80% !important;
}
.name_of_game_main_page {
color: white;
font-size: 3vw !important;
margin-left: 1vw !important;
}
.price_of_game_main_page {
color: white;
font-size: 0.7vw !important;
margin-left: 1vw !important;
font-weight: 600 !important;
margin-bottom: 0;
margin-top: -3px;
}
.genre_of_game_main_page {
color: white;
font-size: 1.8vw !important;
margin-left: 0 !important;
font-style: italic;
}
.btn_for_game_main_page {
border: none;
/* size: 0.5rem; */
background-color: #385a80 !important;
color: white;
font-size: calc(1vh + 0.5vw) !important;
margin-right: 0.3rem;
border-radius: 3px;
}
@media (min-width: 600px) {
.btn_for_game_main_page {
margin-bottom: 10%;
}
}
@media (max-width: 600px) {
.btn_for_game_main_page {
margin-bottom: 0;
}
}

View File

@ -1,67 +0,0 @@
import { Button } from 'react-bootstrap';
import { Link, useNavigate } from 'react-router-dom';
import Select from '../../input/Select.jsx';
import useTypeFilter from '../hooks/LinesFilterHook';
// import useTitlesFilter from '../hooks/LinesFilterTitlesHook';
import useLines from '../hooks/LinesHook';
import LinesTable from './LinesTable.jsx';
import LinesTableRow from './LinesTableRow.jsx';
import useCart from '../../cart/CartHook';
const Lines = () => {
const { types, currentFilter, handleFilterChange } = useTypeFilter();
const { lines } = useLines(currentFilter);
// const { lines1 } = useTitlesFilter(currentFilter) ? : null;
// const combinedLines = [...lines, ...lines1];
const { addToCart } = useCart();
const navigate = useNavigate();
const showEditPage = (id) => {
navigate(`/page-edit/${id}`);
};
const showInfoPage = (id) => {
navigate(`/info/${id}`);
};
// Результат получения данных о пользователе
const storedUserData = localStorage.getItem('user');
// Преобразованные данные
const storedUser = storedUserData ? JSON.parse(storedUserData) : {};
const userName = storedUser && storedUser.name ? storedUser.name : '';
const isAdmin = userName.toLowerCase() === 'admin';
return (
<>
{isAdmin ? (
<div className="d-flex flex-row-reverse">
<div className = "pt-2">
<Button className="pt-2 button_add_game" as={Link} to = "/page-edit"> + </Button>
</div>
</div>
) : (
<>
</>
)}
<Select className='mt-2' values={types} label='Фильтр по жанру'
value={currentFilter} onChange={handleFilterChange} />
<LinesTable>
{
lines.map((line, index) =>
<LinesTableRow key={line.id}
index={index} line={line}
onAddCart={() => addToCart(line)}
toInfoPage={() => showInfoPage(line.id)}
/>)
}
</LinesTable>
</>
);
};
export default Lines;

View File

@ -1,21 +0,0 @@
import PropTypes from 'prop-types';
import { Container } from 'react-bootstrap';
import './LineTableRow.css';
const LinesTable = ({ children }) => {
return (
<Container fluid className='p-0'>
<table id="games-table" className='table-borderless table_of_main_page'>
<tbody>
{children}
</tbody>
</table>
</Container>
);
};
LinesTable.propTypes = {
children: PropTypes.node,
};
export default LinesTable;

View File

@ -1,62 +0,0 @@
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import { Col } from 'react-bootstrap';
import { Cart } from 'react-bootstrap-icons';
import imgPlaceholder from '../../../assets/placeholder.jpg';
import './LineTableRow.css';
const LinesTableRow = ({ line, onAddCart, toInfoPage }) => {
const handleAnchorClick = (event, action) => {
event.preventDefault();
action();
};
const price = <p className='price_of_game_main_page'>{parseFloat(line.price).toFixed(0)} руб.</p>;
return (
<tr>
<td className = 'align-middle p-0 cell1_main_page'>
<img src={line.image || imgPlaceholder} className='img-fluid w-100 h-100' alt='image of game'></img>
</td>
<td className = 'align-middle p-0 cell2_main_page'>
<Link className = 'nav-link active name_of_game_main_page' onClick={(event) => handleAnchorClick(event, toInfoPage)}> {line.title} </Link>
{price}
</td>
<td className = 'align-middle p-0'>
<p className = 'genre_of_game_main_page ms-5 me-5'> {line.type.name} </p>
</td>
<td className='text-center align-middle p-0'>
<Col className='text-center mt-3'> <a href="#" onClick={(event) => handleAnchorClick(event, onAddCart)}><Cart /></a> </Col>
</td>
</tr>
);
// return (
// <tr className='w-100'>
// <td className = 'align-middle ms-5 cell1_main_page'>
// <img src={line.image} className='cell3_main_page' alt='image'></img>
// </td>
// <td className = 'align-middle ms-5 me-5 cell1_main_page'>
// <Link className = 'nav-link active name_of_game_main_page'> {line.title} </Link>
// {price};
// {/* <p className='price_of_game_main_page mt-4 ms-5 me-5'> {parseFloat(line.price).toFixed(0)} &#8381; </p> */}
// </td>
// <td className = 'align-middle ps-2 pe-5 text-center'>
// <p className = 'genre_of_game_main_page'> {line.type.name} </p>
// </td>
// <td className = 'align-middle ms-5 me-5 cell1_main_page'>
// <p className="card-text textlinkBut"> {(line.description)} </p>
// </td>
// <td className='cell1_main_page'>
// <Col className='text-center mt-3'> <a href="#" onClick={(event) => handleAnchorClick(event, onAddCart)}><Cart /></a> </Col>
// </td>
// </tr>
// );
};
LinesTableRow.propTypes = {
index: PropTypes.number,
line: PropTypes.object,
onAddCart: PropTypes.func,
toInfoPage: PropTypes.func,
};
export default LinesTableRow;

View File

@ -1,22 +0,0 @@
import { useEffect, useState } from 'react';
import TitlesApiService from '../service/TitlesApiService';
const useTitles = () => {
const [titles, setTitles] = useState([]);
const getTitles = async () => {
const response = await TitlesApiService.getAll();
const { titlesOfLines } = response.data.map((line) => line.title);
setTitles(titlesOfLines ?? []);
};
useEffect(() => {
getTitles();
}, []);
return {
titles,
};
};
export default useTitles;

View File

@ -1,5 +0,0 @@
import ApiService from '../../api/ApiService';
const TitlesApiService = new ApiService('lines');
export default TitlesApiService;