Files
supabase/apps/www/app/blog/BlogLayoutShell.tsx
Francesco Sansalvadore ba133afc4c www: blog (#47236)
Update blog layout.

PR breakdown of #43455 
Related: #47226 #47227 #47228
2026-06-30 10:28:17 +02:00

29 lines
739 B
TypeScript

'use client'
import { usePathname } from 'next/navigation'
import type PostTypes from 'types/post'
import BlogHero from './BlogHero'
import DefaultLayout from '@/components/Layouts/Default'
export default function BlogLayoutShell({
featuredPost,
secondaryPosts,
children,
}: {
featuredPost: PostTypes | null
secondaryPosts: PostTypes[]
children: React.ReactNode
}) {
const pathname = usePathname()
const isListingRoute = pathname === '/blog' || Boolean(pathname?.startsWith('/blog/categories/'))
return (
<DefaultLayout>
{isListingRoute && <h1 className="sr-only">Supabase Blog</h1>}
<BlogHero featuredPost={featuredPost} secondaryPosts={secondaryPosts} />
{children}
</DefaultLayout>
)
}