From 968d93a1ba84f48e6a0b292c81a561f616fd7034 Mon Sep 17 00:00:00 2001 From: 3zachm <3zachn4@gmail.com> Date: Sat, 24 Dec 2022 15:35:35 -0800 Subject: [PATCH] move animation presence to app level rather than layout --- layouts/DashLayout.tsx | 10 ++++++++-- layouts/HomeLayout.tsx | 9 +++++++-- pages/_app.tsx | 9 ++++++++- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/layouts/DashLayout.tsx b/layouts/DashLayout.tsx index d212598..3d6536f 100644 --- a/layouts/DashLayout.tsx +++ b/layouts/DashLayout.tsx @@ -18,7 +18,13 @@ function DashLayout(props: DashLayoutProps) { // get the current route for animation purposes const router = useRouter(); return ( - <> + Dashboard - InvestBot @@ -57,7 +63,7 @@ function DashLayout(props: DashLayoutProps) { - + ); } diff --git a/layouts/HomeLayout.tsx b/layouts/HomeLayout.tsx index 8273c0f..da130f1 100644 --- a/layouts/HomeLayout.tsx +++ b/layouts/HomeLayout.tsx @@ -23,7 +23,12 @@ function HomeLayout(props: HomeLayoutProps) { // get the current route for animation purposes const router = useRouter(); return ( - <> + InvestBot @@ -59,7 +64,7 @@ function HomeLayout(props: HomeLayoutProps) { - + ); } diff --git a/pages/_app.tsx b/pages/_app.tsx index c6d8054..d9d8111 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -2,6 +2,7 @@ import "../styles/globals.css"; import type { ReactElement, ReactNode } from "react"; import type { NextPage } from "next"; import type { AppProps } from "next/app"; +import { AnimatePresence, domAnimation, LazyMotion } from "framer-motion"; export type NextPageWithLayout

= NextPage & { getLayout?: (page: ReactElement) => ReactNode; @@ -15,5 +16,11 @@ export default function App({ Component, pageProps }: AppPropsWithLayout) { // Use the layout defined at the page level, if available const getLayout = Component.getLayout ?? ((page) => page); - return getLayout(); + return ( + + + {getLayout()} + + + ); }