mirror of
https://github.com/supabase/supabase.git
synced 2026-10-10 20:05:06 +03:00
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 -->
39 lines
837 B
TypeScript
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
|