Files
paseo/packages/website/src/plugins/window-switch.tsx
T
Mohamed Boudra c062280429 Ship the plugin directory redesign and keep registry installs behind a daemon flag (#6080)
* website: plugin page design mockups (four directions, throwaway routes)

* website: final plugin page mockup (A directory, B browse frame, list cards, D detail)

* website: browse pages use a four-column card grid in the final plugin mockup

* feat(plugins): keep registry installs behind a daemon flag, off by default

Off restores the pre-registry behavior: bare owner/repo is GitHub shorthand and the
daemon never resolves or contacts a registry on install, update preview, or update.
Enable with pluginRegistryEnabled: true or PASEO_PLUGIN_REGISTRY_ENABLED=1.

* feat(website): ship the plugin directory, browse pages, and single-column detail

Directory: count, build/submit links, What's new, the nine categories, and Most installed
with a This week / This month / All time switch. Browse pages at /plugins/all and
/plugins/category/<slug> with a category sidebar, tabs, and a four-column grid; old
/plugins?category= links redirect. Install counts gain daily KV buckets kept 60 days.

* fix(website): keep a README's leading GitHub alert on the plugin page

* feat(website): search plugins from the directory and browse pages

Typing replaces the URL with /plugins/all?q=<term> (or the current category
with ?q=), which renders matching plugins on the server. Matching covers
name, description, ID, and author. Old /plugins?q= links redirect.

* fix(website): keep the directory's ranking window when searching
2026-10-04 20:38:39 +01:00

36 lines
970 B
TypeScript

import type { InstallWindow } from "./installs";
const WINDOWS: { value: InstallWindow; label: string }[] = [
{ value: "week", label: "This week" },
{ value: "month", label: "This month" },
{ value: "all", label: "All time" },
];
/** Plain text time-window switch for install rankings. */
export function WindowSwitch({
current,
hrefs,
}: {
current: InstallWindow;
hrefs: Record<InstallWindow, string>;
}) {
return (
<nav aria-label="Time window" className="flex items-baseline gap-4 text-sm">
{WINDOWS.map((option) => (
<a
key={option.value}
href={hrefs[option.value]}
aria-current={option.value === current ? "true" : undefined}
className={
option.value === current
? "text-foreground"
: "text-extra-muted-foreground transition-colors hover:text-muted-foreground"
}
>
{option.label}
</a>
))}
</nav>
);
}