@@ -13,7 +13,7 @@ import {
13
13
SidebarViewport ,
14
14
SidebarPageTree ,
15
15
} from '@/layouts/docs/sidebar' ;
16
- import { replaceOrDefault , type SharedNavProps } from '@/layouts/shared' ;
16
+ import { replaceOrDefault } from '@/layouts/shared' ;
17
17
import { type LinkItemType , BaseLinkItem } from '@/layouts/links' ;
18
18
import { RootToggle } from '@/components/layout/root-toggle' ;
19
19
import { type BaseLayoutProps , getLinks } from './shared' ;
@@ -132,11 +132,26 @@ export function DocsLayout({
132
132
className = { cn ( 'md:ps-(--fd-layout-offset)' , sidebar . className ) }
133
133
>
134
134
< SidebarHeader >
135
- < SidebarHeaderItems
136
- { ...nav }
137
- links = { links }
138
- sidebarCollapsible = { collapsible }
139
- />
135
+ < div className = "flex flex-row pt-1 max-md:hidden" >
136
+ < Link
137
+ href = { nav . url ?? '/' }
138
+ className = "inline-flex text-[15px] items-center gap-2.5 font-medium"
139
+ >
140
+ { nav . title }
141
+ </ Link >
142
+ { nav . children }
143
+ { collapsible && (
144
+ < SidebarCollapseTrigger
145
+ className = { cn (
146
+ buttonVariants ( {
147
+ color : 'ghost' ,
148
+ size : 'icon-sm' ,
149
+ } ) ,
150
+ 'ms-auto mb-auto text-fd-muted-foreground max-md:hidden' ,
151
+ ) }
152
+ />
153
+ ) }
154
+ </ div >
140
155
{ sidebarBanner }
141
156
{ tabs . length > 0 ? (
142
157
< RootToggle options = { tabs } className = "-mx-2" />
@@ -179,40 +194,6 @@ export function DocsLayout({
179
194
) ;
180
195
}
181
196
182
- function SidebarHeaderItems ( {
183
- links,
184
- sidebarCollapsible,
185
- ...props
186
- } : SharedNavProps & { links : LinkItemType [ ] ; sidebarCollapsible : boolean } ) {
187
- const isEmpty = ! props . title && ! props . children && links . length === 0 ;
188
- if ( isEmpty ) return null ;
189
-
190
- return (
191
- < div className = "flex flex-row items-center max-md:hidden" >
192
- { props . title ? (
193
- < Link
194
- href = { props . url ?? '/' }
195
- className = "inline-flex text-[15px] items-center gap-2.5 py-1 font-medium"
196
- >
197
- { props . title }
198
- </ Link >
199
- ) : null }
200
- { props . children }
201
- { sidebarCollapsible && (
202
- < SidebarCollapseTrigger
203
- className = { cn (
204
- buttonVariants ( {
205
- color : 'ghost' ,
206
- size : 'icon-sm' ,
207
- } ) ,
208
- 'ms-auto text-fd-muted-foreground max-md:hidden' ,
209
- ) }
210
- />
211
- ) }
212
- </ div >
213
- ) ;
214
- }
215
-
216
197
function SidebarFooterItems ( {
217
198
i18n,
218
199
disableThemeSwitch,
0 commit comments