From d4f2cb4f20150e587528361f31b0cbeba920d3ed Mon Sep 17 00:00:00 2001 From: viktot14-ai Date: Wed, 9 Sep 2026 19:03:19 +0300 Subject: [PATCH] =?UTF-8?q?frontend:=20=D0=BC=D0=BE=D0=B1=D0=B8=D0=BB?= =?UTF-8?q?=D1=8C=D0=BD=D0=B0=D1=8F=20=D0=B2=D0=B5=D1=80=D1=81=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=BE=D1=82=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Удалён /mobile-роут и MobileFormPage; " /" всегда ведёт на /desktop (user-agent/width-детекция выпилена — ЦОУ работает только на десктопе). - Тема mobile в index.css оставлена (мёртвый CSS, не мешает). - CaseForm.isMobile не тронут: DesktopSARPage передаёт false явно. --- frontend/src/App.js | 27 +++++---------------------- frontend/src/pages/MobileFormPage.jsx | 12 ------------ 2 files changed, 5 insertions(+), 34 deletions(-) delete mode 100644 frontend/src/pages/MobileFormPage.jsx diff --git a/frontend/src/App.js b/frontend/src/App.js index a22bb7b..9729168 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -1,7 +1,6 @@ -import React, { useEffect, useState } from "react"; +import React from "react"; import { BrowserRouter as Router, Routes, Route, Navigate, useLocation } from "react-router-dom"; import AdminDashboard from "./pages/AdminDashboard"; -import MobileFormPage from "./pages/MobileFormPage"; import DesktopSARPage from "./pages/DesktopSARPage"; import AnalysisResult from "./pages/analysis/AnalysisResult"; import Login from "./pages/Login"; @@ -14,15 +13,13 @@ function ThemeProvider({ children }) { useEffect(() => { let theme = "desktop"; - - if (location.pathname.startsWith("/mobile") || location.pathname.startsWith("/m")) { - theme = "mobile"; - } else if (location.pathname.startsWith("/admin")) { + + if (location.pathname.startsWith("/admin")) { theme = "admin"; } else if (location.pathname.startsWith("/sar") || location.pathname.startsWith("/desktop") || location.pathname.startsWith("/analysis")) { theme = "desktop"; } - + document.documentElement.setAttribute("data-theme", theme); }, [location.pathname]); @@ -30,18 +27,6 @@ function ThemeProvider({ children }) { } function App() { - const [isMobile, setIsMobile] = useState( - () => /iPhone|iPad|iPod|Android/i.test(navigator.userAgent) || window.innerWidth < 768 - ); - - useEffect(() => { - const onResize = () => setIsMobile( - /iPhone|iPad|iPod|Android/i.test(navigator.userAgent) || window.innerWidth < 768 - ); - window.addEventListener('resize', onResize); - return () => window.removeEventListener('resize', onResize); - }, []); - return ( @@ -49,7 +34,7 @@ function App() { } /> - } /> + } /> } /> } /> @@ -57,8 +42,6 @@ function App() { } /> } /> - - } /> diff --git a/frontend/src/pages/MobileFormPage.jsx b/frontend/src/pages/MobileFormPage.jsx deleted file mode 100644 index 6a968af..0000000 --- a/frontend/src/pages/MobileFormPage.jsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from "react"; -import CaseForm from "../components/CaseForm"; - -const MobileFormPage = () => { - return ( -
- -
- ); -}; - -export default MobileFormPage;