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;