Skip to content

Commit

Permalink
Merge pull request #80 from ruiqi7/feature/matching-websocket
Browse files Browse the repository at this point in the history
Remove navbar buttons from collab page
  • Loading branch information
nicolelim02 authored Oct 20, 2024
2 parents 14a2277 + 48d54fe commit c5be563
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
USE_AUTH_ERROR_MESSAGE,
USE_MATCH_ERROR_MESSAGE,
} from "../../utils/constants";
import { isMatchingPage } from "../../utils/url";
import { isMatchingPage, isCollabPage } from "../../utils/url";
import { useMatch } from "../../contexts/MatchContext";

type NavbarItem = { label: string; link: string; needsLogin: boolean };
Expand Down Expand Up @@ -82,7 +82,9 @@ const Navbar: React.FC<NavbarProps> = (props) => {
>
PeerPrep
</Typography>
{!isMatchingPage(path) ? (
{isCollabPage(path) ? (
<></>
) : !isMatchingPage(path) ? (
<Stack direction={"row"} alignItems={"center"} spacing={2}>
{navbarItems
.filter((item) => !item.needsLogin || (item.needsLogin && user))
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/utils/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ export const isMatchingPage = (path: string) => {
const pattern = /^(?<prefix>\/matching)(?<ignore>\/.*)*$/;
return pattern.test(path);
};

export const isCollabPage = (path: string) => {
const pattern = /^(?<prefix>\/collaboration)(?<ignore>\/.*)*$/;
return pattern.test(path);
};

0 comments on commit c5be563

Please sign in to comment.