forked from CSI-KJSCE/appointment_to_examiner
25 lines
615 B
JavaScript
25 lines
615 B
JavaScript
import React from "react";
|
|
import { Outlet, useLocation } from "react-router-dom";
|
|
import Navbar from "./Navbar";
|
|
import Footer from "./Footer";
|
|
|
|
const Layout = () => {
|
|
const location = useLocation();
|
|
|
|
// Hide footer on specific pages
|
|
const hideFooterPages = ["/", "/ForgetPw", "/ResetPw"];
|
|
const shouldHideFooter = hideFooterPages.includes(location.pathname);
|
|
|
|
return (
|
|
<div className="app-container">
|
|
<Navbar />
|
|
<div className="content">
|
|
<Outlet /> {/* Current page renders here */}
|
|
</div>
|
|
{!shouldHideFooter && <Footer />}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Layout;
|