diff --git a/www/src/components/CTA.tsx b/www/src/components/CTA.tsx index e188d0c..8524a4a 100644 --- a/www/src/components/CTA.tsx +++ b/www/src/components/CTA.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { Button } from './ui/button'; -import { ArrowRight, Star, GitFork, Users } from 'lucide-react'; +import { ArrowRight } from 'lucide-react'; +import { GitHubStats } from './GitHubStats'; export function CTA() { return ( @@ -20,20 +21,7 @@ export function CTA() {

{/* Stats */} -
-
- - 500+ Stars -
-
- - 50+ Forks -
-
- - Active Community -
-
+
- - {/* Additional feature highlights */} -
-
-
- -
-
-

Lightning Fast

-

Optimized for speed

-
-
-
-
- -
-
-

Enterprise Ready

-

Scale with confidence

-
-
-
-
- -
-
-

Full Git Support

-

All features preserved

-
-
-
); diff --git a/www/src/components/GitHubButton.tsx b/www/src/components/GitHubButton.tsx new file mode 100644 index 0000000..21f2f4b --- /dev/null +++ b/www/src/components/GitHubButton.tsx @@ -0,0 +1,39 @@ +import React, { useEffect, useState } from 'react'; +import { Github, Star } from 'lucide-react'; +import { Button } from './ui/button'; + +export function GitHubButton() { + const [stars, setStars] = useState(null); + + useEffect(() => { + const fetchStars = async () => { + try { + const response = await fetch('https://api.github.com/repos/RayLabsHQ/gitea-mirror'); + if (response.ok) { + const data = await response.json(); + setStars(data.stargazers_count); + } + } catch (error) { + console.error('Failed to fetch GitHub stars:', error); + } + }; + + fetchStars(); + }, []); + + return ( + + ); +} \ No newline at end of file diff --git a/www/src/components/GitHubStats.tsx b/www/src/components/GitHubStats.tsx new file mode 100644 index 0000000..681f2ad --- /dev/null +++ b/www/src/components/GitHubStats.tsx @@ -0,0 +1,59 @@ +import React, { useEffect, useState } from 'react'; +import { Star, GitFork, Users } from 'lucide-react'; + +interface GitHubRepo { + stargazers_count: number; + forks_count: number; + open_issues_count: number; +} + +export function GitHubStats() { + const [stats, setStats] = useState(null); + const [loading, setLoading] = useState(true); + + useEffect(() => { + const fetchStats = async () => { + try { + const response = await fetch('https://api.github.com/repos/RayLabsHQ/gitea-mirror'); + if (response.ok) { + const data = await response.json(); + setStats(data); + } + } catch (error) { + console.error('Failed to fetch GitHub stats:', error); + } finally { + setLoading(false); + } + }; + + fetchStats(); + }, []); + + if (loading) { + return ( +
+
+ + Loading... +
+
+ ); + } + + return ( +
+
+ + {stats?.stargazers_count || 0} Stars +
+
+ + {stats?.forks_count || 0} Forks +
+
+ + Active Community +
+
+ ); +} \ No newline at end of file diff --git a/www/src/components/Header.tsx b/www/src/components/Header.tsx index 9914241..1cec3c0 100644 --- a/www/src/components/Header.tsx +++ b/www/src/components/Header.tsx @@ -1,7 +1,8 @@ import React, { useState, useEffect } from 'react'; import { ThemeToggle } from './ThemeToggle'; -import { Github, Menu, X } from 'lucide-react'; +import { Menu, X } from 'lucide-react'; import { Button } from './ui/button'; +import { GitHubButton } from './GitHubButton'; export function Header() { const [isMenuOpen, setIsMenuOpen] = useState(false); @@ -58,12 +59,7 @@ export function Header() { {/* Desktop Actions */}
- +
{/* Mobile Actions */} @@ -103,12 +99,7 @@ export function Header() { ))}
- +