2022-12-08 10:02:48 -05:00
|
|
|
// Layout/container used for the main mostly empty landing page, can be used for related pages (credits, about, etc.)
|
|
|
|
|
2022-12-13 03:15:00 -05:00
|
|
|
import {
|
|
|
|
AnimatePresence,
|
|
|
|
domAnimation,
|
|
|
|
LazyMotion,
|
|
|
|
m,
|
|
|
|
Variants,
|
|
|
|
} from "framer-motion";
|
2022-12-08 10:02:48 -05:00
|
|
|
import Head from "next/head";
|
2022-12-08 22:41:06 -05:00
|
|
|
import { useRouter } from "next/router";
|
2022-12-08 10:02:48 -05:00
|
|
|
import NavBar from "../components/common/NavBar";
|
|
|
|
import { NavTemplate } from "./NavTemplates";
|
|
|
|
|
|
|
|
interface HomeLayoutProps {
|
|
|
|
navOptions: NavTemplate[];
|
|
|
|
children: React.ReactNode;
|
|
|
|
}
|
|
|
|
|
|
|
|
function HomeLayout(props: HomeLayoutProps) {
|
|
|
|
// get the nav options
|
|
|
|
const navOptions = props.navOptions;
|
2022-12-08 22:41:06 -05:00
|
|
|
// get the current route for animation purposes
|
|
|
|
const router = useRouter();
|
2022-12-08 10:02:48 -05:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Head>
|
|
|
|
<title>InvestBot</title>
|
2022-12-10 05:54:00 -05:00
|
|
|
<meta name="description" content="Serving anny's community est. 2022" />
|
2022-12-08 10:02:48 -05:00
|
|
|
<link rel="icon" href="/favicon.ico" />
|
2022-12-10 05:54:00 -05:00
|
|
|
<meta name="theme-color" content="#c084fc" />
|
|
|
|
<meta property="og:title" content="InvestBot" />
|
|
|
|
<meta
|
|
|
|
property="og:description"
|
|
|
|
content="Serving anny's community est. 2022"
|
|
|
|
/>
|
|
|
|
<meta property="og:image" content="/img/logo.webp" />
|
|
|
|
<meta property="og:type" content="website" />
|
|
|
|
<meta property="og:site_name" content="InvestBot" />
|
2022-12-08 10:02:48 -05:00
|
|
|
</Head>
|
2022-12-10 05:54:00 -05:00
|
|
|
|
2022-12-08 10:02:48 -05:00
|
|
|
<LazyMotion features={domAnimation}>
|
2022-12-10 05:54:00 -05:00
|
|
|
<AnimatePresence mode="wait">
|
2022-12-08 10:02:48 -05:00
|
|
|
<NavBar options={navOptions} />
|
|
|
|
</AnimatePresence>
|
|
|
|
</LazyMotion>
|
2022-12-10 05:54:00 -05:00
|
|
|
|
2022-12-08 10:02:48 -05:00
|
|
|
<LazyMotion features={domAnimation}>
|
2022-12-10 05:54:00 -05:00
|
|
|
<AnimatePresence mode="wait">
|
2022-12-08 21:40:02 -05:00
|
|
|
<m.div
|
|
|
|
key={router.route.concat("layout-fade")}
|
|
|
|
className="h-screen w-screen"
|
2022-12-13 03:15:00 -05:00
|
|
|
variants={containerVariants}
|
|
|
|
initial="initial"
|
|
|
|
animate="animate"
|
|
|
|
exit="exit"
|
2022-12-08 21:40:02 -05:00
|
|
|
>
|
|
|
|
{props.children}
|
|
|
|
</m.div>
|
2022-12-08 10:02:48 -05:00
|
|
|
</AnimatePresence>
|
|
|
|
</LazyMotion>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2022-12-13 03:15:00 -05:00
|
|
|
const containerVariants: Variants = {
|
|
|
|
initial: { opacity: 0 },
|
|
|
|
animate: { opacity: 1 },
|
|
|
|
exit: { opacity: 0 },
|
|
|
|
};
|
|
|
|
|
2022-12-08 10:02:48 -05:00
|
|
|
export default HomeLayout;
|