From 2b1bd50721fc3de67e9f806adf644c72ffe08f2c Mon Sep 17 00:00:00 2001 From: Emir Karabeg Date: Wed, 5 Mar 2025 21:58:43 -0800 Subject: [PATCH] fix(landing): static stars --- app/(landing)/landing.tsx | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/app/(landing)/landing.tsx b/app/(landing)/landing.tsx index 166cb0df3d..bc03ffc366 100644 --- a/app/(landing)/landing.tsx +++ b/app/(landing)/landing.tsx @@ -1,6 +1,5 @@ 'use client' -import { useEffect, useState } from 'react' import { Star } from 'lucide-react' import { GithubIcon } from '@/components/icons' import HeroWorkflowProvider from './hero-workflow' @@ -43,36 +42,9 @@ const DiscordIcon = () => ( ) -// Fetch outside the component to avoid recreating it on each render -async function fetchGitHubStars() { - try { - const response = await fetch('https://api.github.com/repos/simstudioai/sim', { - next: { revalidate: 3600 }, // Cache for 1 hour - }) - if (response.ok) { - const data = await response.json() - return data.stargazers_count - } - } catch (error) { - console.error('Error fetching GitHub stars:', error) - } - return null -} - -const starCountPromise = fetchGitHubStars() - export default function Landing() { const { width } = useWindowSize() const isMobile = width !== undefined && width < 640 - const [starCount, setStarCount] = useState(null) - - useEffect(() => { - starCountPromise.then((count) => { - if (count !== null) { - setStarCount(count) - } - }) - }, []) return (
@@ -109,12 +81,8 @@ export default function Landing() { >
- {starCount !== null && ( - <> - {starCount} - - - )} + 15 +