README / w-312356-main /src /components /PageLayout.tsx
TAShaikhh's picture
Upload 159 files
d3b533c verified
import React, { useEffect } from 'react';
import { useLocation } from 'react-router-dom';
import Navbar from '@/components/Navbar';
import Footer from '@/components/Footer';
type PageLayoutProps = {
children: React.ReactNode;
showContact?: boolean;
};
const PageLayout = ({ children, showContact = true }: PageLayoutProps) => {
const location = useLocation();
// Effect to scroll to top when route changes
useEffect(() => {
window.scrollTo(0, 0);
}, [location]);
return (
<div className="min-h-screen bg-white w-full max-w-[100vw] overflow-x-hidden">
<Navbar />
{children}
<Footer />
</div>
);
};
export default PageLayout;