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
8 changes: 7 additions & 1 deletion src/components/layout/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const Navbar = ({ toggleMobile, isMobileOpen }) => {
return "Good evening";
})();
const notificationRef = useRef(null);
const notificationToggleRef = useRef(false);
const navigate = useNavigate();

const hasSearchQuery = searchQuery.trim().length > 0;
Expand Down Expand Up @@ -283,7 +284,12 @@ export const Navbar = ({ toggleMobile, isMobileOpen }) => {
<motion.button
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
onClick={() => setShowNotifications(!showNotifications)}
onClick={() => {
if (notificationToggleRef.current) return;
notificationToggleRef.current = true;
setShowNotifications(prev => !prev);
setTimeout(() => { notificationToggleRef.current = false; }, 300);
}}
className="p-2 rounded-xl border border-slate-200/50 dark:border-slate-800/50 bg-white/80 dark:bg-slate-900/80 backdrop-blur-md text-slate-700 dark:text-slate-300 w-10 h-10 flex items-center justify-center cursor-pointer hover:shadow-sm relative"
>
<Bell className="w-5 h-5" />
Expand Down
4 changes: 2 additions & 2 deletions src/pages/GitRank.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useEffect, useMemo } from "react";
import { Search, Filter, Star, Trophy, RefreshCw, GitCommit, Calendar, BookOpen, AlertCircle, CheckCircle2, Users, Medal, ShieldCheck } from "lucide-react";

Check warning on line 2 in src/pages/GitRank.jsx

View workflow job for this annotation

GitHub Actions / Lint Check

'ShieldCheck' is defined but never used. Allowed unused vars must match /^React$/u
import { collection, query, doc, where, orderBy, limit, startAfter, onSnapshot, getDocs, runTransaction, serverTimestamp } from "firebase/firestore";
import { useSearchParams } from "react-router-dom";
import { TableVirtuoso } from "react-virtuoso";
Expand Down Expand Up @@ -242,7 +242,7 @@

try {
const eventsRes = await axios.get(
`https://api.github.com/users/${userData.githubUsername}/events`,
`https://api.github.com/users/${encodeURIComponent(userData.githubUsername)}/events`,
{ headers }
);
setEvents(eventsRes.data || []);
Expand All @@ -267,7 +267,7 @@

try {
const reposRes = await axios.get(
`https://api.github.com/users/${userData.githubUsername}/repos?per_page=100&type=owner`,
`https://api.github.com/users/${encodeURIComponent(userData.githubUsername)}/repos?per_page=100&type=owner`,
{ headers }
);
setRepos(reposRes.data || []);
Expand Down
Loading