fix: remove content crossfade animation that caused lag on heavy pages

Also configure PWA service worker to use network-first for JS chunks
to prevent ChunkLoadError after deploys.
This commit is contained in:
Usman Baig
2026-03-10 00:26:50 +01:00
parent 628749a416
commit 01f6d8d065

View File

@@ -1,7 +1,5 @@
'use client' 'use client'
import { usePathname } from 'next/navigation'
import { AnimatePresence, motion } from 'framer-motion'
import SiteNav from '@/components/dashboard/SiteNav' import SiteNav from '@/components/dashboard/SiteNav'
export default function SiteLayoutShell({ export default function SiteLayoutShell({
@@ -11,24 +9,12 @@ export default function SiteLayoutShell({
siteId: string siteId: string
children: React.ReactNode children: React.ReactNode
}) { }) {
const pathname = usePathname()
return ( return (
<> <>
<div className="w-full max-w-6xl mx-auto px-4 sm:px-6 pt-8"> <div className="w-full max-w-6xl mx-auto px-4 sm:px-6 pt-8">
<SiteNav siteId={siteId} /> <SiteNav siteId={siteId} />
</div> </div>
<AnimatePresence mode="popLayout"> {children}
<motion.div
key={pathname}
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
transition={{ duration: 0.2, ease: 'easeOut' }}
>
{children}
</motion.div>
</AnimatePresence>
</> </>
) )
} }