From ae71b05955c7713c501e99972430583623669550 Mon Sep 17 00:00:00 2001 From: Aryan Sharma Date: Mon, 22 Jun 2026 00:44:51 +0530 Subject: [PATCH] feat: improve website header UI and add dynamic github stars --- website/next.config.ts | 5 ++++- website/src/app/page.tsx | 34 ++++++++++++++++++++++++++++++---- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/website/next.config.ts b/website/next.config.ts index e9ffa30..66440d0 100644 --- a/website/next.config.ts +++ b/website/next.config.ts @@ -1,7 +1,10 @@ import type { NextConfig } from "next"; +import pkg from "../packages/smooth-api-ts/package.json"; const nextConfig: NextConfig = { - /* config options here */ + env: { + NEXT_PUBLIC_TS_PKG_VERSION: pkg.version, + }, }; export default nextConfig; diff --git a/website/src/app/page.tsx b/website/src/app/page.tsx index 9f622ae..26c9c37 100644 --- a/website/src/app/page.tsx +++ b/website/src/app/page.tsx @@ -30,6 +30,18 @@ type SimLog = { export default function Home() { const [activeSection, setActiveSection] = useState("introduction"); const [codeLang, setCodeLang] = useState<"ts" | "py">("ts"); + const [githubStars, setGithubStars] = useState(null); + + useEffect(() => { + fetch("https://api.github.com/repos/AryanSharma48/smoothAPI") + .then((res) => res.json()) + .then((data) => { + if (typeof data.stargazers_count === "number") { + setGithubStars(data.stargazers_count); + } + }) + .catch((err) => console.error("Failed to fetch github stars:", err)); + }, []); /* // Simulator States @@ -164,14 +176,28 @@ export default function Home() {
{/* STICKY HEADER */} -
+
window.scrollTo({ top: 0, behavior: "smooth" })}> - SmoothAPI Logo + SmoothAPI Logo