2022-11-23 17:20:36 -05:00
|
|
|
import "../styles/globals.css";
|
2022-12-08 10:01:43 -05:00
|
|
|
import type { ReactElement, ReactNode } from "react";
|
|
|
|
import type { NextPage } from "next";
|
2022-11-23 17:20:36 -05:00
|
|
|
import type { AppProps } from "next/app";
|
2022-12-24 18:35:35 -05:00
|
|
|
import { AnimatePresence, domAnimation, LazyMotion } from "framer-motion";
|
2022-11-23 17:20:36 -05:00
|
|
|
|
2022-12-08 10:01:43 -05:00
|
|
|
export type NextPageWithLayout<P = {}, IP = P> = NextPage<P, IP> & {
|
|
|
|
getLayout?: (page: ReactElement) => ReactNode;
|
|
|
|
};
|
|
|
|
|
|
|
|
type AppPropsWithLayout = AppProps & {
|
|
|
|
Component: NextPageWithLayout;
|
|
|
|
};
|
|
|
|
|
|
|
|
export default function App({ Component, pageProps }: AppPropsWithLayout) {
|
|
|
|
// Use the layout defined at the page level, if available
|
|
|
|
const getLayout = Component.getLayout ?? ((page) => page);
|
|
|
|
|
2022-12-24 18:35:35 -05:00
|
|
|
return (
|
|
|
|
<LazyMotion features={domAnimation}>
|
|
|
|
<AnimatePresence mode="wait" initial={false}>
|
|
|
|
{getLayout(<Component {...pageProps} />)}
|
|
|
|
</AnimatePresence>
|
|
|
|
</LazyMotion>
|
|
|
|
);
|
2022-11-23 17:20:36 -05:00
|
|
|
}
|