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