Skip to content

Commit 286ceb6

Browse files
committed
Refactor Home and Footer components: comment out CountdownTimer and update Footer links
1 parent 3270af6 commit 286ceb6

2 files changed

Lines changed: 55 additions & 45 deletions

File tree

src/Page/Home.jsx

Lines changed: 53 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -21,53 +21,63 @@ import {
2121
import { IoMdShareAlt } from 'react-icons/io';
2222
import { 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>

src/components/Footer/Footer.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ export const Footer = () => {
5252
>
5353
<i className="fab fa-discord"></i>
5454
</a>
55-
<a
55+
{/* <a
5656
href="https://chat.whatsapp.com/Dcl21sgGDIpHURESSuH0p4"
5757
target="_blank"
5858
rel="noopener noreferrer"
5959
className="transform text-3xl transition-transform hover:scale-110 hover:text-[#00a6fb]"
6060
>
6161
<i className="fab fa-whatsapp"></i>
62-
</a>
62+
</a> */}
6363
<a
6464
href="https://www.linkedin.com/company/devdisplay/"
6565
target="_blank"

0 commit comments

Comments
 (0)