From 45b2f62e087a7aeae31e3b019a2e0d6fb3974184 Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Tue, 20 May 2025 15:14:44 +0530 Subject: [PATCH] add github button --- apps/web/src/app/(home)/page.tsx | 50 ++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/apps/web/src/app/(home)/page.tsx b/apps/web/src/app/(home)/page.tsx index a9e528a..d8284b0 100644 --- a/apps/web/src/app/(home)/page.tsx +++ b/apps/web/src/app/(home)/page.tsx @@ -1,8 +1,10 @@ "use client"; import { Button } from "@/components/ui/button"; import { TECH_OPTIONS } from "@/lib/constant"; +import { Github, Star } from "lucide-react"; import { motion } from "motion/react"; import Link from "next/link"; +import { useEffect, useState } from "react"; import FeatureCard from "./_components/FeatureCard"; import CodeContainer from "./_components/code-container"; import Footer from "./_components/footer"; @@ -11,6 +13,30 @@ import SponsorsSection from "./_components/sponsors-section"; import Testimonials from "./_components/testimonials"; export default function HomePage() { + const [stars, setStars] = useState(null); + const [isLoadingStars, setIsLoadingStars] = useState(true); + + useEffect(() => { + async function fetchStars() { + try { + const response = await fetch( + "https://api.github.com/repos/amanvarshney01/create-better-t-stack", + ); + if (response.ok) { + const data = await response.json(); + setStars(data.stargazers_count); + } else { + console.error("Failed to fetch GitHub stars"); + } + } catch (error) { + console.error("Error fetching GitHub stars:", error); + } finally { + setIsLoadingStars(false); + } + } + fetchStars(); + }, []); + const containerVariants = { hidden: { opacity: 0 }, visible: { @@ -125,6 +151,30 @@ export default function HomePage() { Go to Stack Builder + + + {/*