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.

MainContainer.js 696B

1234567891011121314151617181920212223242526
  1. import React from "react";
  2. import PropType from "prop-types";
  3. import { useLocation } from "react-router-dom";
  4. import Navbar from "../../components/MUI/NavbarComponent";
  5. // import AppRoutes from "../../AppRoutes";
  6. const urls = ["/", "/login", "/forgot-password", "/reset-password",'/forgot-password-confirmation','/error-page'];
  7. const MainContainer = ({ children }) => {
  8. const { pathname } = useLocation();
  9. return urls.includes(pathname) ? (
  10. <div className="">{children}</div>
  11. ) : (
  12. <div className="">
  13. <Navbar />
  14. <div className="h-withHeader">{children}</div>
  15. </div>
  16. );
  17. };
  18. MainContainer.propTypes = {
  19. children: PropType.any,
  20. };
  21. export default MainContainer;