Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />

<!-- Google Fonts (clean way) -->
<link rel="preconnect" href="https://fonts.googleapis.com">
Expand Down
10 changes: 10 additions & 0 deletions src/components/layout/PublicNavbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ export const PublicNavbar = () => {
const navRef = useRef(null);
const glareRef = useRef(null);

useEffect(() => {
const handleClickOutside = (event) => {
if (mobileExpanded && navRef.current && !navRef.current.contains(event.target)) {
setMobileExpanded(false);
}
};
document.addEventListener("mousedown", handleClickOutside);
return () => document.removeEventListener("mousedown", handleClickOutside);
}, [mobileExpanded]);

// Function to update the pill position and width
const updatePill = (index, smooth = true) => {
const btn = buttonRefs.current[index];
Expand Down
2 changes: 1 addition & 1 deletion src/context/AuthContext.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const checkAndUpdateStreak = async (data, docRef) => {
lastLogin: currentNow.toISOString(),
"points.streakPoints": newStreakPoints,
"points.totalPoints": newTotalPoints,
hubCoins: (data.hubCoins || 0) + 10
hubCoins: (latestData.hubCoins || 0) + 10
});
});
} catch (err) {
Expand Down
1 change: 1 addition & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
min-height: 100vh !important;
display: block !important;
text-align: left !important;
padding-bottom: env(safe-area-inset-bottom, 0px) !important;
}
}

Expand Down
12 changes: 8 additions & 4 deletions src/pages/CardBuilder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ const CardBuilder = () => {

const markdownCode = `[![RankerHub Stats](${devcardUrl})](${baseUrl}/dashboard/profile/${githubUsername})`;

const handleCopy = () => {
navigator.clipboard.writeText(markdownCode);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
const handleCopy = async () => {
try {
await navigator.clipboard.writeText(markdownCode);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
} catch {
setCopied(false);
}
};

return (
Expand Down
19 changes: 16 additions & 3 deletions src/pages/Friends.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,25 @@ export const Friends = () => {
) : (
<Card className="p-8 text-center">
<UsersRound className="w-10 h-10 text-slate-300 dark:text-slate-600 mx-auto mb-3" />
<h3 className="font-black text-slate-900 dark:text-white my-0">No developers here yet</h3>
<p className="text-sm text-slate-500 dark:text-slate-400 mt-1">
{activeTab === "leaderboard"
<h3 className="font-black text-slate-900 dark:text-white my-0">
{activeTab === "friends" ? "No friends yet!" : "No developers here yet"}
</h3>
<p className="text-sm text-slate-500 dark:text-slate-400 mt-1 mb-5">
{activeTab === "friends"
? "Follow other developers to grow your friend circle and see their activity here."
: activeTab === "leaderboard"
? "Follow other developers to populate your Friends Leaderboard."
: "Follow developers from suggestions to grow this section instantly."}
</p>
{activeTab === "friends" && (
<Link
to="/dashboard/friends/leaderboard"
className="inline-flex items-center gap-2 px-4 py-2 rounded-xl text-sm font-extrabold text-white bg-gradient-to-r from-violet-600 to-indigo-600 border border-violet-500 shadow-[0_4px_15px_rgba(124,58,237,0.25)] hover:shadow-[0_6px_20px_rgba(124,58,237,0.35)] transition-all"
>
<Trophy className="w-4 h-4" />
Discover Developers
</Link>
)}
</Card>
)}
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/utils/firestoreOptimization.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ export class FirestoreBatchOptimizer {

// Flush if batch is full
if (this.batch.length >= this.maxBatchSize) {
this.flush();
this.flush().catch((err) => {
console.error("Batch flush failed:", err);
});
return;
}

Expand Down