Skip to content

Commit 4971217

Browse files
phipsaeclaude
andcommitted
feat(dev tools): move "Suggest a resource" CTA into catalog sidebar
The CTA lived at the very bottom of the page, below the full catalog, so it was effectively invisible. Move it into the category sidebar as a compact, full-width button that stays pinned while scrolling (desktop) and sits under the filters on mobile. The desktop column becomes a flex layout so the button is always visible while the category list scrolls in the remaining space. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent b0c749f commit 4971217

2 files changed

Lines changed: 23 additions & 17 deletions

File tree

app/[locale]/developers/tools/_components/ToolsCatalog.tsx

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { useDeferredValue, useMemo, useRef, useState } from "react"
44
import { ChevronRight } from "lucide-react"
55

6-
import { Button } from "@/components/ui/buttons/Button"
6+
import { Button, ButtonLink } from "@/components/ui/buttons/Button"
77
import Input from "@/components/ui/input"
88
import { BaseLink } from "@/components/ui/Link"
99
import { Section } from "@/components/ui/section"
@@ -31,7 +31,9 @@ type ToolsCatalogProps = {
3131
allCategories: string
3232
resultsLabel: string
3333
noResults: string
34+
suggestButton: string
3435
}
36+
suggestUrl: string
3537
currentCategoryId?: string
3638
}
3739

@@ -195,6 +197,7 @@ export default function ToolsCatalog({
195197
countByCategory,
196198
totalCount,
197199
labels,
200+
suggestUrl,
198201
currentCategoryId,
199202
}: ToolsCatalogProps) {
200203
const nf = numberFormat(locale)
@@ -329,20 +332,33 @@ export default function ToolsCatalog({
329332
/>
330333
)
331334

335+
const suggestCta = (
336+
<ButtonLink
337+
href={suggestUrl}
338+
variant="outline"
339+
size="sm"
340+
className="w-full shrink-0"
341+
hideArrow
342+
>
343+
{labels.suggestButton}
344+
</ButtonLink>
345+
)
346+
332347
return (
333348
<Section id="catalog" className="space-y-5">
334349
<div className="grid grid-cols-1 gap-8 lg:grid-cols-[280px_1fr]">
335350
<aside className="hidden lg:block">
336-
<div className="sticky top-24 space-y-4">
351+
<div className="sticky top-24 flex max-h-[calc(100vh-8rem)] flex-col gap-4">
337352
<Input
338353
value={search}
339354
onChange={(event) => setSearch(event.target.value)}
340355
placeholder={labels.searchPlaceholder}
341-
className="w-full"
356+
className="w-full shrink-0"
342357
/>
343-
<div className="max-h-[calc(100vh-11rem)] overflow-y-auto rounded-xl border p-2">
358+
<div className="min-h-0 overflow-y-auto rounded-xl border p-2">
344359
{sidebar}
345360
</div>
361+
{suggestCta}
346362
</div>
347363
</aside>
348364

@@ -355,6 +371,7 @@ export default function ToolsCatalog({
355371
className="w-full"
356372
/>
357373
<div className="rounded-xl border p-2">{sidebar}</div>
374+
{suggestCta}
358375
</div>
359376
<div ref={resultsTopRef} className="scroll-mt-24" />
360377
{(currentCategoryId || selectedSubcategoryId) && (

app/[locale]/developers/tools/_components/ToolsPageBody.tsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { getTranslations } from "next-intl/server"
22

33
import ContentFeedback from "@/components/ContentFeedback"
44
import MainArticle from "@/components/MainArticle"
5-
import { ButtonLink } from "@/components/ui/buttons/Button"
65
import { Section } from "@/components/ui/section"
76

87
import type {
@@ -65,20 +64,10 @@ const ToolsPageBody = async ({
6564
allCategories: t("page-developers-tools-categories-title"),
6665
resultsLabel: t("page-developers-tools-results-label"),
6766
noResults: t("page-developers-tools-no-results"),
67+
suggestButton: t("page-developers-tools-suggest-resource-button"),
6868
}}
69+
suggestUrl={SUGGEST_RESOURCE_ISSUE_URL}
6970
/>
70-
<div className="flex flex-col items-center gap-4 rounded-base bg-radial-a p-12">
71-
<h2>{t("page-developers-tools-suggest-resource-title")}</h2>
72-
<p>{t("page-developers-tools-suggest-resource-description")}</p>
73-
<ButtonLink
74-
href={SUGGEST_RESOURCE_ISSUE_URL}
75-
variant="outline"
76-
className="w-fit"
77-
hideArrow
78-
>
79-
{t("page-developers-tools-suggest-resource-button")}
80-
</ButtonLink>
81-
</div>
8271
</MainArticle>
8372

8473
<Section className="px-page">

0 commit comments

Comments
 (0)