feat: initial frontend build for RIT Freshers Hub
This commit is contained in:
34
src/layouts/MainLayout.tsx
Normal file
34
src/layouts/MainLayout.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import { Outlet } from 'react-router-dom';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import Navbar from '@/components/Navbar/Navbar';
|
||||
import Footer from '@/components/Footer/Footer';
|
||||
|
||||
const pageVariants = {
|
||||
initial: { opacity: 0, y: 10 },
|
||||
enter: { opacity: 1, y: 0 },
|
||||
exit: { opacity: 0, y: -10 },
|
||||
};
|
||||
|
||||
export default function MainLayout() {
|
||||
const location = useLocation();
|
||||
|
||||
return (
|
||||
<div className="min-h-screen" style={{ backgroundColor: '#FAFAFA' }}>
|
||||
<Navbar />
|
||||
<AnimatePresence mode="wait">
|
||||
<motion.main
|
||||
key={location.pathname}
|
||||
variants={pageVariants}
|
||||
initial="initial"
|
||||
animate="enter"
|
||||
exit="exit"
|
||||
transition={{ duration: 0.3, ease: 'easeInOut' }}
|
||||
>
|
||||
<Outlet />
|
||||
</motion.main>
|
||||
</AnimatePresence>
|
||||
<Footer />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user