From 4d3892a5eacfa62839f020402025e4e9f6868a3c Mon Sep 17 00:00:00 2001 From: Maofeng Date: Mon, 21 Sep 2026 16:17:06 +0800 Subject: [PATCH] fix(docs): stabilize shared layout rendering --- docs/src/components/layout.tsx | 79 +++++++++++++++++----------------- docs/src/index.css | 2 +- 2 files changed, 40 insertions(+), 41 deletions(-) diff --git a/docs/src/components/layout.tsx b/docs/src/components/layout.tsx index eb59e62..e17657c 100644 --- a/docs/src/components/layout.tsx +++ b/docs/src/components/layout.tsx @@ -38,7 +38,7 @@ export function HomeButton({ return ( {label ?? t({ zh: "首页", us: "Home" })} @@ -138,51 +138,50 @@ function HeaderInner({ const hasLeading = React.Children.count(leading) > 0 const hasSubleading = React.Children.count(subleading) > 0 - const children = [] - if (hasLeading || hasSubleading) { - children.push( - hasLeading ? ( - leading - ) : hasSubleading ? ( - - ) : null, - hasSubleading && , - subleading - ) - } else { - children.push( -

- S - imple -   - R - eact -   - A - pp -   - K - it -

- ) - } - - if (actions != null) { - children.push( -
- {actions} -
- ) - } - return ( - {children} + {hasLeading || hasSubleading ? ( + <> + {hasLeading ? ( + leading + ) : ( + + )} + {hasSubleading ? ( + <> + + {subleading} + + ) : null} + + ) : ( +

+ S + imple +   + R + eact +   + A + pp +   + K + it +

+ )} + {actions != null ? ( +
+ {actions} +
+ ) : null}
) } -export function SiteFooter({ className, ...rest }: React.ComponentProps<"footer">) { +export function SiteFooter({ + className, + ...rest +}: React.ComponentProps<"footer">) { return (