Skip to content

Commit 6cb9919

Browse files
committed
wip
1 parent 796b110 commit 6cb9919

File tree

2 files changed

+41
-52
lines changed

2 files changed

+41
-52
lines changed

src/components/checkbox-tree/checkbox-tree.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ export function CheckboxTree({
120120
<span className="min-w-0 grow truncate text-left text-neu-800">
121121
{node.label}
122122
</span>
123-
{typeof node.count === "number" && (
123+
{node.count ? ( // we intentionally don't display 0
124124
<span className="ml-auto shrink-0 text-xs text-neu-700">
125125
{node.count}
126126
</span>
127-
)}
127+
) : null}
128128
</label>
129129
) : (
130130
<div className="typography-menu mt-4 text-sm text-neu-900 xl:mt-10">

src/components/tools-and-libraries.tsx

Lines changed: 39 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,20 @@ export function CodePage({ allTags, data }: CodePageProps) {
170170
const items: CheckboxTreeItem[] = [
171171
{
172172
id: "category",
173-
label: "Categories",
173+
label: "Category",
174174
children: [
175+
{
176+
id: "usage-server",
177+
label: getName("server"),
178+
value: "server",
179+
count: getCount("server"),
180+
},
181+
{
182+
id: "usage-client",
183+
label: getName("client"),
184+
value: "client",
185+
count: getCount("client"),
186+
},
175187
{
176188
id: "category-tools",
177189
label: getName("tools"),
@@ -200,24 +212,6 @@ export function CodePage({ allTags, data }: CodePageProps) {
200212
},
201213
],
202214
},
203-
{
204-
id: "usage",
205-
label: "Usage",
206-
children: [
207-
{
208-
id: "usage-client",
209-
label: getName("client"),
210-
value: "client",
211-
count: getCount("client"),
212-
},
213-
{
214-
id: "usage-server",
215-
label: getName("server"),
216-
value: "server",
217-
count: getCount("server"),
218-
},
219-
],
220-
},
221215
]
222216

223217
if (languages.length > 0) {
@@ -284,42 +278,37 @@ export function CodePage({ allTags, data }: CodePageProps) {
284278
Explore tools and libraries for working with GraphQL across various
285279
languages and platforms.
286280
</p>
287-
<div className="typography-h3 my-10 flex max-w-[700px] items-center border-b border-current pb-2.5">
288-
<div
289-
className={clsx(
290-
"flex shrink-0",
291-
isBackspacePressed && "last:*:opacity-50",
292-
)}
293-
>
294-
{inputTags}
295-
</div>
296-
<input
297-
// TODO: This should also do a fuzzy full text search, not just search on tags.
298-
value={search}
299-
onChange={e => setSearch(e.target.value)}
300-
onKeyDown={handleKeyDown}
301-
placeholder="Search..."
302-
className={clsx(
303-
"block grow bg-transparent",
304-
"focus-visible:ring-0 focus-visible:ring-offset-0",
305-
"focus-visible:border-b-primary",
306-
)}
307-
/>
308-
<MagnifyingGlassIcon className="shrink-0" />
309-
</div>
310281
<div className="mt-8 md:grid md:grid-cols-[minmax(240px,300px)_1fr] md:gap-8">
311-
<CheckboxTree
312-
items={filterTreeItems}
313-
selectedValues={selectedTags}
314-
onSelectionChange={handleTreeSelection}
315-
searchQuery={search}
316-
emptyFallback="No categories found"
317-
/>
282+
<aside>
283+
<div>
284+
<input
285+
// TODO: This should also do a fuzzy full text search, not just search on tags.
286+
value={search}
287+
onChange={e => setSearch(e.target.value)}
288+
onKeyDown={handleKeyDown}
289+
placeholder="Search..."
290+
className={clsx(
291+
"block grow bg-transparent",
292+
"focus-visible:ring-0 focus-visible:ring-offset-0",
293+
"focus-visible:border-b-primary",
294+
)}
295+
/>
296+
<MagnifyingGlassIcon className="shrink-0" />
297+
</div>
298+
<CheckboxTree
299+
items={filterTreeItems}
300+
selectedValues={selectedTags}
301+
onSelectionChange={handleTreeSelection}
302+
searchQuery={search}
303+
emptyFallback="No categories found"
304+
/>
305+
</aside>
306+
318307
<div>
319308
<RadioGroup
320309
value={sort}
321310
onValueChange={value => setSort(value as string)}
322-
className="typography-menu flex flex-wrap gap-2 text-sm text-neu-700 md:flex-nowrap"
311+
className="typography-menu flex flex-wrap gap-2 text-sm text-neu-800 md:flex-nowrap"
323312
>
324313
<div>Sort by:</div>
325314
<label className="flex items-center gap-1 [&:has([data-checked])]:text-neu-900">

0 commit comments

Comments
 (0)