-
-
-
{plugin.name}
-
Added {added}
-
+
+
+ {plugin.description}
+
+
+
+ {author.name}
+ {children !== undefined && (
+ <>
+ ·
+ {children}
+ >
+ )}
+
);
}
-/** Grid card: screenshot, name, one muted stat, and a two-line description. */
-export function PluginCard({
- plugin,
- installs,
- added,
-}: {
- plugin: Plugin;
- /** Shown with a download icon; otherwise `added` is shown. */
- installs?: number;
- added?: string;
-}) {
+/** Grid card: screenshot; tile, name, and `children` such as an install count; description. */
+export function PluginCard({ plugin, children }: { plugin: Plugin; children?: ReactNode }) {
return (
-
-
-
-
-
{plugin.name}
-
- {installs === undefined ? (
- added
- ) : (
- <>
-
- {formatInstalls(installs)}
- >
- )}
-
-
-
- {plugin.description}
-
-
+
+
+
{plugin.name}
+
{children}
+
+ {plugin.description}
+
);
}
@@ -110,7 +104,9 @@ export function PluginRankRow({
{getCategory(plugin.categories[0])?.label}
- {formatInstalls(installs)}
+
+
+
);
}
diff --git a/packages/website/src/plugins/plugin-tile.tsx b/packages/website/src/plugins/plugin-tile.tsx
index c0fc81d483..5e2dc9c31b 100644
--- a/packages/website/src/plugins/plugin-tile.tsx
+++ b/packages/website/src/plugins/plugin-tile.tsx
@@ -2,6 +2,7 @@ import { pluginOverviewUrl } from "@getpaseo/protocol/plugin-overview";
import type { Plugin } from "./registry";
const SIZE_CLASS = {
+ xs: "h-6 w-6 rounded-md text-xs",
sm: "h-9 w-9 rounded-lg text-sm",
lg: "h-14 w-14 rounded-xl text-xl",
} as const;
diff --git a/packages/website/src/plugins/thumbnails.test.ts b/packages/website/src/plugins/thumbnails.test.ts
index 8769995ca3..fb9a571b93 100644
--- a/packages/website/src/plugins/thumbnails.test.ts
+++ b/packages/website/src/plugins/thumbnails.test.ts
@@ -56,20 +56,20 @@ describe("plugin card thumbnails", () => {
expect(html).not.toContain("/plugins/thumb/");
});
- it.each([PluginCard, NewPluginCard])(
- "renders a thumbnail instead of downloading the original screenshot (%s)",
- (Card) => {
- const html = renderToStaticMarkup(createElement(Card, { plugin, added: "today" }));
- expect(html).toContain(
- `src="/plugins/thumb/592/${encodeURIComponent(source)}?plugin=acme%2Fexample"`,
- );
- expect(html).toContain(
- `srcSet="/plugins/thumb/592/${encodeURIComponent(source)}?plugin=acme%2Fexample 1x, /plugins/thumb/1184/${encodeURIComponent(source)}?plugin=acme%2Fexample 2x"`,
- );
- expect(html).toContain('loading="lazy"');
- expect(html).toContain('decoding="async"');
- },
- );
+ it.each([
+ ["PluginCard", () => createElement(PluginCard, { plugin }, "today")],
+ ["NewPluginCard", () => createElement(NewPluginCard, { plugin }, "today")],
+ ])("renders a thumbnail instead of downloading the original screenshot (%s)", (_name, card) => {
+ const html = renderToStaticMarkup(card());
+ expect(html).toContain(
+ `src="/plugins/thumb/592/${encodeURIComponent(source)}?plugin=acme%2Fexample"`,
+ );
+ expect(html).toContain(
+ `srcSet="/plugins/thumb/592/${encodeURIComponent(source)}?plugin=acme%2Fexample 1x, /plugins/thumb/1184/${encodeURIComponent(source)}?plugin=acme%2Fexample 2x"`,
+ );
+ expect(html).toContain('loading="lazy"');
+ expect(html).toContain('decoding="async"');
+ });
});
function thumbnailRequest(
diff --git a/packages/website/src/routes/plugins/$owner.tsx b/packages/website/src/routes/plugins/$owner.tsx
index 0345fa1355..89c4f185ef 100644
--- a/packages/website/src/routes/plugins/$owner.tsx
+++ b/packages/website/src/routes/plugins/$owner.tsx
@@ -16,6 +16,7 @@ import {
} from "~/plugins";
import { AuthorAvatar } from "~/plugins/author-link";
import { PluginsNotFound } from "~/plugins/not-found";
+import { InstallCount } from "~/plugins/install-count";
import { PluginCard } from "~/plugins/plugin-card";
import "~/styles.css";
@@ -82,7 +83,9 @@ function AuthorPage() {
{plugins.map((plugin) => (
-
+
+
+
))}
diff --git a/packages/website/src/routes/plugins/$owner_.$slug.tsx b/packages/website/src/routes/plugins/$owner_.$slug.tsx
index 9ea61f3248..5bb1c73a1e 100644
--- a/packages/website/src/routes/plugins/$owner_.$slug.tsx
+++ b/packages/website/src/routes/plugins/$owner_.$slug.tsx
@@ -6,7 +6,6 @@ import { SiteShell } from "~/components/site-shell";
import { pageMeta } from "~/meta";
import {
firstMediaImage,
- formatInstalls,
getAuthor,
getCategory,
getRegistry,
@@ -16,7 +15,8 @@ import {
pluginVersion,
readmeBody,
} from "~/plugins";
-import { AuthorLink } from "~/plugins/author-link";
+import { AuthorAvatar, AuthorLink } from "~/plugins/author-link";
+import { InstallCount } from "~/plugins/install-count";
import { categoryHref } from "~/plugins/links";
import { MediaGallery } from "~/plugins/media-gallery";
import { PluginsNotFound } from "~/plugins/not-found";
@@ -48,6 +48,8 @@ export const Route = createFileRoute("/plugins/$owner_/$slug")({
const META_LINK_CLASS =
"inline-flex items-center gap-1 text-xs text-extra-muted-foreground transition-colors hover:text-muted-foreground";
+const AUTHOR_LINK_CLASS =
+ "inline-flex items-center gap-1.5 text-xs text-extra-muted-foreground transition-colors hover:text-muted-foreground";
function PluginPage() {
const { plugin, installs } = Route.useLoaderData();
@@ -67,7 +69,8 @@ function PluginPage() {
{installCommand(plugin)}