FIXED - Move page transition from template to persistent layout so it animates
CI / quality (push) Canceled after 0s
CI / quality (push) Canceled after 0s
A template.tsx is re-created on every navigation, resetting AnimatePresence so neither enter nor exit ran. Move the transition into a PageTransition client component rendered in the persistent (site) layout, so AnimatePresence survives navigations and the old page animates out before the new one in.
This commit is contained in:
@@ -4,6 +4,7 @@ import { getLocale } from "next-intl/server";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { SiteAmbientBackdrop } from "@/components/layout/site-ambient-backdrop";
|
||||
import { PageTransition } from "@/components/layout/page-transition";
|
||||
import { SiteDock } from "@/components/layout/site-dock";
|
||||
import { SiteFooter } from "@/components/layout/site-footer";
|
||||
import { ScrollSmootherProvider } from "@/components/scroll-smoother-provider";
|
||||
@@ -47,7 +48,9 @@ export default async function SiteLayout({ children, params }: SiteLayoutProps)
|
||||
<div id="smooth-wrapper">
|
||||
<div id="smooth-content">
|
||||
<div className="site-content-frame flex min-h-screen flex-col">
|
||||
<main className="flex-1">{children}</main>
|
||||
<main className="flex-1">
|
||||
<PageTransition>{children}</PageTransition>
|
||||
</main>
|
||||
<SiteFooter defaultLocale={siteSettings.defaultLocale} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user