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
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 @@ -135,7 +135,7 @@
return Array.from(networkMap.values()).sort((a, b) => (b.totalPoints || 0) - (a.totalPoints || 0));
}, [connections.followers, connections.following, currentUser, userData]);

const activeDevelopers = activeTab === "leaderboard" ? leaderboardStandings : connections[activeTab] || [];

Check warning on line 138 in src/pages/Friends.jsx

View workflow job for this annotation

GitHub Actions / Lint Check

The 'activeDevelopers' conditional could make the dependencies of useMemo Hook (at line 144) change on every render. Move it inside the useMemo callback. Alternatively, wrap the initialization of 'activeDevelopers' in its own useMemo() Hook
const filteredDevelopers = React.useMemo(() => {
return activeDevelopers.filter(dev => {
if (selectedCollege === "All") return true;
Expand Down Expand Up @@ -279,12 +279,25 @@
) : (
<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
Loading