Prechádzať zdrojové kódy

☀ 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.
t0ng7u 3 dní pred
rodič
commit
abc255dd6d

+ 0 - 8
web/default/src/components/layout/components/section-page-layout.tsx

@@ -45,7 +45,6 @@ export function SectionPageLayout(props: SectionPageLayoutProps) {
   )
 
   let title: ReactNode = null
-  let description: ReactNode = null
   let actions: ReactNode = null
   let content: ReactNode = null
   let breadcrumb: ReactNode = null
@@ -54,8 +53,6 @@ export function SectionPageLayout(props: SectionPageLayoutProps) {
     if (!isValidElement(node)) return
     const child = node as ReactElement<SlotProps>
     if (child.type === SectionPageLayoutTitle) title = child.props.children
-    else if (child.type === SectionPageLayoutDescription)
-      description = child.props.children
     else if (child.type === SectionPageLayoutActions)
       actions = child.props.children
     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'>
                 {title}
               </h2>
-              {description != null && (
-                <p className='text-muted-foreground mt-0.5 line-clamp-2 text-sm'>
-                  {description}
-                </p>
-              )}
             </div>
             {actions != null && (
               <div className='flex shrink-0 flex-wrap items-center gap-2 sm:gap-x-4'>