☀ fix(default): keep SectionPageLayout description slot hidden
Keep SectionPageLayout.Description as a non-rendering composition slot so callers stay compatible while page subtitles remain hidden across the app.
This commit is contained in:
parent
a7d019e3a9
commit
abc255dd6d
@ -45,7 +45,6 @@ export function SectionPageLayout(props: SectionPageLayoutProps) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
let title: ReactNode = null
|
let title: ReactNode = null
|
||||||
let description: ReactNode = null
|
|
||||||
let actions: ReactNode = null
|
let actions: ReactNode = null
|
||||||
let content: ReactNode = null
|
let content: ReactNode = null
|
||||||
let breadcrumb: ReactNode = null
|
let breadcrumb: ReactNode = null
|
||||||
@ -54,8 +53,6 @@ export function SectionPageLayout(props: SectionPageLayoutProps) {
|
|||||||
if (!isValidElement(node)) return
|
if (!isValidElement(node)) return
|
||||||
const child = node as ReactElement<SlotProps>
|
const child = node as ReactElement<SlotProps>
|
||||||
if (child.type === SectionPageLayoutTitle) title = child.props.children
|
if (child.type === SectionPageLayoutTitle) title = child.props.children
|
||||||
else if (child.type === SectionPageLayoutDescription)
|
|
||||||
description = child.props.children
|
|
||||||
else if (child.type === SectionPageLayoutActions)
|
else if (child.type === SectionPageLayoutActions)
|
||||||
actions = child.props.children
|
actions = child.props.children
|
||||||
else if (child.type === SectionPageLayoutContent)
|
else if (child.type === SectionPageLayoutContent)
|
||||||
@ -76,11 +73,6 @@ export function SectionPageLayout(props: SectionPageLayoutProps) {
|
|||||||
<h2 className='truncate text-base font-bold tracking-tight sm:text-lg'>
|
<h2 className='truncate text-base font-bold tracking-tight sm:text-lg'>
|
||||||
{title}
|
{title}
|
||||||
</h2>
|
</h2>
|
||||||
{description != null && (
|
|
||||||
<p className='text-muted-foreground mt-0.5 line-clamp-2 text-sm'>
|
|
||||||
{description}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
{actions != null && (
|
{actions != null && (
|
||||||
<div className='flex shrink-0 flex-wrap items-center gap-2 sm:gap-x-4'>
|
<div className='flex shrink-0 flex-wrap items-center gap-2 sm:gap-x-4'>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user