Files
float-fleet/components/_App/Layout.js
T
DESKTOP-GBA0BK8\Admin 97cc85c49d first commit
2023-03-25 20:44:56 -04:00

76 lines
2.4 KiB
JavaScript

import React, { useState } from "react";
import Head from "next/head";
import { useRouter } from "next/router";
import LeftSidebar from "@/components/_App/LeftSidebar";
import TopNavbar from "@/components/_App/TopNavbar";
import Footer from "@/components/_App/Footer";
import ScrollToTop from "./ScrollToTop";
import ControlPanelModal from "./ControlPanelModal";
const Layout = ({ children }) => {
const router = useRouter();
const [active, setActive] = useState(false);
const toogleActive = () => {
setActive(!active);
};
return (
<>
<Head>
<title>
Admash - Material Design React Next Admin Dashboard Template
</title>
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
</Head>
<div className={`main-wrapper-content ${active && "active"}`}>
{!(
router.pathname === "/authentication/sign-in" ||
router.pathname === "/authentication/sign-up" ||
router.pathname === "/authentication/forgot-password" ||
router.pathname === "/authentication/lock-screen" ||
router.pathname === "/authentication/confirm-mail" ||
router.pathname === "/authentication/logout"
) && (
<>
<TopNavbar toogleActive={toogleActive} />
<LeftSidebar toogleActive={toogleActive} />
</>
)}
<div className="main-content">
{children}
{!(
router.pathname === "/authentication/sign-in" ||
router.pathname === "/authentication/sign-up" ||
router.pathname === "/authentication/forgot-password" ||
router.pathname === "/authentication/lock-screen" ||
router.pathname === "/authentication/confirm-mail" ||
router.pathname === "/authentication/logout"
) && <Footer />}
</div>
</div>
{/* ScrollToTop */}
<ScrollToTop />
{!(
router.pathname === "/authentication/sign-in" ||
router.pathname === "/authentication/sign-up" ||
router.pathname === "/authentication/forgot-password" ||
router.pathname === "/authentication/lock-screen" ||
router.pathname === "/authentication/confirm-mail" ||
router.pathname === "/authentication/logout"
) &&
<ControlPanelModal />
}
</>
);
};
export default Layout;