File tree Expand file tree Collapse file tree 1 file changed +10
-18
lines changed
Expand file tree Collapse file tree 1 file changed +10
-18
lines changed Original file line number Diff line number Diff line change @@ -27,21 +27,7 @@ export function Sidebar() {
2727 ] ;
2828
2929 if ( error ) console . error ( "Sidebar fetch error:" , error )
30- if ( isLoading ) return (
31- < div className = "bg-base-200 min-h-full w-80 p-4" >
32- < h2 className = "hidden text-xl font-bold mb-4" >
33- { /* サイドバーが常時表示されている場合のみ */ }
34- Navbar Title
35- </ h2 >
36- < ol className = "menu w-full list-outside" >
37- { pages . map ( ( page ) =>
38- < li key = { page . id } >
39- < Link href = { `/${ page . id } ` } > { page . title } </ Link >
40- </ li >
41- ) }
42- </ ol >
43- </ div >
44- )
30+
4531
4632
4733
@@ -58,14 +44,20 @@ export function Sidebar() {
5844 { pages . map ( ( page ) => (
5945 < li key = { page . id } >
6046 < Link href = { `/${ page . id } ` } > { page . title } </ Link >
61- { page . id === docs_id && (
47+ { page . id === docs_id && ! isLoading && (
6248 < ul className = "ml-4 mt-2 text-sm" >
6349 { splitmdcontent
64- . filter ( section => section . level !== 1 )
65- . map ( ( section , idx ) => (
50+ . slice ( 1 )
51+ . map ( ( section , idx ) => ( section . level === 2 ?
6652 < li key = { idx } >
6753 < Link href = { `#${ idx + 1 } ` } > { section . title } </ Link >
6854 </ li >
55+ :
56+ < ul key = { idx } className = "ml-3 mt-2 text-sm" >
57+ < li >
58+ < Link href = { `#${ idx + 1 } ` } > { section . title } </ Link >
59+ </ li >
60+ </ ul >
6961 ) ) }
7062 </ ul >
7163 ) }
You can’t perform that action at this time.
0 commit comments