убрала ненужное из 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 === "/"; 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 ( return (
<RootContext.Provider value={{ setRef }}> <RootContext.Provider value={{ setRef }}>
<div id="layout-wrapper"> <div id="layout-wrapper">
<Navbar /> <Navbar />
<div id="react-page" style={{ marginTop: isHomePage ? "0px" : "" }}> <main id="react-page" style={{ marginTop: isHomePage ? "0px" : "" }}>
<Outlet /> <Outlet />
</div> </main>
<Footer /> <Footer />
</div> </div>
{hasScrolled && ( {hasScrolled && (
<button <button
className={`scroll-to-top ${isOnTopVisible ? "visible" : "hidden"}`} className={`scroll-to-top ${isOnTopVisible ? "visible" : "hidden"}`}