Files
supabase/apps/www/components/Layouts/Default.tsx
Charis 6c560e1adb prevent www nav bar bailing out ssr (#45422)
www pages that use DefaultLayout are bailing out of SSR because of
useSearchParams. Removing the useSearchParams opts more pages (including
the pricing page) into SSR.

_However_, it breaks the build because once blog pages are opted into
SSR, they fail due to next-mdx-remote/codehike incompatibilities. So we
also need to opt blog pages back _out_ of SSR using next/dynamic. This
reproduces previous behaviour for the blog.

Also had to remove suspense wrapper around everything because that was
causing the content div to be streamed in a hidden later chunk

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added support for the Contribute section with improved state
management integration.

* **Performance Improvements**
  * Optimized blog post rendering with client-side enhancements.
  * Improved navigation and layout loading strategies.

* **Refactor**
  * Simplified provider architecture for better maintainability.
  * Restructured internal component organization.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-30 23:19:56 +03:00

39 lines
837 B
TypeScript

'use client'
import Footer from 'components/Footer/index'
import Nav from 'components/Nav/index'
import { useForceDeepDark } from 'lib/theme.utils'
import { cn } from 'ui'
type Props = {
hideHeader?: boolean
hideFooter?: boolean
stickyNavbar?: boolean
className?: string
footerClassName?: string
children: React.ReactNode
}
const DefaultLayout = (props: Props) => {
const {
hideHeader = false,
hideFooter = false,
stickyNavbar = true,
className = '',
footerClassName = '',
children,
} = props
useForceDeepDark()
return (
<>
<Nav hideNavbar={hideHeader} stickyNavbar={stickyNavbar} />
<main className={cn('relative min-h-screen', className)}>{children}</main>
<Footer className={footerClassName} hideFooter={hideFooter} />
</>
)
}
export default DefaultLayout