@@ -77,29 +77,30 @@ export const ReferenceDirectoryWithFilter = ({
7777 } , [ ] ) ;
7878 } , [ categoryData , searchKeyword ] ) ;
7979
80- const renderEntries = ( entries : ReferenceDirectoryEntry [ ] ) => (
81- < div class = "content-grid" >
82- { entries . map ( ( entry ) => (
83- < div class = "col-span-3 w-full overflow-hidden" key = { entry . id } >
84- < a
85- href = { `/reference/${ entry . data . path } ` }
86- class = "group hover:no-underline"
87- aria-label = { entry . data . title }
88- aria-describedby = { `${ entry . data . title } -description` }
89- >
90- < span
91- class = "text-body-mono group-hover:underline"
92- dangerouslySetInnerHTML = { { __html : entry . data . title } }
93- />
94- < p
95- class = "mt-1 text-sm"
96- id = { `${ entry . data . title } -description` }
97- > { `${ getOneLineDescription ( entry . data . description ) } ` } </ p >
98- </ a >
99- </ div >
100- ) ) }
101- </ div >
102- ) ;
80+ const renderEntries = ( entries : ReferenceDirectoryEntry [ ] ) =>
81+ entries . length === 0 ? null : (
82+ < div class = "content-grid" >
83+ { entries . map ( ( entry ) => (
84+ < div class = "col-span-3 w-full overflow-hidden" key = { entry . id } >
85+ < a
86+ href = { `/reference/${ entry . data . path } ` }
87+ class = "group hover:no-underline"
88+ aria-label = { entry . data . title }
89+ aria-describedby = { `${ entry . data . title } -description` }
90+ >
91+ < span
92+ class = "text-body-mono group-hover:underline"
93+ dangerouslySetInnerHTML = { { __html : entry . data . title } }
94+ />
95+ < p
96+ class = "mt-1 text-sm"
97+ id = { `${ entry . data . title } -description` }
98+ > { `${ getOneLineDescription ( entry . data . description ) } ` } </ p >
99+ </ a >
100+ </ div >
101+ ) ) }
102+ </ div >
103+ ) ;
103104
104105 const getSubcatHeading = (
105106 subcat : { name : string } ,
@@ -110,21 +111,20 @@ export const ReferenceDirectoryWithFilter = ({
110111 }
111112
112113 return (
113- < div class = "my-lg" >
114+ < >
114115 { subcat . name . includes ( "p5." ) ? (
115116 < a
116117 id = { subcat . name }
117118 href = { `/reference/${ category . name === "p5.sound" ? "p5.sound" : "p5" } /${ subcat . name } ` }
118119 >
119- < h3 > { subcat . name } </ h3 >
120+ < h3 className = "m-0 py-[40px]" > { subcat . name } </ h3 >
120121 </ a >
121122 ) : (
122- < h3 >
123+ < h3 className = "m-0 py-[40px]" id = { subcat . name } >
123124 { subcat . name }
124- < a id = { subcat . name } />
125125 </ h3 >
126126 ) }
127- </ div >
127+ </ >
128128 ) ;
129129 } ;
130130
@@ -133,21 +133,17 @@ export const ReferenceDirectoryWithFilter = ({
133133 return < div class = "mt-lg" > { uiTranslations [ "No Results" ] } </ div > ;
134134 }
135135 return filteredEntries . map ( ( category ) => (
136- < div
137- class = "my-md border-b border-type-color pb-2xl last:!border-0"
138- key = { category . name }
139- >
140- < h2 >
136+ < section key = { category . name } >
137+ < h2 class = "mb-0" id = { category . name } >
141138 { category . name }
142- < a id = { category . name } />
143139 </ h2 >
144140 { category . subcats . map ( ( subcat ) => (
145141 < div key = { subcat . name } >
146142 { getSubcatHeading ( subcat , category ) }
147143 { renderEntries ( subcat . entries ) }
148144 </ div >
149145 ) ) }
150- </ div >
146+ </ section >
151147 ) ) ;
152148 } ;
153149
@@ -162,12 +158,12 @@ export const ReferenceDirectoryWithFilter = ({
162158 < div >
163159 < div class = "h-0 overflow-visible" >
164160 < div class = "relative -top-[75px] grid h-[75px] grid-cols-2 gap-x-[40px] border-b border-sidebar-type-color bg-accent-color px-5 pb-lg md:px-lg lg:grid-cols-4" >
165- < div class = "text-body col-span-3 flex w-full max-w-[750px] border-b border-accent-type-color text-accent-type-color" >
161+ < div class = "text-body col-span-2 flex w-full max-w-[750px] border-b border-accent-type-color text-accent-type-color" >
166162 < input
167163 type = "text"
168164 id = "search"
169165 ref = { inputRef }
170- class = "w-full bg-transparent py-xs text-accent-type-color placeholder:text-accent-type-color"
166+ class = "w-full bg-transparent py-xs text-accent-type-color placeholder:text-accent-type-color focus:outline-0 "
171167 placeholder = "Filter by keyword"
172168 onKeyUp = { ( e : JSX . TargetedKeyboardEvent < HTMLInputElement > ) => {
173169 const target = e . target as HTMLInputElement ;
0 commit comments