Skip to content

Commit 7b361c1

Browse files
committed
Merge branch 'milestone-d4' of https://github.com/CS3219-AY2425S1/cs3219-ay2425s1-project-g15 into jehou/questiondb
# Conflicts: # frontend/src/app/(auth)/leetcode-dashboard/LeetcodeDashboardTable.tsx
2 parents 8695d31 + e559a2d commit 7b361c1

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

frontend/src/api/leetcode-dashboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { QuestionAll, QuestionFull, NewQuestionData } from "@/types/find-match";
22

33
const QUESTION_SERVICE =
44
process.env.NEXT_PUBLIC_QUESTION_SERVICE ||
5-
"https://question-service-598285527681.us-central1.run.app/api";
5+
"https://question-service-2-598285527681.us-central1.run.app/api";
66

77
export const createSingleLeetcodeQuestion = async (
88
data: NewQuestionData

frontend/src/app/(auth)/leetcode-dashboard/LeetcodeDashboardTable.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ export function LeetcodeDashboardTable({
231231
}, [
232232
refreshKey,
233233
pagination.pageIndex,
234+
pagination.pageSize,
234235
searchTitle,
235236
searchDifficulty,
236237
searchTopic,

frontend/src/app/(home)/components/navbar/Navbar.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
import React from "react";
1+
import React, { useEffect, useState } from "react";
22
import Link from "next/link";
33
import Header from "@/components/ui/Header";
44

55
const Navbar = () => {
6-
const isActive = (path: string) => window.location.pathname === path;
6+
const [currentPath, setCurrentPath] = useState("");
7+
8+
useEffect(() => {
9+
// Update the state with the current pathname on the client side
10+
setCurrentPath(window.location.pathname);
11+
}, []);
12+
13+
const isActive = (path: string) => currentPath === path;
714
return (
815
<nav className="flex justify-between items-center p-4 bg-gray-900">
916
<div className="flex-shrink-0">
1017
<Header />
1118
</div>
1219

1320
<div className="flex space-x-6">
14-
<Link href="/home" className={`text-primary-300 hover:underline ${isActive("/") ? "opacity-100" : "opacity-50 hover:opacity-100"}`}>
21+
<Link href="/" className={`text-primary-300 hover:underline ${isActive("/") ? "opacity-100" : "opacity-50 hover:opacity-100"}`}>
1522
Home
1623
</Link>
1724
<Link href="" className={`text-primary-300 hover:underline ${isActive("/about") ? "opacity-100" : "opacity-50 hover:opacity-100"}`}>

0 commit comments

Comments
 (0)