mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 03:09:45 +00:00
убрала ненужное из root
This commit is contained in:
1 parent
0296d410bf
commit
880e0be5e9
1 file changed
+6
-21
+6
-21
@@ -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"}`}
|
||||
|
||||
Reference in new issue
Block a user