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'
|
'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>
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user