убрала ненужное из root

This commit is contained in:
xomimishka committed 2025-04-15 16:42:21 +03:00
1 parent 0296d410bf
commit 880e0be5e9
1 file changed
+6 -21
+6 -21
View File
@@ -71,30 +71,15 @@ function Root() {
// Определяем, находимся ли мы на главной странице
const isHomePage = location.pathname === "/";
useEffect(() => {
const rootElement = document.getElementById("root");
if (!rootElement) return;
if (location.pathname === "/") {
rootElement.classList.add("main-page");
rootElement.classList.remove("inner-page");
} else {
rootElement.classList.remove("main-page");
rootElement.classList.add("inner-page");
}
}, [location.pathname]);
return (
<RootContext.Provider value={{ setRef }}>
<div id="layout-wrapper">
<Navbar />
<div id="react-page" style={{ marginTop: isHomePage ? "0px" : "" }}>
<Outlet />
</div>
<Footer />
</div>
<Navbar />
<main id="react-page" style={{ marginTop: isHomePage ? "0px" : "" }}>
<Outlet />
</main>
<Footer />
</div>
{hasScrolled && (
<button
className={`scroll-to-top ${isOnTopVisible ? "visible" : "hidden"}`}