From d675b228c67951f64611024a047602a36cd8a30d Mon Sep 17 00:00:00 2001 From: mudabbir-ahmad Date: Sun, 16 Mar 2025 21:02:10 +0000 Subject: [PATCH] just need to fix the map to clue function. --- app/(main)/leaderboard/page.js | 101 ++++++++++++++++++++++----------- app/(main)/map/page.js | 36 ++++++++++-- clue_hunt.db | Bin 86016 -> 86016 bytes 3 files changed, 100 insertions(+), 37 deletions(-) diff --git a/app/(main)/leaderboard/page.js b/app/(main)/leaderboard/page.js index c07a06f..cdf45af 100644 --- a/app/(main)/leaderboard/page.js +++ b/app/(main)/leaderboard/page.js @@ -12,7 +12,7 @@ export default function LeaderboardPage() { const searchParams = useSearchParams(); const huntJustEnded = searchParams.get("huntEnded") === "true"; const router = useRouter(); - const { status } = useSession(); + const { data: session, status } = useSession(); // Fix: Properly destructure session from useSession() // Function to fetch leaderboard data const fetchLeaderboard = async () => { @@ -70,7 +70,9 @@ export default function LeaderboardPage() {
-
Leaderboard
+
+ {huntJustEnded ? "Final Results" : "Leaderboard"} +
{huntJustEnded && ( @@ -156,32 +158,46 @@ export default function LeaderboardPage() {
No teams on the leaderboard yet
)} - {/* Navigation Bar */} -
- -
πŸ—ΊοΈ
-
Map
- - -
πŸ“Š
-
Stats
- - 0 && session?.user?.teamId - ? `/${session.user.teamId}` - : "/team-selection" - } - className="nav-item" - > -
πŸ‘₯
-
Team
- - -
πŸ†
-
Leaderboard
- -
+ {/* Only show navigation bar when the hunt hasn't ended */} + {!huntJustEnded && ( +
+ +
πŸ—ΊοΈ
+
Map
+ + +
πŸ“Š
+
Stats
+ + +
πŸ‘₯
+
Team
+ + +
πŸ†
+
Leaderboard
+ +
+ )} + + {/* Add a "back to home" button when the hunt has ended */} + {huntJustEnded && ( +
+ +
+ )}