FIXED - Move page transition from template to persistent layout so it animates
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:
moh
2026-09-20 19:55:13 +02:00
parent 4df0d9ae86
commit a628b69133
2 changed files with 16 additions and 14 deletions
+4 -1
View File
@@ -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>