From 17c4c69ec24bd8742aecdde4f7a8c49041c720ba Mon Sep 17 00:00:00 2001 From: Andrei Duvakin Date: Sat, 8 Feb 2025 19:16:47 +0500 Subject: [PATCH] =?UTF-8?q?=D1=83=D0=B1=D1=80=D0=B0=D0=BB=20SCSS=20(=D0=BF?= =?UTF-8?q?=D0=BE=D0=BA=D0=B0=20=D1=80=D0=B0=D0=BD=D0=BE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web-app/package-lock.json | 68 +++++++++++++++++++++-- web-app/package.json | 3 +- web-app/src/layouts/MainLayout.jsx | 46 +++++++-------- web-app/src/pages/LoginPage.jsx | 44 ++++++++++----- web-app/src/styles/LoginPage.module.scss | 13 ----- web-app/src/styles/MainLayout.module.scss | 42 -------------- 6 files changed, 115 insertions(+), 101 deletions(-) delete mode 100644 web-app/src/styles/LoginPage.module.scss delete mode 100644 web-app/src/styles/MainLayout.module.scss diff --git a/web-app/package-lock.json b/web-app/package-lock.json index 51814b8..51033b0 100644 --- a/web-app/package-lock.json +++ b/web-app/package-lock.json @@ -16,8 +16,7 @@ "prop-types": "^15.8.1", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-router-dom": "^7.1.1", - "sass": "^1.84.0" + "react-router-dom": "^7.1.1" }, "devDependencies": { "@eslint/js": "^9.17.0", @@ -789,9 +788,11 @@ "version": "2.5.1", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.1.tgz", "integrity": "sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==", + "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "detect-libc": "^1.0.3", "is-glob": "^4.0.3", @@ -828,11 +829,13 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "android" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -848,11 +851,13 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "darwin" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -868,11 +873,13 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "darwin" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -888,11 +895,13 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "freebsd" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -908,11 +917,13 @@ "cpu": [ "arm" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -928,11 +939,13 @@ "cpu": [ "arm" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -948,11 +961,13 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -968,11 +983,13 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -988,11 +1005,13 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -1008,11 +1027,13 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -1028,11 +1049,13 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "win32" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -1048,11 +1071,13 @@ "cpu": [ "ia32" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "win32" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -1068,11 +1093,13 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "win32" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -2125,8 +2152,10 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "fill-range": "^7.1.1" }, @@ -2215,7 +2244,10 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "readdirp": "^4.0.1" }, @@ -2450,8 +2482,10 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "dev": true, "license": "Apache-2.0", "optional": true, + "peer": true, "bin": { "detect-libc": "bin/detect-libc.js" }, @@ -2960,8 +2994,10 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -3328,7 +3364,10 @@ "version": "5.0.3", "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.0.3.tgz", "integrity": "sha512-P8IdPQHq3lA1xVeBRi5VPqUm5HDgKnx0Ru51wZz5mjxHr5n3RWhjIpOFU7ybkUxfB+5IToy+OLaHYDBIWsv+uw==", - "license": "MIT" + "dev": true, + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/import-fresh": { "version": "3.3.0", @@ -3510,7 +3549,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -3555,7 +3594,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" @@ -3581,8 +3620,10 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, "license": "MIT", "optional": true, + "peer": true, "engines": { "node": ">=0.12.0" } @@ -3919,8 +3960,10 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -4000,8 +4043,10 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "dev": true, "license": "MIT", - "optional": true + "optional": true, + "peer": true }, "node_modules/object-assign": { "version": "4.1.1", @@ -4228,8 +4273,10 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, "license": "MIT", "optional": true, + "peer": true, "engines": { "node": ">=8.6" }, @@ -4999,7 +5046,10 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.1.tgz", "integrity": "sha512-h80JrZu/MHUZCyHu5ciuoI0+WxsCxzxJTILn6Fs8rxSnFPh+UVHYfeIxK1nVGugMqkfC4vJcBOYbkfkwYK0+gw==", + "dev": true, "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">= 14.18.0" }, @@ -5190,7 +5240,10 @@ "version": "1.84.0", "resolved": "https://registry.npmjs.org/sass/-/sass-1.84.0.tgz", "integrity": "sha512-XDAbhEPJRxi7H0SxrnOpiXFQoUJHwkR2u3Zc4el+fK/Tt5Hpzw5kkQ59qVDfvdaUq6gCrEZIbySFBM2T9DNKHg==", + "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.0.2", @@ -5392,6 +5445,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -5559,8 +5613,10 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "is-number": "^7.0.0" }, diff --git a/web-app/package.json b/web-app/package.json index ec5e9a6..5e8226e 100644 --- a/web-app/package.json +++ b/web-app/package.json @@ -18,8 +18,7 @@ "prop-types": "^15.8.1", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-router-dom": "^7.1.1", - "sass": "^1.84.0" + "react-router-dom": "^7.1.1" }, "devDependencies": { "@eslint/js": "^9.17.0", diff --git a/web-app/src/layouts/MainLayout.jsx b/web-app/src/layouts/MainLayout.jsx index 110c1ec..9879bec 100644 --- a/web-app/src/layouts/MainLayout.jsx +++ b/web-app/src/layouts/MainLayout.jsx @@ -1,6 +1,6 @@ -import { useState } from "react"; -import { Layout, Menu } from "antd"; -import { Outlet, useLocation, useNavigate } from "react-router-dom"; +import {useState} from "react"; +import {Layout, Menu} from "antd"; +import {Outlet, useLocation, useNavigate} from "react-router-dom"; import { AppstoreOutlined, CalendarOutlined, @@ -11,30 +11,30 @@ import { } from "@ant-design/icons"; import {useAuth} from "../AuthContext.jsx"; -const { Content, Footer, Sider } = Layout; +const {Content, Footer, Sider} = Layout; -const getItem = (label, key, icon, children) => ({ key, icon, children, label }); +const getItem = (label, key, icon, children) => ({key, icon, children, label}); const MainLayout = () => { const [collapsed, setCollapsed] = useState(true); const navigate = useNavigate(); const location = useLocation(); - const { logout } = useAuth(); + const {logout} = useAuth(); const menuItems = [ - getItem("Главная", "/", ), - getItem("Приёмы", "/appointments", ), - getItem("Линзы", "/lenses", ), - getItem("Пациенты", "/patients", ), - getItem("Выдачи линз", "/dispensing", ), - { type: "divider" }, - getItem("Мой профиль", "profile", , [ - getItem("Перейти в профиль", "/profile", ), - getItem("Выйти", "logout", ) + getItem("Главная", "/", ), + getItem("Приёмы", "/appointments", ), + getItem("Линзы", "/lenses", ), + getItem("Пациенты", "/patients", ), + getItem("Выдачи линз", "/dispensing", ), + {type: "divider"}, + getItem("Мой профиль", "profile", , [ + getItem("Перейти в профиль", "/profile", ), + getItem("Выйти", "logout", ) ]) ]; - const handleMenuClick = ({ key }) => { + const handleMenuClick = ({key}) => { if (key === "logout") { logout(); return; @@ -43,13 +43,13 @@ const MainLayout = () => { }; return ( - + -
+
Логотип
{ - -
- + +
+
-
Линза+ © {new Date().getFullYear()}
+
Линза+ © {new Date().getFullYear()}
); diff --git a/web-app/src/pages/LoginPage.jsx b/web-app/src/pages/LoginPage.jsx index 2665b58..652372b 100644 --- a/web-app/src/pages/LoginPage.jsx +++ b/web-app/src/pages/LoginPage.jsx @@ -1,13 +1,12 @@ -import { Form, Input, Button, Row, Col, Typography } from "antd"; -import { useEffect, useState } from "react"; -import { useAuth } from "../AuthContext.jsx"; -import { useNavigate } from "react-router-dom"; -import styles from "/src/styles/LoginPage.module.scss"; +import {Form, Input, Button, Row, Col, Typography} from 'antd'; +import {useEffect, useState} from 'react'; +import {useAuth} from "../AuthContext.jsx"; +import {useNavigate} from "react-router-dom"; -const { Title } = Typography; +const {Title} = Typography; const LoginPage = () => { - const { user, login } = useAuth(); + const {user, login} = useAuth(); const [loading, setLoading] = useState(false); const [error, setError] = useState(null); @@ -34,24 +33,39 @@ const LoginPage = () => { }; return ( - +
Авторизация - {error &&
{error}
} + {error &&
{error}
} -
- - + + + - - + + - diff --git a/web-app/src/styles/LoginPage.module.scss b/web-app/src/styles/LoginPage.module.scss deleted file mode 100644 index 589985e..0000000 --- a/web-app/src/styles/LoginPage.module.scss +++ /dev/null @@ -1,13 +0,0 @@ -$primary-color: #2c499a; - -.login-container { - display: flex; - justify-content: center; - align-items: center; - min-height: 100vh; - - .error { - color: red; - margin-bottom: 15px; - } -} diff --git a/web-app/src/styles/MainLayout.module.scss b/web-app/src/styles/MainLayout.module.scss deleted file mode 100644 index 7a9d3bb..0000000 --- a/web-app/src/styles/MainLayout.module.scss +++ /dev/null @@ -1,42 +0,0 @@ -// Переменные -$primary-color: #2c499a; -$footer-bg: #f1f1f1; -$menu-bg: #001529; - -.layout-container { - min-height: 100vh; -} - -.sider { - .logo { - display: flex; - justify-content: center; - padding: 16px; - - img { - width: 40px; - transition: width 0.2s; - } - } -} - -.content { - margin: 0 16px; - - .content-box { - margin-top: 15px; - padding: 24px; - min-height: 360px; - background: #fff; - border-radius: 8px; - } -} - -.footer { - text-align: center; - background: $footer-bg; -} - -.menu { - background: $menu-bg; -}