diff --git a/package-lock.json b/package-lock.json index 98febd7..acb7066 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,7 @@ "lucide-static": "^1.7.0", "react": "^19.2.4", "react-dom": "^19.2.4", + "swr": "^2.4.1", "tailwind-merge": "^3.5.0", "vite": "^8.0.3" }, @@ -8861,6 +8862,19 @@ "node": ">=8" } }, + "node_modules/swr": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/swr/-/swr-2.4.1.tgz", + "integrity": "sha512-2CC6CiKQtEwaEeNiqWTAw9PGykW8SR5zZX8MZk6TeAvEAnVS7Visz8WzphqgtQ8v2xz/4Q5K+j+SeMaKXeeQIA==", + "license": "MIT", + "dependencies": { + "dequal": "^2.0.3", + "use-sync-external-store": "^1.6.0" + }, + "peerDependencies": { + "react": "^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/tailwind-merge": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.5.0.tgz", diff --git a/package.json b/package.json index 01b4d94..00be887 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "lucide-static": "^1.7.0", "react": "^19.2.4", "react-dom": "^19.2.4", + "swr": "^2.4.1", "tailwind-merge": "^3.5.0", "vite": "^8.0.3" }, diff --git a/src/lib/layout.shared.tsx b/src/lib/layout.shared.tsx index 8f8f273..214b7ba 100644 --- a/src/lib/layout.shared.tsx +++ b/src/lib/layout.shared.tsx @@ -11,6 +11,5 @@ export function baseOptions(): BaseLayoutProps { ), transparentMode: "top", }, - githubUrl: "https://github.com/OrcaCD/orca-cd", }; } diff --git a/src/routes/docs/$.tsx b/src/routes/docs/$.tsx index 24319d8..672766a 100644 --- a/src/routes/docs/$.tsx +++ b/src/routes/docs/$.tsx @@ -85,7 +85,7 @@ function Page() { const { path, pageTree, markdownUrl } = useFumadocsLoader(Route.useLoaderData()); return ( - + {clientLoader.useContent(path, { markdownUrl, path })} ); diff --git a/src/routes/index.tsx b/src/routes/index.tsx index 649e3e4..a7f7cd4 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -20,6 +20,8 @@ import { NavbarMenuLink, NavbarMenuTrigger, } from "fumadocs-ui/layouts/home/navbar"; +import { GithubInfo } from "fumadocs-ui/components/github-info"; +import useSWR from "swr"; export const Route = createFileRoute("/")({ component: Home, @@ -68,6 +70,12 @@ function SmallFeature({ } function Home() { + const { data, isLoading } = useSWR( + "https://api.github.com/repos/OrcaCD/orca-cd/releases/latest", + // oxlint-disable-next-line promise/prefer-await-to-then + (...args) => fetch(...args).then((res) => res.json()), + ); + return ( ), }, + { + type: "custom", + secondary: true, + children: ( + + {isLoading ? "..." : (data.tag_name ?? "No release yet")} + + ), + }, + { + type: "custom", + secondary: true, + children: , + }, ]} >