setIsOpen(false)}
+ />
+ )}
+
+
+ {/* Close button (mobile) */}
+
setIsOpen(false)}
+ className="absolute top-4 right-4 p-1 rounded-lg hover:bg-theme-tertiary text-theme-secondary transition-colors lg:hidden"
+ >
+
+
+
+ {/* Logo */}
+
+
+
+
+ {/* Sidebar Nav Links */}
+
+ {sidebarLinks.map((link) => {
+ const Icon = link.icon;
+ const active = isActive(link.href);
+ return (
+ setIsOpen(false)}
+ >
+
+ {link.label}
+ {active && (
+
+ )}
+
+ );
+ })}
+
+
+ {/* Divider */}
+
+
+ {/* Mobile-only: extra nav links */}
+
+ {navLinks.map((link) => {
+ const Icon = link.icon;
+ const active = isActive(link.href);
+ return (
+ setIsOpen(false)}
+ >
+
+ {link.label}
+
+ );
+ })}
+
+
+ {/* Theme toggle at bottom */}
+
+
+ {isDark ? : }
+ {isDark ? "Light Mode" : "Dark Mode"}
+
+
+
+
+ {/* ===== MAIN CONTENT ===== */}
+
+ {/* Header */}
+
+
+ {/* Hamburger */}
+
+
+
+
+ {/* Logo (desktop) */}
+
+
+ {/* Desktop nav links */}
+
+ {navLinks.map((link) => {
+ const active = isActive(link.href);
+ return (
+
+ {link.label}
+
+ );
+ })}
+
+
+
+ {/* Right side */}
+
+ {/* Theme toggle (desktop) */}
+
+ {isDark ? : }
+
+
+ {/* Create Project */}
+
{
+ router.push(`/project/create/${user?.id}`);
+ }}
+ className="flex items-center gap-2 bg-gradient-to-r from-brand-500 to-purple-600 hover:from-brand-600 hover:to-purple-700 text-white px-4 py-2 rounded-lg text-sm font-medium transition-all duration-200 shadow-md hover:shadow-lg active:scale-[0.98]"
+ >
+
+ Create Project
+
+
+ {/* Notifications */}
+ {user && (
+
+
+ {unreadCount > 0 && (
+
+ )}
+
+ )}
+
+ {/* User */}
+ {user ? (
+
+
+
+
+
+
+ ) : (
+
+ )}
+
+
+
+
{children}
+
>
);
}
diff --git a/app/(root)/leaderboard/c/page.tsx b/app/(root)/leaderboard/c/page.tsx
index bc50987..620a58b 100644
--- a/app/(root)/leaderboard/c/page.tsx
+++ b/app/(root)/leaderboard/c/page.tsx
@@ -4,9 +4,9 @@ const page = () => {
const data = [
{
rank: "#1",
- name: "Pranav Ramane",
+ name: "Mayur Tummewar",
institute: "Pimpri Chinchwad College of Engineering & Research",
- points: 3000,
+ points: 69420,
},
{
rank: "#2",
@@ -28,19 +28,19 @@ const page = () => {
},
{
rank: "#5",
- name: "Mayur Tummewar",
+ name: "Pranav Ramane",
institute: "Pimpri Chinchwad College of Engineering & Research",
points: 3000,
},
{
- rank: "#2",
- name: "Adarsh Thakare",
+ rank: "#6",
+ name: "Udit Padhye",
institute: "Pimpri Chinchwad College of Engineering & Research",
points: 3000,
},
{
- rank: "#3",
- name: "Prajyot Tayde",
+ rank: "#7",
+ name: "Vansh Khakule",
institute: "Pimpri Chinchwad College of Engineering & Research",
points: 3000,
},
diff --git a/app/(root)/leaderboard/layout.tsx b/app/(root)/leaderboard/layout.tsx
index e87cd23..b564801 100644
--- a/app/(root)/leaderboard/layout.tsx
+++ b/app/(root)/leaderboard/layout.tsx
@@ -2,103 +2,59 @@
import Link from "next/link";
import { usePathname } from "next/navigation";
import React from "react";
+import { Trophy } from "lucide-react";
+import { motion } from "framer-motion";
+
+const ranks = [
+ { href: "/leaderboard/s", label: "S", color: "text-amber-500", activeBg: "bg-amber-500/10 dark:bg-amber-500/15", activeBorder: "border-amber-500" },
+ { href: "/leaderboard/a+", label: "A+", color: "text-red-500", activeBg: "bg-red-500/10 dark:bg-red-500/15", activeBorder: "border-red-500" },
+ { href: "/leaderboard/a", label: "A", color: "text-red-400", activeBg: "bg-red-400/10 dark:bg-red-400/15", activeBorder: "border-red-400" },
+ { href: "/leaderboard/b+", label: "B+", color: "text-blue-500", activeBg: "bg-blue-500/10 dark:bg-blue-500/15", activeBorder: "border-blue-500" },
+ { href: "/leaderboard/b", label: "B", color: "text-blue-400", activeBg: "bg-blue-400/10 dark:bg-blue-400/15", activeBorder: "border-blue-400" },
+ { href: "/leaderboard/c", label: "C", color: "text-purple-500", activeBg: "bg-purple-500/10 dark:bg-purple-500/15", activeBorder: "border-purple-500" },
+ { href: "/leaderboard/d", label: "D", color: "text-green-500", activeBg: "bg-green-500/10 dark:bg-green-500/15", activeBorder: "border-green-500" },
+ { href: "/leaderboard/e", label: "E", color: "text-gray-500", activeBg: "bg-gray-500/10 dark:bg-gray-500/15", activeBorder: "border-gray-500" },
+];
const LeaderboardLayout = ({ children }: { children: React.ReactNode }) => {
const pathname = usePathname();
+
return (
-
-
Leaderboard
+
+
+
+ Leaderboard
+
+
+ {/* Rank tabs */}
+
+ {ranks.map((rank) => {
+ const active = pathname === rank.href;
+ return (
+
+
+ {rank.label}
+
+
+ );
+ })}
+
-
-
-
- S Rank
-
-
-
-
- A+ Rank
-
-
-
-
- A Rank
-
-
-
-
- B+ Rank
-
-
-
-
- B Rank
-
-
-
-
- C Rank
-
-
-
-
- D Rank
-
-
-
-
- E Rank
-
-
-
{children}
);
diff --git a/app/(root)/leaderboard/page.tsx b/app/(root)/leaderboard/page.tsx
index 11f3dde..741a4db 100644
--- a/app/(root)/leaderboard/page.tsx
+++ b/app/(root)/leaderboard/page.tsx
@@ -1,83 +1,121 @@
-import React from "react";
+"use client";
+import React, { useEffect, useState } from "react";
+import { motion } from "framer-motion";
+import { Medal, Trophy } from "lucide-react";
+import axios from "axios";
-const page = () => {
- const data = [
- {
- rank: "#1",
- name: "Pranav Ramane",
- institute: "Pimpri Chinchwad College of Engineering & Research",
- points: 3000,
- },
- {
- rank: "#2",
- name: "Adarsh Thakare",
- institute: "Pimpri Chinchwad College of Engineering & Research",
- points: 3000,
- },
- {
- rank: "#3",
- name: "Prajyot Tayde",
- institute: "Pimpri Chinchwad College of Engineering & Research",
- points: 3000,
- },
- {
- rank: "#4",
- name: "Rohit Tare",
- institute: "Pimpri Chinchwad College of Engineering & Research",
- points: 3000,
- },
- {
- rank: "#5",
- name: "Mayur Tummewar",
- institute: "Pimpri Chinchwad College of Engineering & Research",
- points: 3000,
- },
+interface LeaderboardUser {
+ _id: string;
+ rank: string;
+ name: string;
+ institute: string;
+ points: number;
+ profilePic?: string;
+}
- // Add more data here
- ];
- return (
- <>
-
- {/* Table Head */}
-
-
-
- Rank
-
-
- User Name
-
-
- User Institute
-
-
- Points
-
-
-
+const medalColors: Record = {
+ "#1": "text-amber-400",
+ "#2": "text-gray-400",
+ "#3": "text-amber-600",
+};
+
+const Page = () => {
+ const [data, setData] = useState([]);
+ const [loading, setLoading] = useState(true);
- {/* Table Body */}
-
- {data.map((user, index) => (
-
-
- {user.rank}
-
-
- {user.name}
-
-
- {user.institute}
-
-
- {user.points}
-
+ useEffect(() => {
+ const fetchLeaderboard = async () => {
+ try {
+ const response = await axios.get("/api/leaderboard");
+ setData(response.data);
+ } catch (error) {
+ console.error("Error fetching leaderboard", error);
+ } finally {
+ setLoading(false);
+ }
+ };
+ fetchLeaderboard();
+ }, []);
+
+ if (loading) {
+ return (
+
+
+
+
+ {[1, 2, 3, 4, 5].map((i) => (
+
+
+
+
+
+
+ ))}
+
+
+
+
+ );
+ }
+
+ return (
+
+
+
+ Leaderboard
+
+
+
+
+
+
+ Rank
+ User Name
+ Institute
+ Points
- ))}
-
-
- >
+
+
+ {data.length === 0 ? (
+
+
+ No data available for this rank yet.
+
+
+ ) : (
+ data.map((user, index) => (
+
+
+
+ {medalColors[user.rank] && (
+
+ )}
+ {user.rank}
+
+
+ {user.name}
+ {user.institute}
+
+ {user.points.toLocaleString()}
+
+
+ ))
+ )}
+
+
+
+
);
};
-export default page;
+export default Page;
diff --git a/app/(root)/notification/[id]/page.tsx b/app/(root)/notification/[id]/page.tsx
index 4e4dac4..594ad63 100644
--- a/app/(root)/notification/[id]/page.tsx
+++ b/app/(root)/notification/[id]/page.tsx
@@ -1,52 +1,107 @@
"use client";
import { useParams } from "next/navigation";
-import React from "react";
-import { FaUser } from "react-icons/fa";
-const dummyEmails = [
- {
- id: "1",
- sender: "Radhika Gupta",
- subject: "New Post for You",
- body: "To every woman who sometimes wonders, can I do it, here is a thought...",
- date: "March 17, 2025",
- },
- {
- id: "2",
- sender: "Nikhil Kamath",
- subject: "Indian Market Insights",
- body: "Digressing from the post, but it's about time we need an Indian answer to...",
- date: "March 14, 2025",
- },
- {
- id: "3",
- sender: "Nikhil Kamath",
- subject: "Indian Market Trends",
- body: "Digressing from the post, but it's about time we need an Indian answer to...",
- date: "March 12, 2025",
- },
-];
+import React, { useEffect, useState } from "react";
+import { ArrowLeft, Clock } from "lucide-react";
+import Link from "next/link";
+import axios from "axios";
+
+interface Notification {
+ _id: string;
+ type: string;
+ title: string;
+ message: string;
+ createdAt: string;
+}
const EmailDetailsPage = () => {
- const params = useParams();
- const email = dummyEmails.find((item) => item.id === params.id);
+ const params = useParams();
+ const [notification, setNotification] = useState