@@ -21,53 +21,63 @@ import {
2121import { IoMdShareAlt } from 'react-icons/io' ;
2222import { SiDevdotto } from 'react-icons/si' ;
2323
24- // Removed duplicate import to avoid redeclaration of SupportersComponent
24+ // Timer component is commented out for now, but can be uncommented if needed
25+
26+ // const CountdownTimer = () => {
27+ // const [timeLeft, setTimeLeft] = useState('');
28+
29+ // useEffect(() => {
30+ // const targetDate = new Date('April 17, 2025 20:00:00').getTime();
31+
32+ // const interval = setInterval(() => {
33+ // const now = new Date().getTime();
34+ // const difference = targetDate - now;
35+
36+ // if (difference <= 0) {
37+ // clearInterval(interval);
38+ // setTimeLeft('v2.0 is here!');
39+ // } else {
40+ // const days = Math.floor(difference / (1000 * 60 * 60 * 24));
41+ // const hours = Math.floor((difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
42+ // const minutes = Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60));
43+ // const seconds = Math.floor((difference % (1000 * 60)) / 1000);
44+
45+ // setTimeLeft(`${days}d ${hours}h ${minutes}m ${seconds}s`);
46+ // }
47+ // }, 1000);
48+
49+ // return () => clearInterval(interval);
50+ // }, []);
51+
52+ // return (
53+ // <div className="my-4 text-center">
54+ // <div className="flex items-center gap-2">
55+ // <h2 className="custom-font text-1xl flex items-center gap-1 font-bold text-gray-400">
56+ // <img
57+ // src="https://raw.githubusercontent.com/Tarikul-Islam-Anik/Animated-Fluent-Emojis/master/Emojis/Travel%20and%20places/High%20Voltage.png"
58+ // alt="High Voltage"
59+ // width="25"
60+ // height="25"
61+ // />
62+ // </h2>
63+ // <p className="custom-font text-1xl text-gray-400">{timeLeft}</p>
64+ // </div>
65+ // </div>
66+ // );
67+ // };
68+
69+ const GITHUB_REPO = 'codeaashu/DevDisplay' ;
2570
26- const CountdownTimer = ( ) => {
27- const [ timeLeft , setTimeLeft ] = useState ( '' ) ;
71+ const Hero = ( ) => {
72+ const [ stars , setStars ] = useState ( null ) ;
2873
2974 useEffect ( ( ) => {
30- const targetDate = new Date ( 'April 17, 2025 20:00:00' ) . getTime ( ) ;
31-
32- const interval = setInterval ( ( ) => {
33- const now = new Date ( ) . getTime ( ) ;
34- const difference = targetDate - now ;
35-
36- if ( difference <= 0 ) {
37- clearInterval ( interval ) ;
38- setTimeLeft ( 'v2.0 is here!' ) ;
39- } else {
40- const days = Math . floor ( difference / ( 1000 * 60 * 60 * 24 ) ) ;
41- const hours = Math . floor ( ( difference % ( 1000 * 60 * 60 * 24 ) ) / ( 1000 * 60 * 60 ) ) ;
42- const minutes = Math . floor ( ( difference % ( 1000 * 60 * 60 ) ) / ( 1000 * 60 ) ) ;
43- const seconds = Math . floor ( ( difference % ( 1000 * 60 ) ) / 1000 ) ;
44-
45- setTimeLeft ( `${ days } d ${ hours } h ${ minutes } m ${ seconds } s` ) ;
46- }
47- } , 1000 ) ;
48-
49- return ( ) => clearInterval ( interval ) ;
75+ fetch ( `https://api.github.com/repos/${ GITHUB_REPO } ` )
76+ . then ( ( res ) => res . json ( ) )
77+ . then ( ( data ) => setStars ( data . stargazers_count ) )
78+ . catch ( ( ) => setStars ( 'N/A' ) ) ;
5079 } , [ ] ) ;
5180
52- return (
53- < div className = "my-4 text-center" >
54- < div className = "flex items-center gap-2" >
55- < h2 className = "custom-font text-1xl flex items-center gap-1 font-bold text-gray-400" >
56- < img
57- src = "https://raw.githubusercontent.com/Tarikul-Islam-Anik/Animated-Fluent-Emojis/master/Emojis/Travel%20and%20places/High%20Voltage.png"
58- alt = "High Voltage"
59- width = "25"
60- height = "25"
61- />
62- </ h2 >
63- < p className = "custom-font text-1xl text-gray-400" > { timeLeft } </ p >
64- </ div >
65- </ div >
66- ) ;
67- } ;
68-
69- // Add the CountdownTimer component before the image
70- const Hero = ( ) => {
7181 return (
7282 < section className = "hero-section mt-20 flex flex-col items-center justify-center text-white sm:min-h-screen" >
7383 < div className = "flex w-full flex-col items-center justify-center px-8 text-center" >
@@ -89,7 +99,7 @@ const Hero = () => {
8999 height = "25"
90100 className = "mx-2 inline-block align-middle"
91101 />
92- 234
102+ { stars !== null ? stars : '...' }
93103 </ div >
94104 </ a >
95105 </ p >
0 commit comments