Skip to content

Commit 0cd61d5

Browse files
authored
Merge pull request #81 from CS3219-AY2425S1/development
Milestone D4
2 parents 4d178d4 + c5be563 commit 0cd61d5

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

frontend/src/components/Navbar/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
USE_AUTH_ERROR_MESSAGE,
2222
USE_MATCH_ERROR_MESSAGE,
2323
} from "../../utils/constants";
24-
import { isMatchingPage } from "../../utils/url";
24+
import { isMatchingPage, isCollabPage } from "../../utils/url";
2525
import { useMatch } from "../../contexts/MatchContext";
2626

2727
type NavbarItem = { label: string; link: string; needsLogin: boolean };
@@ -82,7 +82,9 @@ const Navbar: React.FC<NavbarProps> = (props) => {
8282
>
8383
PeerPrep
8484
</Typography>
85-
{!isMatchingPage(path) ? (
85+
{isCollabPage(path) ? (
86+
<></>
87+
) : !isMatchingPage(path) ? (
8688
<Stack direction={"row"} alignItems={"center"} spacing={2}>
8789
{navbarItems
8890
.filter((item) => !item.needsLogin || (item.needsLogin && user))

frontend/src/utils/url.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@ export const isMatchingPage = (path: string) => {
22
const pattern = /^(?<prefix>\/matching)(?<ignore>\/.*)*$/;
33
return pattern.test(path);
44
};
5+
6+
export const isCollabPage = (path: string) => {
7+
const pattern = /^(?<prefix>\/collaboration)(?<ignore>\/.*)*$/;
8+
return pattern.test(path);
9+
};

0 commit comments

Comments
 (0)