Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

fix(public): fetch actual stars

Carl-Gerhard Lindesvärdb452eab3af5c
diff --git a/apps/public/components/github-button.tsx b/apps/public/components/github-button.tsx
index a5461d337..82fff4c8d 100644
--- a/apps/public/components/github-button.tsx
+++ b/apps/public/components/github-button.tsx
@@ -1,7 +1,8 @@
'use client';
+import { getGithubRepoInfo } from '@/lib/github';
import Link from 'next/link';
-import { useState } from 'react';
+import { useEffect, useState } from 'react';
import { Button } from './ui/button';
function formatStars(stars: number) {
@@ -13,10 +14,10 @@ function formatStars(stars: number) {
}
export function GithubButton() {
- const [stars, setStars] = useState(3_100);
- // useEffect(() => {
- // getGithubRepoInfo().then((res) => setStars(res.stargazers_count));
- // }, []);
+ const [stars, setStars] = useState(3_263);
+ useEffect(() => {
+ getGithubRepoInfo().then((res) => setStars(res.stargazers_count));
+ }, []);
return (
<Button variant={'secondary'} asChild>
<Link href="https://git.new/openpanel" className="hidden md:flex">