Skip to content

Commit

Permalink
feat: link to latest release
Browse files Browse the repository at this point in the history
  • Loading branch information
christophwitzko committed Oct 10, 2023
1 parent 7ec4967 commit 76be08b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
16 changes: 6 additions & 10 deletions app/components/PluginCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
Text,
Tooltip,
} from "@radix-ui/themes";
import { formatDistanceToNow } from "date-fns";

import style from "./PluginCard.module.css";
import Link from "next/link";
import { CheckCircledIcon } from "@radix-ui/react-icons";
import { getPlugin } from "@/app/lib/registry";
import { getPlugin } from "../lib/registry";

export async function PluginCard({ name }: { name: string }) {
const plugin = await getPlugin(name);
Expand All @@ -29,14 +29,10 @@ export async function PluginCard({ name }: { name: string }) {
</Heading>
</Flex>
<Flex direction="row" gap="3" justify="end" height="max-content">
<Tooltip content="This is an official go-semantic-release plugin.">
<Badge color="cyan">
<CheckCircledIcon />
official
</Badge>
</Tooltip>
<Tooltip
content={`This is the latest release of the plugin and was published ${plugin.LatestRelease.CreatedAt}.`}
content={`Published ${formatDistanceToNow(
new Date(plugin.LatestRelease.CreatedAt),
)} ago.`}
>
<Badge color="green">v{plugin.LatestRelease.Version}</Badge>
</Tooltip>
Expand Down
1 change: 1 addition & 0 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default async function Home({
searchParams: { s: string | undefined };
}) {
const plugins = await getAllPlugins();
plugins.sort((a, b) => a.localeCompare(b));
const filteredPlugins = plugins.filter(
(p) =>
searchParams.s === undefined || p.includes(searchParams.s.toLowerCase()),
Expand Down

0 comments on commit 76be08b

Please sign in to comment.