Skip to content

Commit 7238ab2

Browse files
optimised
1 parent fd25346 commit 7238ab2

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

src/components/ourProjects.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,15 @@ const HeadingComponent = ({
9595
);
9696
};
9797

98+
// Project URLs configuration
99+
const PROJECT_URLS: Record<string, string> = {
100+
"Awesome GitHub Profile": "https://recodehive.github.io/awesome-github-profiles/",
101+
"Machine Learning Repository": "https://machine-learning-repos.vercel.app/"
102+
};
103+
98104
// Helper function to get website URLs
99105
const getWebsiteUrl = (title: string) => {
100-
const urls = {
101-
"Awesome GitHub Profile": "https://recodehive.github.io/awesome-github-profiles/",
102-
"Machine Learning Repository": "https://machine-learning-repos.vercel.app/"
103-
};
104-
return urls[title] || "https://github.com/recodehive";
106+
return PROJECT_URLS[title] || "https://github.com/recodehive";
105107
};
106108

107109
// Select Component
@@ -312,10 +314,7 @@ const SelectComponent = ({
312314
>
313315
<motion.iframe
314316
key={activeItem}
315-
src={items[activeItem].title === "Awesome GitHub Profile"
316-
? "https://recodehive.github.io/awesome-github-profiles/"
317-
: "https://machine-learning-repos.vercel.app/"
318-
}
317+
src={PROJECT_URLS[items[activeItem].title] || "about:blank"}
319318
className="w-full h-[200%] border-0 origin-top pointer-events-none"
320319
initial={{ opacity: 0, y: 0 }}
321320
animate={{
@@ -326,7 +325,7 @@ const SelectComponent = ({
326325
opacity: { duration: 0.8 },
327326
y: { duration: 8, repeat: Infinity, ease: "easeInOut" }
328327
}}
329-
sandbox="allow-scripts allow-same-origin allow-popups allow-forms"
328+
sandbox="allow-scripts allow-popups allow-forms"
330329
/>
331330
</motion.div>
332331
) : (

src/pages/dashboard/giveaway/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,12 +461,12 @@ const GiveawayPage: React.FC = () => {
461461
}, []);
462462

463463
const handleTabChange = (
464-
tab: "home" | "discuss" | "leaderboard" | "giveaway"
464+
tab: "home" | "discuss" | "contributors" | "giveaway"
465465
) => {
466466
setIsMobileSidebarOpen(false);
467467
if (tab === "discuss") {
468468
history.push("/dashboard#discuss");
469-
} else if (tab === "leaderboard") {
469+
} else if (tab === "contributors") {
470470
history.push("/dashboard#contributors");
471471
} else if (tab === "home") {
472472
history.push("/dashboard");
@@ -561,12 +561,12 @@ const GiveawayPage: React.FC = () => {
561561
</li>
562562
<li
563563
className="nav-item"
564-
onClick={() => handleTabChange("leaderboard")}
564+
onClick={() => handleTabChange("contributors")}
565565
>
566566
<span className="nav-icon">
567567
<Trophy size={18} />
568568
</span>
569-
<span className="nav-text">Leaderboard</span>
569+
<span className="nav-text">Contributors</span>
570570
</li>
571571
</ul>
572572
<div className="sidebar-footer">

src/pages/dashboard/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ const DashboardContent: React.FC = () => {
238238
];
239239
setLeaderboardData(initialData);
240240
}
241-
}, []);
241+
}, [leaderboardData.length]);
242242

243243
// Discussion handlers
244244
const handleDiscussionTabChange = (tab: DiscussionTab) => {

0 commit comments

Comments
 (0)