Brak opisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Layout.js 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { useEffect, useState } from "react";
  2. import Header from "./Header";
  3. import PageHead from "./PageHead";
  4. import PageTitle from "./PageTitle";
  5. import Sidebar from "./sidebar";
  6. const Layout = ({
  7. headTitle,
  8. children,
  9. pageTitle,
  10. pageTitleSub,
  11. pageClass,
  12. parent,
  13. child,
  14. }) => {
  15. const [height, setHeight] = useState();
  16. useEffect(() => {
  17. setHeight(window.screen.height);
  18. }, []);
  19. return (
  20. <>
  21. <PageHead headTitle={headTitle} />
  22. <div id="main-wrapper" className={pageClass}>
  23. <Header />
  24. <Sidebar />
  25. <div className="content-body" style={{ minHeight: height - 122 }}>
  26. <div className="container ">
  27. {pageTitle && (
  28. <PageTitle
  29. pageTitle={pageTitle}
  30. pageTitleSub={pageTitleSub}
  31. parent={parent}
  32. child={child}
  33. />
  34. )}
  35. {children}
  36. </div>
  37. </div>
  38. </div>
  39. </>
  40. );
  41. };
  42. export default Layout;